From f45fb56e15e2925aca192867db0ef4ebb15d1f02 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 17 Feb 2020 02:21:27 +0900 Subject: [PATCH] Improve instance info page --- locales/ja-JP.yml | 6 + src/client/app.vue | 21 +- .../instance-stats.vue} | 198 ++++- src/client/pages/about.vue | 18 +- src/client/pages/instance/index.vue | 682 +++++++++--------- src/client/pages/instance/monitor.vue | 381 ---------- src/client/pages/instance/settings.vue | 413 +++++++++++ src/client/router.ts | 3 +- 8 files changed, 962 insertions(+), 760 deletions(-) rename src/client/{pages/instance/stats.vue => components/instance-stats.vue} (72%) delete mode 100644 src/client/pages/instance/monitor.vue create mode 100644 src/client/pages/instance/settings.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b628b91ab..f353654d1 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -403,6 +403,12 @@ regenerate: "再生成" fontSize: "フォントサイズ" noFollowRequests: "フォロー申請はありません" openImageInNewTab: "画像を新しいタブで開く" +dashboard: "ダッシュボード" +local: "ローカル" +remote: "リモート" +total: "合計" +weekOverWeekChanges: "前週比" +dayOverDayChanges: "前日比" _ago: unknown: "謎" diff --git a/src/client/app.vue b/src/client/app.vue index 1bfcd9e15..9a984a27f 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -413,9 +413,14 @@ export default Vue.extend({ this.$root.menu({ items: [{ type: 'link', - text: this.$t('statistics'), - to: '/instance/stats', - icon: faChartBar, + text: this.$t('dashboard'), + to: '/instance', + icon: faTachometerAlt, + }, null, { + type: 'link', + text: this.$t('settings'), + to: '/instance/settings', + icon: faCog, }, { type: 'link', text: this.$t('customEmojis'), @@ -431,11 +436,6 @@ export default Vue.extend({ text: this.$t('files'), to: '/instance/files', icon: faCloud, - }, { - type: 'link', - text: this.$t('monitor'), - to: '/instance/monitor', - icon: faTachometerAlt, }, { type: 'link', text: this.$t('jobQueue'), @@ -451,11 +451,6 @@ export default Vue.extend({ text: this.$t('announcements'), to: '/instance/announcements', icon: faBroadcastTower, - }, null, { - type: 'link', - text: this.$t('general'), - to: '/instance', - icon: faCog, }], align: 'left', fixed: true, diff --git a/src/client/pages/instance/stats.vue b/src/client/components/instance-stats.vue similarity index 72% rename from src/client/pages/instance/stats.vue rename to src/client/components/instance-stats.vue index 4883d8c87..a2625f4ab 100644 --- a/src/client/pages/instance/stats.vue +++ b/src/client/components/instance-stats.vue @@ -1,8 +1,91 @@ @@ -28,6 +26,7 @@ import Vue from 'vue'; import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import { version } from '../config'; import i18n from '../i18n'; +import MkInstanceStats from '../components/instance-stats.vue'; export default Vue.extend({ i18n, @@ -38,10 +37,13 @@ export default Vue.extend({ }; }, + components: { + MkInstanceStats + }, + data() { return { version, - stats: null, serverInfo: null, faInfoCircle } @@ -52,12 +54,6 @@ export default Vue.extend({ return this.$store.state.instance.meta; }, }, - - created() { - this.$root.api('stats').then(res => { - this.stats = res; - }); - }, }); diff --git a/src/client/pages/instance/index.vue b/src/client/pages/instance/index.vue index 5a4823241..db8898233 100644 --- a/src/client/pages/instance/index.vue +++ b/src/client/pages/instance/index.vue @@ -1,169 +1,54 @@