mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-06-27 00:10:00 +02:00
Add files via upload
This commit is contained in:
@@ -91,10 +91,12 @@
|
||||
"refresh": "Refresh",
|
||||
"refreshData": "Refresh data",
|
||||
"runningTasks": "Running tasks",
|
||||
"runningConversations": "Running conversations",
|
||||
"vulnTotal": "Total vulnerabilities",
|
||||
"toolCalls": "Tool invocations",
|
||||
"successRate": "Tool success rate",
|
||||
"clickToViewTasks": "Click to view tasks",
|
||||
"clickToViewChat": "Click to view conversations",
|
||||
"clickToViewVuln": "Click to view vulnerabilities",
|
||||
"clickToViewMCP": "Click to view MCP monitor",
|
||||
"accessOverviewTitle": "Access overview",
|
||||
|
||||
@@ -91,10 +91,12 @@
|
||||
"refresh": "刷新",
|
||||
"refreshData": "刷新数据",
|
||||
"runningTasks": "运行中任务",
|
||||
"runningConversations": "运行中对话",
|
||||
"vulnTotal": "漏洞总数",
|
||||
"toolCalls": "工具调用次数",
|
||||
"successRate": "工具执行成功率",
|
||||
"clickToViewTasks": "点击查看任务管理",
|
||||
"clickToViewChat": "点击查看对话",
|
||||
"clickToViewVuln": "点击查看漏洞管理",
|
||||
"clickToViewMCP": "点击查看 MCP 监控",
|
||||
"accessOverviewTitle": "接入概览",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 仪表盘页面:拉取运行中任务、漏洞统计、批量任务、工具与 Skills 统计并渲染。
|
||||
// 仪表盘页面:拉取运行中对话、漏洞统计、批量任务、工具与 Skills 统计并渲染。
|
||||
//
|
||||
// 工程基础设施:
|
||||
// - dashboardState 集中保存运行时状态(in-flight controller / 自动轮询 timer / 上次更新时间 /
|
||||
@@ -150,36 +150,24 @@ async function refreshDashboard() {
|
||||
// 如果在 await 期间 controller 已被 abort,说明又有新刷新启动了,丢弃本次结果
|
||||
if (signal && signal.aborted) return;
|
||||
|
||||
// 运行中任务:Agent 循环任务 + 批量队列「执行中」数量统一统计,避免顶部 KPI 与运行概览不一致
|
||||
// 运行中对话:仅统计 Agent 循环任务;批量队列见右侧「批量任务队列」
|
||||
let agentRunningCount = null;
|
||||
if (tasksRes && Array.isArray(tasksRes.tasks)) {
|
||||
agentRunningCount = tasksRes.tasks.length;
|
||||
}
|
||||
let batchRunningCount = 0;
|
||||
let batchPendingCount = 0;
|
||||
if (batchRes && Array.isArray(batchRes.queues)) {
|
||||
batchRes.queues.forEach(q => {
|
||||
const s = (q.status || '').toLowerCase();
|
||||
if (s === 'running') batchRunningCount++;
|
||||
else if (s === 'pending' || s === 'paused') batchPendingCount++;
|
||||
});
|
||||
}
|
||||
const totalRunning = (agentRunningCount || 0) + batchRunningCount;
|
||||
const runningConversations = agentRunningCount !== null ? agentRunningCount : 0;
|
||||
if (runningEl) {
|
||||
if (agentRunningCount !== null) {
|
||||
runningEl.textContent = String(totalRunning);
|
||||
} else if (batchRes && Array.isArray(batchRes.queues)) {
|
||||
runningEl.textContent = String(batchRunningCount);
|
||||
} else {
|
||||
runningEl.textContent = '-';
|
||||
}
|
||||
runningEl.textContent = agentRunningCount !== null ? String(agentRunningCount) : '-';
|
||||
}
|
||||
// KPI 副标:N 待执行 / 全部空闲
|
||||
if (batchPendingCount > 0) {
|
||||
setKpiSubBadge('dashboard-kpi-tasks-sub-text',
|
||||
dt('dashboard.pendingCountLabel', { count: batchPendingCount }, batchPendingCount + ' 待执行'),
|
||||
'pending');
|
||||
} else if (totalRunning === 0) {
|
||||
// KPI 副标:全部空闲 / 正在执行
|
||||
if (runningConversations === 0) {
|
||||
setKpiSubBadge('dashboard-kpi-tasks-sub-text', dt('dashboard.allIdle', null, '系统空闲'), 'idle');
|
||||
} else {
|
||||
setKpiSubBadge('dashboard-kpi-tasks-sub-text', dt('dashboard.executingNow', null, '正在执行'), 'running');
|
||||
@@ -405,7 +393,7 @@ async function refreshDashboard() {
|
||||
var toolsConfiguredCount = (toolsConfigRes && typeof toolsConfigRes.total === 'number')
|
||||
? toolsConfigRes.total : 0;
|
||||
updateSmartCTA({
|
||||
totalRunning: totalRunning,
|
||||
totalRunning: runningConversations + batchRunningCount,
|
||||
totalVulns: (vulnRes && typeof vulnRes.total === 'number') ? vulnRes.total : 0,
|
||||
totalCalls: toolsTotalCalls,
|
||||
toolsConfigured: toolsConfiguredCount,
|
||||
@@ -421,7 +409,7 @@ async function refreshDashboard() {
|
||||
failedTools: toolsFailedCount,
|
||||
toolsConfigured: toolsConfiguredCount,
|
||||
totalVulns: (vulnRes && typeof vulnRes.total === 'number') ? vulnRes.total : 0,
|
||||
totalRunning: totalRunning
|
||||
totalRunning: runningConversations + batchRunningCount
|
||||
});
|
||||
|
||||
// 更新「上次更新」时间
|
||||
|
||||
@@ -377,9 +377,9 @@
|
||||
</div>
|
||||
<!-- 第一行:核心 KPI(关键指标置顶 + 副标徽章承载次级信息) -->
|
||||
<div class="dashboard-kpi-row" id="dashboard-cards">
|
||||
<div class="dashboard-kpi-card" role="button" tabindex="0" onclick="switchPage('tasks')" onkeydown="if(event.key==='Enter'||event.key===' ') { event.preventDefault(); switchPage('tasks'); }" data-i18n="dashboard.clickToViewTasks" data-i18n-attr="title" title="点击查看任务管理">
|
||||
<div class="dashboard-kpi-card" role="button" tabindex="0" onclick="switchPage('chat')" onkeydown="if(event.key==='Enter'||event.key===' ') { event.preventDefault(); switchPage('chat'); }" data-i18n="dashboard.clickToViewChat" data-i18n-attr="title" title="点击查看对话">
|
||||
<div class="dashboard-kpi-head">
|
||||
<div class="dashboard-kpi-label" data-i18n="dashboard.runningTasks">运行中任务</div>
|
||||
<div class="dashboard-kpi-label" data-i18n="dashboard.runningConversations">运行中对话</div>
|
||||
<span class="dashboard-kpi-icon dashboard-kpi-icon-tasks" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4"/><path d="M12 18v4"/><path d="M4.93 4.93l2.83 2.83"/><path d="M16.24 16.24l2.83 2.83"/><path d="M2 12h4"/><path d="M18 12h4"/><path d="M4.93 19.07l2.83-2.83"/><path d="M16.24 7.76l2.83-2.83"/></svg></span>
|
||||
</div>
|
||||
<div class="dashboard-kpi-value" id="dashboard-running-tasks">-</div>
|
||||
|
||||
Reference in New Issue
Block a user