-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
8 changed files
with
121 additions
and
25 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,49 @@ | ||
<template> | ||
<k-card class="k-card-numeric"> | ||
<i :class="`fas fa-${icon}`"/> | ||
<div class="content"> | ||
<p class="title">{{ title }}</p> | ||
<p class="value"><slot/></p> | ||
</div> | ||
</k-card> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { defineProps } from 'vue' | ||
defineProps<{ | ||
title: string | ||
icon: string | ||
to?: string | ||
}>() | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.k-card-numeric { | ||
i { | ||
font-size: 2.4rem; | ||
padding: 0.3rem 0; | ||
width: 3rem; | ||
text-align: center; | ||
} | ||
.content { | ||
float: right; | ||
text-align: right; | ||
} | ||
p { | ||
margin: 0; | ||
} | ||
.value { | ||
font-size: 1.2rem; | ||
margin-top: 0.2rem; | ||
color: rgba(244, 244, 245, .8); | ||
} | ||
} | ||
</style> |
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
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 |
---|---|---|
@@ -1,20 +1,47 @@ | ||
<template> | ||
<template v-if="status"> | ||
<load-chart :status="status"/> | ||
<history-chart :status="status"/> | ||
<hour-chart :status="status"/> | ||
<group-chart :status="status"/> | ||
<word-cloud :status="status"/> | ||
</template> | ||
<div class="basic-stats"> | ||
<k-card-numeric title="当前消息频率" icon="paper-plane">{{ upRate }} / min</k-card-numeric> | ||
<k-card-numeric title="近期消息频率" icon="history">{{ recentRate }} / d</k-card-numeric> | ||
<k-card-numeric title="命名插件数量" icon="plug">{{ status.pluginCount }}</k-card-numeric> | ||
<k-card-numeric title="数据库体积" icon="database">456 MB</k-card-numeric> | ||
<k-card-numeric title="活跃用户数量" icon="heart">456</k-card-numeric> | ||
<k-card-numeric title="活跃群数量" icon="users">32</k-card-numeric> | ||
</div> | ||
<load-chart :status="status"/> | ||
<history-chart :status="status"/> | ||
<hour-chart :status="status"/> | ||
<group-chart :status="status"/> | ||
<word-cloud :status="status"/> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
import { status } from '~/client' | ||
import GroupChart from './group-chart.vue' | ||
import HistoryChart from './history-chart.vue' | ||
import HourChart from './hour-chart.vue' | ||
import LoadChart from './load-chart.vue' | ||
import WordCloud from './word-cloud.vue' | ||
const upRate = computed(() => { | ||
return status.value.bots.reduce((sum, bot) => sum + bot.currentRate[0], 0) | ||
}) | ||
const recentRate = computed(() => { | ||
return status.value.bots.reduce((sum, bot) => sum + bot.recentRate[0], 0) | ||
}) | ||
</script> | ||
|
||
<style lang="scss"> | ||
.basic-stats { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
grid-template-rows: repeat(2, 1fr); | ||
grid-gap: 2rem; | ||
margin-bottom: 2rem; | ||
} | ||
</style> |
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
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