加上指令列

This commit is contained in:
liuwei
2025-03-21 15:52:58 +08:00
parent 4db40c4e3e
commit 97f515ca1c

View File

@@ -216,7 +216,8 @@
// 准备数据
const sortedData = [...this.pluginStats].sort((a, b) => b.total_calls - a.total_calls).slice(0, 10);
const labels = sortedData.map(item => item.plugin_name);
// 修改这里:将插件名称和指令组合作为标签
const labels = sortedData.map(item => `${item.plugin_name}(${item.command})`);
const data = sortedData.map(item => item.total_calls);
// 创建新图表
@@ -256,7 +257,8 @@
.sort((a, b) => (b.success_calls / b.total_calls) - (a.success_calls / a.total_calls))
.slice(0, 10);
const labels = sortedData.map(item => item.plugin_name);
// 修改这里:将插件名称和指令组合作为标签
const labels = sortedData.map(item => `${item.plugin_name}(${item.command})`);
const data = sortedData.map(item => (item.success_calls / item.total_calls) * 100);
// 创建新图表
@@ -265,7 +267,7 @@
data: {
labels: labels,
datasets: [{
label: '成功率 (%)',
label: '成功率(%)',
data: data,
backgroundColor: 'rgba(75, 192, 192, 0.6)',
borderColor: 'rgba(75, 192, 192, 1)',