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 += '\ '+sup_status_desc+' | ' + + '重启 | ' + '修改 | ' + '删除' + ''; @@ -128,6 +129,16 @@ function startOrStop(name,status){ }); } +function restartJob(name,status){ + myPost('restart_job',{'name':name,'status':status}, function(data){ + var rdata = $.parseJSON(data.data); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + setTimeout(function(){ + supList(1,10); + },2000); + }); +} + function updateJob(name){ myPost('get_job_info',{'name':name},function(data){ var rdata = $.parseJSON(data.data); diff --git a/plugins/webstats/conf/config.json b/plugins/webstats/conf/config.json index 1a92ebcc5..7e8e00f16 100644 --- a/plugins/webstats/conf/config.json +++ b/plugins/webstats/conf/config.json @@ -27,6 +27,7 @@ "gif", "jpg", "css", + "svg", "js", "ico", "woff2" diff --git a/plugins/webstats/lua/webstats_log.lua b/plugins/webstats/lua/webstats_log.lua index fc576a377..59e928e08 100644 --- a/plugins/webstats/lua/webstats_log.lua +++ b/plugins/webstats/lua/webstats_log.lua @@ -134,6 +134,7 @@ log_by_lua_block { local function exclude_url() if not ngx.var.uri then return false end + if not ngx.var.request_uri then return false end if not auto_config['exclude_url'] then return false end local the_uri = string.sub(ngx.var.request_uri, 2) local url_conf = auto_config["exclude_url"] diff --git a/route/templates/default/layout.html b/route/templates/default/layout.html index a8903950f..cad0d0d13 100755 --- a/route/templates/default/layout.html +++ b/route/templates/default/layout.html @@ -90,8 +90,12 @@ {% block content %}{% endblock %}