From 15f8c9552debbc2dba57938d050fb4cf42bf76f3 Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Tue, 4 Aug 2026 21:31:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(core,mgmt):=20list=20=E8=BF=94=E5=9B=9E=20r?= =?UTF-8?q?unning+command=20=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=88=97=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原 list 把 check()(命令字符串)放进 status 字段,前端误当状态显示, 命令列取不存在的 command 字段导致显示为空。 修复:list 返回 running(bool) + command(string),前端对应显示状态与命令。 --- core/src/main/pmc_mtd.cpp | 3 ++- static/public/mgmt/features/process.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/pmc_mtd.cpp b/core/src/main/pmc_mtd.cpp index 7ac9b6c..936c126 100644 --- a/core/src/main/pmc_mtd.cpp +++ b/core/src/main/pmc_mtd.cpp @@ -34,7 +34,8 @@ auto list() -> std::string { processes.push_back({ /* 向json中推入对象 */ {"index", i}, {"pid", ppool[i].pid()}, - {"status", ppool[i].check()} + {"running", ppool[i].isRunning()}, + {"command", ppool[i].check()} }); } diff --git a/static/public/mgmt/features/process.html b/static/public/mgmt/features/process.html index 7adad73..c3772ee 100644 --- a/static/public/mgmt/features/process.html +++ b/static/public/mgmt/features/process.html @@ -100,11 +100,11 @@ const p = list[i]; const tr = document.createElement("tr"); const pid = p.pid; - const status = p.status === true ? "运行中" : (p.status === false ? "已停止" : (p.status || "未知")); + const status = p.running === true ? "运行中" : (p.running === false ? "已停止" : "未知"); tr.innerHTML = `