From 839be6477d4b5870a03c82791af5a156882eadcb Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 24 Aug 2018 05:26:26 +0900 Subject: [PATCH 1/4] Return 404 for unknown API --- src/server/api/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 3ec7a28df..a8f6455d9 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -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()); From 5b5de6a89c26f2f32dc4f32a9657975994a8c503 Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 24 Aug 2018 05:41:03 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9HTML=E3=81=AF=20?= =?UTF-8?q?immutable=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/web/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 7291f8a0a..452e36fe9 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -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') }); }); From a294a881ec479b1a90b2c3ade4a160ddd2a03dac Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Aug 2018 06:41:53 +0900 Subject: [PATCH 3/4] Improve chart --- locales/ja-JP.yml | 9 +++ .../views/pages/admin/admin.chart.chart.ts | 5 -- .../desktop/views/pages/admin/admin.chart.vue | 76 +++++++++++++++---- 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 31b81f1d7..a74da8cd9 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -941,6 +941,11 @@ desktop/views/pages/admin/admin.unverify-user.vue: desktop/views/pages/admin/admin.chart.vue: title: "チャート" + per-day: "1時間ごと" + per-hour: "1日ごと" + notes: "投稿" + users: "ユーザー" + drive: "ドライブ" local-notes: "ローカルの投稿" remote-notes: "リモートの投稿" local-notes-total: "ローカルの投稿 (累計)" @@ -953,6 +958,10 @@ desktop/views/pages/admin/admin.chart.vue: 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: "メディア投稿のみ" diff --git a/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts b/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts index 62043b21d..d79b0ba19 100644 --- a/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts +++ b/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts @@ -26,11 +26,6 @@ export default Vue.extend({ scales: { xAxes: [{ type: 'time', - time: { - displayFormats: { - quarter: 'YYYY/MM/D h:mm' - } - }, distribution: 'series' }] } diff --git a/src/client/app/desktop/views/pages/admin/admin.chart.vue b/src/client/app/desktop/views/pages/admin/admin.chart.vue index c92caeb2f..4e0050e8b 100644 --- a/src/client/app/desktop/views/pages/admin/admin.chart.vue +++ b/src/client/app/desktop/views/pages/admin/admin.chart.vue @@ -3,21 +3,31 @@
%i18n:@title%:
- Per DAY | Per HOUR + %i18n:@per-day% | %i18n:@per-hour%
@@ -59,6 +69,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[] { @@ -76,11 +90,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 +129,7 @@ export default Vue.extend({ }] }]; }, + notesTotalChart(local: boolean): any { const data = this.stats.slice().reverse().map(x => ({ date: new Date(x.date), @@ -125,6 +148,7 @@ export default Vue.extend({ }] }]; }, + usersChart(local: boolean, total: boolean): any { const data = this.stats.slice().reverse().map(x => ({ date: new Date(x.date), @@ -145,6 +169,7 @@ export default Vue.extend({ }] }]; }, + driveChart(local: boolean, total: boolean): any { const data = this.stats.slice().reverse().map(x => ({ date: new Date(x.date), @@ -174,7 +199,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 })) + }] + }]; + }, } }); From 03b20e11ca8c8911a587b7104ce5f261c8d1bbd6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Aug 2018 06:42:40 +0900 Subject: [PATCH 4/4] 8.3.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9b42b7112..99a672e63 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.2.0", - "clientVersion": "1.0.8818", + "version": "8.3.0", + "clientVersion": "1.0.8825", "codename": "nighthike", "main": "./built/index.js", "private": true,