From 079b78c67996598daa29d2b16686b8251d854d9c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 16 Jun 2022 22:47:14 +0800 Subject: [PATCH] up --- plugins/supervisor/index.py | 18 +++++++++++++++++- plugins/supervisor/js/supervisor.js | 11 ++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/plugins/supervisor/index.py b/plugins/supervisor/index.py index 0e9dcea7b..1ec826843 100755 --- a/plugins/supervisor/index.py +++ b/plugins/supervisor/index.py @@ -224,7 +224,7 @@ def getSupList(): data = {} statusFile = getServerDir() + "/status.txt" - supCtl = 'supervisorctl' + supCtl = 'supervisorctl -c ' + getServerDir() + "/supervisor.conf" cmd = "%s update; %s status > %s" % (supCtl, supCtl, statusFile) mw.execShell(cmd) @@ -379,6 +379,22 @@ def getJobInfo(): return data[1] name = args['name'] + program = getServerDir() + "/conf.d/" + name + ".ini" + with open(program, "r") as fr: + infos = fr.readlines() + + for line in infos: + if "user=" in line.strip(): + mess["user"] = line.strip().split('=')[1] + if "numprocs=" in line.strip(): + mess["numprocs"] = line.strip().split('=')[1] + if "priority=" in line.strip(): + mess["priority"] = line.strip().split('=')[1] + userlist = getUserList() + info["userlist"] = userlist + info["daemoninfo"] = mess + return mw.getJson(info) + def runLog(): return getServerDir() + '/log/supervisor.log' diff --git a/plugins/supervisor/js/supervisor.js b/plugins/supervisor/js/supervisor.js index e8d5bdaf4..707a05fc7 100755 --- a/plugins/supervisor/js/supervisor.js +++ b/plugins/supervisor/js/supervisor.js @@ -43,7 +43,7 @@ function supList(page, search){ myPost('get_sup_list', _data, function(data){ var rdata = $.parseJSON(data.data); - console.log(rdata.data); + // console.log(rdata.data); var list = ''; for(i in rdata.data){ list += ''; @@ -57,8 +57,8 @@ function supList(page, search){ list += '' + rdata.data[i]['runStatus'] +''; list += '\ - 启动 | ' + - '改密 | ' + + 启动 | ' + + '修改 | ' + '删除' + ''; @@ -106,6 +106,11 @@ function supList(page, search){ } +function updateJob(name){ + +} + + //卸载软件 function delJob(name) { layer.confirm(msgTpl('是否删除守护进程[{1}]?', [name]), { icon: 3, closeBtn: 2 }, function() {