From 586d3c4db719e0c36d4d22a1718715c20d439fe7 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Mon, 17 Feb 2020 02:27:14 +0900
Subject: [PATCH] Better instance page

---
 src/client/pages/instance/index.vue    | 23 +++++++++++++
 src/client/pages/instance/settings.vue | 47 ++------------------------
 2 files changed, 25 insertions(+), 45 deletions(-)

diff --git a/src/client/pages/instance/index.vue b/src/client/pages/instance/index.vue
index db88982330..afe9c6d15c 100644
--- a/src/client/pages/instance/index.vue
+++ b/src/client/pages/instance/index.vue
@@ -51,6 +51,17 @@
 			</div>
 		</div>
 	</section>
+
+	<section class="_card info">
+		<div class="_content table">
+			<div><b>Misskey</b><span>v{{ version }}</span></div>
+		</div>
+		<div class="_content table" v-if="serverInfo">
+			<div><b>Node.js</b><span>{{ serverInfo.node }}</span></div>
+			<div><b>PostgreSQL</b><span>v{{ serverInfo.psql }}</span></div>
+			<div><b>Redis</b><span>v{{ serverInfo.redis }}</span></div>
+		</div>
+	</section>
 </div>
 </template>
 
@@ -409,5 +420,17 @@ export default Vue.extend({
 			}
 		}
 	}
+
+	> .info {
+		> .table {
+			> div {
+				display: flex;
+
+				> * {
+					flex: 1;
+				}
+			}
+		}
+	}
 }
 </style>
diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue
index 914565298a..93b9f665e6 100644
--- a/src/client/pages/instance/settings.vue
+++ b/src/client/pages/instance/settings.vue
@@ -1,5 +1,5 @@
 <template>
-<div v-if="meta" class="yihovjtf">
+<div v-if="meta">
 	<portal to="icon"><fa :icon="faCog"/></portal>
 	<portal to="title">{{ $t('settings') }}</portal>
 
@@ -150,22 +150,6 @@
 			<mk-button primary @click="save(true)"><fa :icon="faSave"/> {{ $t('save') }}</mk-button>
 		</div>
 	</section>
-
-	<section class="_card info">
-		<div class="_title"><fa :icon="faInfoCircle"/> {{ $t('instanceInfo') }}</div>
-		<div class="_content table" v-if="stats">
-			<div><b>{{ $t('users') }}</b><span>{{ stats.originalUsersCount | number }}</span></div>
-			<div><b>{{ $t('notes') }}</b><span>{{ stats.originalNotesCount | number }}</span></div>
-		</div>
-		<div class="_content table">
-			<div><b>Misskey</b><span>v{{ version }}</span></div>
-		</div>
-		<div class="_content table" v-if="serverInfo">
-			<div><b>Node.js</b><span>{{ serverInfo.node }}</span></div>
-			<div><b>PostgreSQL</b><span>v{{ serverInfo.psql }}</span></div>
-			<div><b>Redis</b><span>v{{ serverInfo.redis }}</span></div>
-		</div>
-	</section>
 </div>
 </template>
 
@@ -180,7 +164,7 @@ import MkTextarea from '../../components/ui/textarea.vue';
 import MkSwitch from '../../components/ui/switch.vue';
 import MkInfo from '../../components/ui/info.vue';
 import MkUserSelect from '../../components/user-select.vue';
-import { version, url } from '../../config';
+import { url } from '../../config';
 import i18n from '../../i18n';
 import getAcct from '../../../misc/acct/render';
 
@@ -203,10 +187,7 @@ export default Vue.extend({
 
 	data() {
 		return {
-			version,
 			url,
-			stats: null,
-			serverInfo: null,
 			proxyAccount: null,
 			proxyAccountId: null,
 			cacheRemoteFiles: false,
@@ -291,14 +272,6 @@ export default Vue.extend({
 				this.proxyAccount = proxyAccount;
 			});
 		}
-
-		this.$root.api('admin/server-info').then(res => {
-			this.serverInfo = res;
-		});
-
-		this.$root.api('stats').then(res => {
-			this.stats = res;
-		});
 	},
 
 	mounted() {
@@ -395,19 +368,3 @@ export default Vue.extend({
 	}
 });
 </script>
-
-<style lang="scss" scoped>
-.yihovjtf {
-	> .info {
-		> .table {
-			> div {
-				display: flex;
-
-				> * {
-					flex: 1;
-				}
-			}
-		}
-	}
-}
-</style>