From 78ad69caeaccdad8801c2026689f01e8fc540f44 Mon Sep 17 00:00:00 2001 From: Shigma Date: Sun, 17 Dec 2023 01:02:59 +0800 Subject: [PATCH] feat(status): show QPS card --- plugins/status/client/analytics.vue | 25 +++++++++++++++++++++++++ plugins/status/client/icons/index.ts | 2 ++ plugins/status/client/icons/pulse.vue | 5 +++++ plugins/status/client/index.ts | 6 ++++++ 4 files changed, 38 insertions(+) create mode 100644 plugins/status/client/analytics.vue create mode 100644 plugins/status/client/icons/pulse.vue diff --git a/plugins/status/client/analytics.vue b/plugins/status/client/analytics.vue new file mode 100644 index 00000000..84452ac8 --- /dev/null +++ b/plugins/status/client/analytics.vue @@ -0,0 +1,25 @@ + + + diff --git a/plugins/status/client/icons/index.ts b/plugins/status/client/icons/index.ts index d15bae29..3e0275db 100644 --- a/plugins/status/client/icons/index.ts +++ b/plugins/status/client/icons/index.ts @@ -2,9 +2,11 @@ import { icons } from '@koishijs/client' import ArrowUp from './arrow-up.vue' import ArrowDown from './arrow-down.vue' import Platform from './platform.vue' +import Pulse from './pulse.vue' import Robot from './robot.vue' icons.register('arrow-up', ArrowUp) icons.register('arrow-down', ArrowDown) icons.register('platform', Platform) +icons.register('analytic:pulse', Pulse) icons.register('robot', Robot) diff --git a/plugins/status/client/icons/pulse.vue b/plugins/status/client/icons/pulse.vue new file mode 100644 index 00000000..bba0b609 --- /dev/null +++ b/plugins/status/client/icons/pulse.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/plugins/status/client/index.ts b/plugins/status/client/index.ts index 48dd1bbc..1feb40c6 100644 --- a/plugins/status/client/index.ts +++ b/plugins/status/client/index.ts @@ -2,6 +2,7 @@ import { defineExtension } from '@koishijs/client' import {} from '@koishijs/plugin-status/src' import Bots from './bots' import Load from './load' +import Analytics from './analytics.vue' import EnvInfo from './envinfo.vue' import './icons' @@ -13,4 +14,9 @@ export default defineExtension((ctx) => { type: 'status-left', component: EnvInfo, }) + + ctx.slot({ + type: 'analytic-number', + component: Analytics, + }) })