From 97f515ca1cdee6cf6db69e0f60b6a2b30f9b95e1 Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 21 Mar 2025 15:52:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=8C=87=E4=BB=A4=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/stats_dashboard/templates/index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/stats_dashboard/templates/index.html b/plugins/stats_dashboard/templates/index.html index c34cb0d..b4978e6 100644 --- a/plugins/stats_dashboard/templates/index.html +++ b/plugins/stats_dashboard/templates/index.html @@ -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)',