feat: add ops center and node onboarding flow

This commit is contained in:
Your Name
2026-04-18 23:52:51 +08:00
parent 246838ae4c
commit b9c29481b5
142 changed files with 89727 additions and 186 deletions

View File

@@ -100,6 +100,13 @@
:title="`当前检测状态:${currentPhaseLabel};本机 Worker ${status.worker_online ? '在线' : '离线'}。`"
style="margin-top: 12px"
/>
<el-alert
:closable="false"
show-icon
:type="status.worker_log_sync_enabled ? 'info' : 'warning'"
:title="remoteLogMirrorText"
style="margin-top: 12px"
/>
<el-row :gutter="12" style="margin-top: 16px; margin-bottom: 16px">
<el-col :xs="12" :sm="8" :md="4"><el-statistic title="待检测" :value="status.progress.pending || 0" /></el-col>
@@ -328,6 +335,11 @@ const status = ref({
dependency_alerts: [] as any[],
log_lines: [] as string[],
remote_log_lines: [] as string[],
remote_log_line_count: 0,
remote_log_last_at: "",
remote_log_last_line: "",
remote_log_nodes: [] as string[],
remote_log_node_count: 0,
runs: [] as any[],
worker_log_sync_enabled: false,
worker_log_sync_mode: "key",
@@ -487,6 +499,29 @@ const proxyDiagnosisText = computed(() => {
return status.value.proxy_runtime_label || "当前可用代理 / 配置代理池链接数";
});
const remoteLogMirrorText = computed(() => {
if (!status.value.worker_log_sync_enabled) {
return "当前已关闭远端日志回传;日志控制台只展示本机 Worker 输出,不会拼接其他节点的执行过程。";
}
const modeText = status.value.worker_log_sync_mode === "full" ? "全量" : "关键";
const nodeCount = Number(status.value.remote_log_node_count || 0);
const lineCount = Number(status.value.remote_log_line_count || 0);
const nodes = Array.isArray(status.value.remote_log_nodes) ? status.value.remote_log_nodes : [];
const lastAt = String(status.value.remote_log_last_at || "").trim();
const parts = [
`当前已开启${modeText}回传,日志控制台会自动拼接远端节点回传日志。`,
`来源节点 ${nodeCount}`,
`样本 ${lineCount}`,
];
if (nodes.length) {
parts.push(`节点:${nodes.join("、")}`);
}
if (lastAt) {
parts.push(`最近回传:${lastAt}`);
}
return parts.join("");
});
const queueAlertType = computed<"success" | "warning" | "info" | "error">(() => {
if (!queueSummary.value.has_active_job) return "info";
if ((queueSummary.value.queue?.overdue_leases || 0) > 0) return "error";