From aadd5b95b811dbd9d0fce9e622613a148e4ad7da Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 3 Nov 2018 11:38:00 +0900 Subject: Improve admin dashboard --- src/client/app/admin/views/ap-log.vue | 113 ++++++++++++++++++++++++++ src/client/app/admin/views/dashboard.vue | 23 ++++-- src/client/app/common/views/filters/bytes.ts | 1 + src/client/app/common/views/filters/number.ts | 1 + 4 files changed, 130 insertions(+), 8 deletions(-) create mode 100644 src/client/app/admin/views/ap-log.vue (limited to 'src/client') diff --git a/src/client/app/admin/views/ap-log.vue b/src/client/app/admin/views/ap-log.vue new file mode 100644 index 0000000000..a26627a90f --- /dev/null +++ b/src/client/app/admin/views/ap-log.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/src/client/app/admin/views/dashboard.vue b/src/client/app/admin/views/dashboard.vue index 95000d4bad..04a4de8746 100644 --- a/src/client/app/admin/views/dashboard.vue +++ b/src/client/app/admin/views/dashboard.vue @@ -7,6 +7,7 @@

Node{{ meta.node }}

藍ちゃかわいい

+
@@ -34,22 +35,22 @@
-
%fa:user%
+
%fa:database%
- %i18n:@accounts% - {{ stats.usersCount | number }} + %i18n:@drive% + {{ stats.driveUsageLocal | bytes }}
- %fa:globe% %i18n:@federated% + %fa:home% %i18n:@this-instance%
-
%fa:pencil-alt%
+
%fa:hdd R%
- %i18n:@notes% - {{ stats.notesCount | number }} + %i18n:@instances% + {{ stats.instances | number }}
@@ -65,6 +66,10 @@
+ +
+ +
@@ -72,11 +77,13 @@ import Vue from "vue"; import XCpuMemory from "./cpu-memory.vue"; import XCharts from "./charts.vue"; +import XApLog from "./ap-log.vue"; export default Vue.extend({ components: { XCpuMemory, - XCharts + XCharts, + XApLog }, data() { return { diff --git a/src/client/app/common/views/filters/bytes.ts b/src/client/app/common/views/filters/bytes.ts index f7a1b2690f..5b5d966cfd 100644 --- a/src/client/app/common/views/filters/bytes.ts +++ b/src/client/app/common/views/filters/bytes.ts @@ -1,6 +1,7 @@ import Vue from 'vue'; Vue.filter('bytes', (v, digits = 0) => { + if (v == null) return '?'; const sizes = ['B', 'KB', 'MB', 'GB', 'TB']; if (v == 0) return '0'; const isMinus = v < 0; diff --git a/src/client/app/common/views/filters/number.ts b/src/client/app/common/views/filters/number.ts index d9f48229dd..08f9fea805 100644 --- a/src/client/app/common/views/filters/number.ts +++ b/src/client/app/common/views/filters/number.ts @@ -1,5 +1,6 @@ import Vue from 'vue'; Vue.filter('number', (n) => { + if (n == null) return 'N/A'; return n.toLocaleString(); }); -- cgit v1.2.3-freya