From 052e667f0357a059dd17f46ccce68d2598146724 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 23 Dec 2022 15:21:55 +0900 Subject: [PATCH] enhance(client): enhance dashboard of control panel --- CHANGELOG.md | 1 + packages/client/src/components/MkChart.vue | 23 +- .../src/pages/admin/overview.active-users.vue | 223 +++++++ .../src/pages/admin/overview.ap-requests.vue | 263 +++++++++ .../src/pages/admin/overview.federation.vue | 225 ++++--- .../src/pages/admin/overview.instances.vue | 52 ++ ...eue-chart.vue => overview.queue.chart.vue} | 118 ++-- .../client/src/pages/admin/overview.queue.vue | 127 ++++ .../client/src/pages/admin/overview.stats.vue | 153 +++++ .../client/src/pages/admin/overview.user.vue | 76 --- .../client/src/pages/admin/overview.users.vue | 55 ++ packages/client/src/pages/admin/overview.vue | 556 ++---------------- .../src/pages/admin/queue.chart.chart.vue | 4 + packages/client/src/scripts/chart-vline.ts | 21 + 14 files changed, 1145 insertions(+), 752 deletions(-) create mode 100644 packages/client/src/pages/admin/overview.active-users.vue create mode 100644 packages/client/src/pages/admin/overview.ap-requests.vue create mode 100644 packages/client/src/pages/admin/overview.instances.vue rename packages/client/src/pages/admin/{overview.queue-chart.vue => overview.queue.chart.vue} (55%) create mode 100644 packages/client/src/pages/admin/overview.queue.vue create mode 100644 packages/client/src/pages/admin/overview.stats.vue delete mode 100644 packages/client/src/pages/admin/overview.user.vue create mode 100644 packages/client/src/pages/admin/overview.users.vue create mode 100644 packages/client/src/scripts/chart-vline.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a38ad364..ad5fa430c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ You should also include the user name that made the change. - Client: Add new gabber kick sounds (thanks for noizenecio) - Client: Compress non-animated PNG files @saschanaz - Client: Youtube window player @sim1222 +- Client: enhance dashboard of control panel @syuilo ### Bugfixes - Server: 引用内の文章がnyaizeされてしまう問題を修正 @kabo2468 diff --git a/packages/client/src/components/MkChart.vue b/packages/client/src/components/MkChart.vue index d97b114f17..fbbc231b88 100644 --- a/packages/client/src/components/MkChart.vue +++ b/packages/client/src/components/MkChart.vue @@ -38,6 +38,7 @@ import gradient from 'chartjs-plugin-gradient'; import * as os from '@/os'; import { defaultStore } from '@/store'; import { useChartTooltip } from '@/scripts/use-chart-tooltip'; +import { chartVLine } from '@/scripts/chart-vline'; const props = defineProps({ src: { @@ -311,27 +312,7 @@ const render = () => { gradient, }, }, - plugins: [{ - id: 'vLine', - beforeDraw(chart, args, options) { - if (chart.tooltip?._active?.length) { - const activePoint = chart.tooltip._active[0]; - const ctx = chart.ctx; - const x = activePoint.element.x; - const topY = chart.scales.y.top; - const bottomY = chart.scales.y.bottom; - - ctx.save(); - ctx.beginPath(); - ctx.moveTo(x, bottomY); - ctx.lineTo(x, topY); - ctx.lineWidth = 1; - ctx.strokeStyle = vLineColor; - ctx.stroke(); - ctx.restore(); - } - }, - }], + plugins: [chartVLine(vLineColor)], }); }; diff --git a/packages/client/src/pages/admin/overview.active-users.vue b/packages/client/src/pages/admin/overview.active-users.vue new file mode 100644 index 0000000000..eb4cefb345 --- /dev/null +++ b/packages/client/src/pages/admin/overview.active-users.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/packages/client/src/pages/admin/overview.ap-requests.vue b/packages/client/src/pages/admin/overview.ap-requests.vue new file mode 100644 index 0000000000..65ba0075eb --- /dev/null +++ b/packages/client/src/pages/admin/overview.ap-requests.vue @@ -0,0 +1,263 @@ + + + + + + diff --git a/packages/client/src/pages/admin/overview.federation.vue b/packages/client/src/pages/admin/overview.federation.vue index e8cb5867a7..eb44fa23b7 100644 --- a/packages/client/src/pages/admin/overview.federation.vue +++ b/packages/client/src/pages/admin/overview.federation.vue @@ -1,100 +1,185 @@ - + diff --git a/packages/client/src/pages/admin/overview.instances.vue b/packages/client/src/pages/admin/overview.instances.vue new file mode 100644 index 0000000000..c13e2328fd --- /dev/null +++ b/packages/client/src/pages/admin/overview.instances.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/packages/client/src/pages/admin/overview.queue-chart.vue b/packages/client/src/pages/admin/overview.queue.chart.vue similarity index 55% rename from packages/client/src/pages/admin/overview.queue-chart.vue rename to packages/client/src/pages/admin/overview.queue.chart.vue index a2b748ad38..609ad5ebef 100644 --- a/packages/client/src/pages/admin/overview.queue-chart.vue +++ b/packages/client/src/pages/admin/overview.queue.chart.vue @@ -3,7 +3,7 @@ diff --git a/packages/client/src/pages/admin/overview.queue.vue b/packages/client/src/pages/admin/overview.queue.vue new file mode 100644 index 0000000000..9fd799e158 --- /dev/null +++ b/packages/client/src/pages/admin/overview.queue.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/packages/client/src/pages/admin/overview.stats.vue b/packages/client/src/pages/admin/overview.stats.vue new file mode 100644 index 0000000000..dc9146cffd --- /dev/null +++ b/packages/client/src/pages/admin/overview.stats.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/packages/client/src/pages/admin/overview.user.vue b/packages/client/src/pages/admin/overview.user.vue deleted file mode 100644 index 0dd4a749ba..0000000000 --- a/packages/client/src/pages/admin/overview.user.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/packages/client/src/pages/admin/overview.users.vue b/packages/client/src/pages/admin/overview.users.vue new file mode 100644 index 0000000000..05d7221c10 --- /dev/null +++ b/packages/client/src/pages/admin/overview.users.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/packages/client/src/pages/admin/overview.vue b/packages/client/src/pages/admin/overview.vue index 6c1f54186c..786a908720 100644 --- a/packages/client/src/pages/admin/overview.vue +++ b/packages/client/src/pages/admin/overview.vue @@ -1,207 +1,66 @@