-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<analytic-number icon="analytic:pulse" title="当前 QPS"> | ||
<template #default>{{ current }}</template> | ||
<template #footer-left>近期 QPS</template> | ||
<template #footer-right>{{ +recent.toFixed(2) }}</template> | ||
</analytic-number> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed, inject } from 'vue' | ||
import { store } from '@koishijs/client' | ||
import {} from '@koishijs/plugin-analytics/src' | ||
const AnalyticNumber = inject('component:analytic-number') | ||
const current = computed(() => { | ||
return Object.values(store.status.bots).reduce((acc, bot) => acc + bot.messageReceived, 0) | ||
}) | ||
const recent = computed(() => { | ||
return Object.values(store.analytics.messageByDate).slice(-7).reduce((acc, value) => acc + value.receive, 0) / 7 / 24 / 60 / 60 | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"> | ||
<path fill="currentColor" d="M640 240C640 248.8 632.8 256 624 256h-133.1l-60 150c-2.625 6.375-8.375 10.25-16 9.1C408 415.5 402.1 410.6 400.5 403.9l-78.75-315l-82 410.3C238.3 506.5 231.9 511.8 224.4 512H224c-7.25 0-13.75-5-15.5-12.12L147.5 256H16C7.201 256 0 248.8 0 240s7.201-15.1 16-15.1H160c7.375 0 13.75 4.993 15.5 12.12l46.75 187l82-410.3C305.8 5.5 312 .25 319.5 0c8.125 .125 14.25 4.875 16 12.12l84 336l45.63-114.1C467.5 228 473.5 224 480 224h144C632.8 224 640 231.2 640 240z"/> | ||
</svg> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters