diff --git a/class/plugin/orm.py b/class/plugin/orm.py index f2b949c54..3e96ff9f1 100755 --- a/class/plugin/orm.py +++ b/class/plugin/orm.py @@ -65,6 +65,9 @@ class ORM: def setCharset(self, charset): self.__DB_CHARSET = charset + def setHost(self, host): + self.__DB_HOST = host + def setPort(self, port): self.__DB_PORT = port diff --git a/plugins/supervisor/index.py b/plugins/supervisor/index.py index ae162d68c..7344be95f 100755 --- a/plugins/supervisor/index.py +++ b/plugins/supervisor/index.py @@ -220,7 +220,8 @@ def getSupList(): infos = fr.readlines() for line in infos: if "command=" in line.strip(): - d["command"] = line.strip().split('=')[1] + # d["command"] = line.strip().split('=')[1] + d["command"] = "子配置查看" if "user=" in line.strip(): d["user"] = line.strip().split('=')[1] if "priority=" in line.strip(): @@ -329,6 +330,26 @@ def startJob(): return mw.returnJson(True, action + '[' + name + ']成功!') +def restartJob(): + args = getArgs() + data = checkArgs(args, ['name', 'status']) + if not data[0]: + return data[1] + + supCtl = 'supervisorctl -c ' + getServerDir() + "/supervisor.conf" + + name = args['name'] + status = args['status'] + + action = "启动" + cmd = supCtl + " restart " + name + data = mw.execShell(cmd) + + if data[1] != '': + return mw.returnJson(False, '[' + name + ']重启失败!') + return mw.returnJson(True, '[' + name + ']重启成功!') + + def delJob(): args = getArgs() data = checkArgs(args, ['name']) @@ -567,6 +588,8 @@ if __name__ == "__main__": print(addJob()) elif func == 'start_job': print(startJob()) + elif func == 'restart_job': + print(restartJob()) elif func == 'del_job': print(delJob()) elif func == 'update_job': diff --git a/plugins/supervisor/js/supervisor.js b/plugins/supervisor/js/supervisor.js index 844e9fb2a..ba9b16641 100755 --- a/plugins/supervisor/js/supervisor.js +++ b/plugins/supervisor/js/supervisor.js @@ -70,6 +70,7 @@ function supList(page, search){ list += '