1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-09 12:14:43 +02:00

Compare commits

..

20 Commits
8.2.0 ... 8.5.0

Author SHA1 Message Date
syuilo
a827b6028d Merge pull request #2442 from syuilo/develop
8.5.0
2018-08-24 07:24:08 +09:00
syuilo
4517bf7342 8.5.0 2018-08-24 07:23:42 +09:00
syuilo
b21287262e チャート取得APIを誰でも利用できるようにするなど 2018-08-24 07:23:04 +09:00
syuilo
c1b47a2119 Add missing changelog 2018-08-24 07:20:26 +09:00
syuilo
caf625afee Merge pull request #2441 from syuilo/develop
8.4.0
2018-08-24 07:18:00 +09:00
syuilo
2bad3865a3 8.4.0 2018-08-24 07:17:40 +09:00
syuilo
3f7d248684 Improve chart 2018-08-24 07:17:17 +09:00
syuilo
6e179e7cde Fix 2018-08-24 07:06:25 +09:00
syuilo
87f248b8ec Merge pull request #2440 from syuilo/develop
8.3.1
2018-08-24 07:03:49 +09:00
syuilo
027140eccc 8.3.1 2018-08-24 07:03:25 +09:00
syuilo
92cf205c66 Fix bug 2018-08-24 07:02:52 +09:00
syuilo
fa3299840f Refactor 2018-08-24 07:02:27 +09:00
syuilo
2d4b183c14 Merge pull request #2439 from syuilo/develop
8.3.0
2018-08-24 06:43:12 +09:00
syuilo
03b20e11ca 8.3.0 2018-08-24 06:42:40 +09:00
syuilo
e0e006e284 Merge branch 'develop' of https://github.com/syuilo/misskey into develop 2018-08-24 06:41:56 +09:00
syuilo
a294a881ec Improve chart 2018-08-24 06:41:53 +09:00
syuilo
53926082e7 Merge pull request #2438 from mei23/mei-0824-basehtmlcc
ベースHTMLは immutableキャッシュしないようにする
2018-08-24 05:47:53 +09:00
mei23
5b5de6a89c ベースHTMLは immutableキャッシュしないようにする 2018-08-24 05:41:03 +09:00
syuilo
a11c991f83 Merge pull request #2436 from mei23/mei-0824-api404
/api/ 下の存在しないにURL対しては404を返すようにする
2018-08-24 05:40:30 +09:00
mei23
839be6477d Return 404 for unknown API 2018-08-24 05:26:26 +09:00
9 changed files with 126 additions and 58 deletions

View File

@@ -5,6 +5,16 @@ ChangeLog
This document describes breaking changes only.
8.0.0
-----
### Migration
起動する前に、`node cli/migration/8.0.0`してください。
Please run `node cli/migration/8.0.0` before launch.
7.0.0
-----

View File

@@ -941,18 +941,27 @@ desktop/views/pages/admin/admin.unverify-user.vue:
desktop/views/pages/admin/admin.chart.vue:
title: "チャート"
local-notes: "ローカルの投稿"
remote-notes: "リモートの投稿"
local-notes-total: "ローカルの投稿 (累計)"
remote-notes-total: "リモートの投稿 (累計)"
local-users: "ローカルのユーザー"
remote-users: "リモートのユーザー"
local-users-total: "ローカルのユーザー (累計)"
remote-users-total: "リモートのユーザー (累計)"
local-drive: "ローカルのドライブ使用量"
remote-drive: "リモートのドライブ使用量"
local-drive-total: "ローカルのドライブ使用量 (累計)"
remote-drive-total: "リモートのドライブ使用量 (累計)"
per-day: "1日ごと"
per-hour: "1時間ごと"
notes: "投稿"
users: "ユーザー"
drive: "ドライブ"
local-notes: "ローカルの投稿の増減"
remote-notes: "リモートの投稿の増減"
local-notes-total: "ローカルの投稿の累計"
remote-notes-total: "リモートの投稿の累計"
local-users: "ローカルのユーザーの増減"
remote-users: "リモートのユーザーの増減"
local-users-total: "ローカルのユーザーの累計"
remote-users-total: "リモートのユーザーの累計"
local-drive: "ローカルのドライブ使用量の増減"
remote-drive: "リモートのドライブ使用量の増減"
local-drive-total: "ローカルのドライブ使用量の累計"
remote-drive-total: "リモートのドライブ使用量の累計"
local-drive-files: "ローカルのドライブのファイル数の増減"
remote-drive-files: "リモートのドライブのファイル数の増減"
local-drive-files-total: "ローカルのドライブのファイル数の累計"
remote-drive-files-total: "リモートのドライブのファイル数の累計"
desktop/views/pages/deck/deck.tl-column.vue:
is-media-only: "メディア投稿のみ"

View File

@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "8.2.0",
"clientVersion": "1.0.8818",
"version": "8.5.0",
"clientVersion": "1.0.8834",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@@ -150,6 +150,7 @@
"loader-utils": "1.1.0",
"lodash.assign": "4.2.0",
"mecab-async": "0.1.2",
"merge-options": "1.0.1",
"minio": "7.0.0",
"mkdirp": "0.5.1",
"mocha": "5.2.0",

View File

@@ -1,5 +1,6 @@
import Vue from 'vue';
import { Line } from 'vue-chartjs';
import * as mergeOptions from 'merge-options';
export default Vue.extend({
extends: Line,
@@ -21,16 +22,12 @@ export default Vue.extend({
},
methods: {
render() {
this.renderChart(this.data, Object.assign({
responsive: false,
this.renderChart(this.data, mergeOptions({
responsive: true,
maintainAspectRatio: false,
scales: {
xAxes: [{
type: 'time',
time: {
displayFormats: {
quarter: 'YYYY/MM/D h:mm'
}
},
distribution: 'series'
}]
}

View File

@@ -3,24 +3,36 @@
<header>
<b>%i18n:@title%:</b>
<select v-model="chartType">
<option value="local-users">%i18n:@local-users%</option>
<option value="remote-users">%i18n:@remote-users%</option>
<option value="local-users-total">%i18n:@local-users-total%</option>
<option value="remote-users-total">%i18n:@remote-users-total%</option>
<option value="local-notes">%i18n:@local-notes%</option>
<option value="remote-notes">%i18n:@remote-notes%</option>
<option value="local-notes-total">%i18n:@local-notes-total%</option>
<option value="remote-notes-total">%i18n:@remote-notes-total%</option>
<option value="local-drive">%i18n:@local-drive%</option>
<option value="remote-drive">%i18n:@remote-drive%</option>
<option value="local-drive-total">%i18n:@local-drive-total%</option>
<option value="remote-drive-total">%i18n:@remote-drive-total%</option>
<optgroup label="%i18n:@users%">
<option value="local-users">%i18n:@local-users%</option>
<option value="remote-users">%i18n:@remote-users%</option>
<option value="local-users-total">%i18n:@local-users-total%</option>
<option value="remote-users-total">%i18n:@remote-users-total%</option>
</optgroup>
<optgroup label="%i18n:@notes%">
<option value="local-notes">%i18n:@local-notes%</option>
<option value="remote-notes">%i18n:@remote-notes%</option>
<option value="local-notes-total">%i18n:@local-notes-total%</option>
<option value="remote-notes-total">%i18n:@remote-notes-total%</option>
</optgroup>
<optgroup label="%i18n:@drive%">
<option value="local-drive-files">%i18n:@local-drive-files%</option>
<option value="remote-drive-files">%i18n:@remote-drive-files%</option>
<option value="local-drive-files-total">%i18n:@local-drive-files-total%</option>
<option value="remote-drive-files-total">%i18n:@remote-drive-files-total%</option>
<option value="local-drive">%i18n:@local-drive%</option>
<option value="remote-drive">%i18n:@remote-drive%</option>
<option value="local-drive-total">%i18n:@local-drive-total%</option>
<option value="remote-drive-total">%i18n:@remote-drive-total%</option>
</optgroup>
</select>
<div>
<a @click="span = 'day'">Per DAY</a> | <a @click="span = 'hour'">Per HOUR</a>
<a @click="span = 'day'">%i18n:@per-day%</a> | <a @click="span = 'hour'">%i18n:@per-hour%</a>
</div>
</header>
<x-chart v-if="chart" :data="data[0]" :opts="data[1]" :width="720" :height="300"/>
<div>
<x-chart v-if="chart" :data="data[0]" :opts="data[1]"/>
</div>
</div>
</template>
@@ -32,13 +44,9 @@ export default Vue.extend({
components: {
XChart
},
props: {
chart: {
required: true
}
},
data() {
return {
chart: null,
chartType: 'local-notes',
span: 'hour'
};
@@ -59,6 +67,10 @@ export default Vue.extend({
case 'remote-drive': return this.driveChart(false, false);
case 'local-drive-total': return this.driveChart(true, true);
case 'remote-drive-total': return this.driveChart(false, true);
case 'local-drive-files': return this.driveFilesChart(true, false);
case 'remote-drive-files': return this.driveFilesChart(false, false);
case 'local-drive-files-total': return this.driveFilesChart(true, true);
case 'remote-drive-files-total': return this.driveFilesChart(false, true);
}
},
stats(): any[] {
@@ -69,6 +81,11 @@ export default Vue.extend({
);
}
},
created() {
(this as any).api('chart').then(chart => {
this.chart = chart;
});
},
methods: {
notesChart(local: boolean): any {
const data = this.stats.slice().reverse().map(x => ({
@@ -76,11 +93,19 @@ export default Vue.extend({
normal: local ? x.notes.local.diffs.normal : x.notes.remote.diffs.normal,
reply: local ? x.notes.local.diffs.reply : x.notes.remote.diffs.reply,
renote: local ? x.notes.local.diffs.renote : x.notes.remote.diffs.renote,
total: local ? x.notes.local.diff : x.notes.remote.diff
all: local ? x.notes.local.diff : x.notes.remote.diff
}));
return [{
datasets: [{
label: 'All',
fill: false,
borderColor: '#555',
borderWidth: 2,
pointBackgroundColor: '#fff',
lineTension: 0,
data: data.map(x => ({ t: x.date, y: x.all }))
}, {
label: 'Normal',
fill: false,
borderColor: '#41ddde',
@@ -107,6 +132,7 @@ export default Vue.extend({
}]
}];
},
notesTotalChart(local: boolean): any {
const data = this.stats.slice().reverse().map(x => ({
date: new Date(x.date),
@@ -116,7 +142,7 @@ export default Vue.extend({
return [{
datasets: [{
label: local ? 'Local Notes' : 'Remote Notes',
fill: false,
fill: true,
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -125,6 +151,7 @@ export default Vue.extend({
}]
}];
},
usersChart(local: boolean, total: boolean): any {
const data = this.stats.slice().reverse().map(x => ({
date: new Date(x.date),
@@ -136,7 +163,7 @@ export default Vue.extend({
return [{
datasets: [{
label: local ? 'Local Users' : 'Remote Users',
fill: false,
fill: true,
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -145,10 +172,11 @@ export default Vue.extend({
}]
}];
},
driveChart(local: boolean, total: boolean): any {
const data = this.stats.slice().reverse().map(x => ({
date: new Date(x.date),
count: local ?
size: local ?
total ? x.drive.local.totalSize : x.drive.local.diffSize :
total ? x.drive.remote.totalSize : x.drive.remote.diffSize
}));
@@ -156,12 +184,12 @@ export default Vue.extend({
return [{
datasets: [{
label: local ? 'Local Drive Usage' : 'Remote Drive Usage',
fill: false,
fill: true,
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
lineTension: 0,
data: data.map(x => ({ t: x.date, y: x.count }))
data: data.map(x => ({ t: x.date, y: x.size }))
}]
}, {
scales: {
@@ -174,7 +202,28 @@ export default Vue.extend({
}]
}
}];
}
},
driveFilesChart(local: boolean, total: boolean): any {
const data = this.stats.slice().reverse().map(x => ({
date: new Date(x.date),
count: local ?
total ? x.drive.local.totalCount : x.drive.local.diffCount :
total ? x.drive.remote.totalCount : x.drive.remote.diffCount
}));
return [{
datasets: [{
label: local ? 'Local Drive Files' : 'Remote Drive Files',
fill: false,
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
lineTension: 0,
data: data.map(x => ({ t: x.date, y: x.count }))
}]
}];
},
}
});
</script>
@@ -192,4 +241,9 @@ export default Vue.extend({
> *:last-child
margin-left auto
> div
> *
display block
height 300px
</style>

View File

@@ -11,7 +11,7 @@
<main>
<div v-show="page == 'dashboard'">
<x-dashboard/>
<x-chart :chart="chart"/>
<x-chart/>
</div>
<div v-if="page == 'users'">
<x-suspend-user/>
@@ -49,11 +49,6 @@ export default Vue.extend({
chart: null
};
},
created() {
(this as any).api('admin/chart').then(chart => {
this.chart = chart;
});
},
methods: {
nav(page: string) {
this.page = page;

View File

@@ -1,10 +1,8 @@
import Stats, { IStats } from '../../../../models/stats';
import Stats, { IStats } from '../../../models/stats';
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export const meta = {
requireCredential: true,
requireAdmin: true
};
export default (params: any) => new Promise(async (res, rej) => {

View File

@@ -46,6 +46,11 @@ router.post('/signin', require('./private/signin').default);
router.use(require('./service/github').routes());
router.use(require('./service/twitter').routes());
// Return 404 for unknown API
router.all('*', async ctx => {
ctx.status = 404;
});
// Register router
app.use(router.routes());

View File

@@ -122,8 +122,7 @@ router.get('/notes/:note', async ctx => {
router.get('*', async ctx => {
await send(ctx, `app/base.html`, {
root: client,
maxage: ms('3 days'),
immutable: true
maxage: ms('5m')
});
});