插件看板数据更改
This commit is contained in:
@@ -48,6 +48,57 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加平均响应时间卡片 -->
|
||||
<el-row :gutter="20" style="margin-top: 20px;">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stats-card">
|
||||
<div slot="header">
|
||||
<span>平均响应时间</span>
|
||||
</div>
|
||||
<div style="font-size: 24px; text-align: center;">
|
||||
{{ avgResponseTime.toFixed(2) }} ms
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加热门用户、群组和插件 -->
|
||||
<el-row :gutter="20" style="margin-top: 20px;">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<div slot="header">
|
||||
<span>热门用户</span>
|
||||
</div>
|
||||
<el-table :data="topUsers" style="width: 100%">
|
||||
<el-table-column prop="user_id" label="用户ID"></el-table-column>
|
||||
<el-table-column prop="total_calls" label="调用次数"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<div slot="header">
|
||||
<span>热门群组</span>
|
||||
</div>
|
||||
<el-table :data="topGroups" style="width: 100%">
|
||||
<el-table-column prop="group_id" label="群组ID"></el-table-column>
|
||||
<el-table-column prop="total_calls" label="调用次数"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<div slot="header">
|
||||
<span>热门插件</span>
|
||||
</div>
|
||||
<el-table :data="topPlugins" style="width: 100%">
|
||||
<el-table-column prop="plugin_name" label="插件名称"></el-table-column>
|
||||
<el-table-column prop="total_calls" label="调用次数"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="chart-container">
|
||||
@@ -85,6 +136,10 @@
|
||||
successRate: 0,
|
||||
activeUsers: 0,
|
||||
activeGroups: 0,
|
||||
avgResponseTime: 0,
|
||||
topUsers: [],
|
||||
topGroups: [],
|
||||
topPlugins: [],
|
||||
pluginStats: []
|
||||
}
|
||||
},
|
||||
@@ -104,10 +159,14 @@
|
||||
.then(response => {
|
||||
if (response.data.success) {
|
||||
const data = response.data.data;
|
||||
this.totalCalls = data.total_calls || 0;
|
||||
this.successRate = data.success_rate || 0;
|
||||
this.totalCalls = parseInt(data.total_calls) || 0;
|
||||
this.successRate = parseFloat(data.success_rate) || 0;
|
||||
this.activeUsers = data.active_users || 0;
|
||||
this.activeGroups = data.active_groups || 0;
|
||||
this.avgResponseTime = data.avg_response_time || 0;
|
||||
this.topUsers = data.top_users || [];
|
||||
this.topGroups = data.top_groups || [];
|
||||
this.topPlugins = data.top_plugins || [];
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user