openresty丰富错误信息。

pull/113/head
midoks 3 years ago
parent e8da5af673
commit ccc31de2d2
  1. 6
      plugins/openresty/index.py
  2. 8
      plugins/openresty/js/openresty.js

@ -209,6 +209,12 @@ def status():
def restyOp(method): def restyOp(method):
file = initDreplace() file = initDreplace()
# 启动时,先检查一下配置文件
check = getServerDir() + "/bin/openresty -t"
check_data = mw.execShell(check)
if check_data[1].find('test failed') != -1:
return check_data[1]
if not mw.isAppleSystem(): if not mw.isAppleSystem():
data = mw.execShell('systemctl ' + method + ' openresty') data = mw.execShell('systemctl ' + method + ' openresty')
if data[1] == '': if data[1] == '':

@ -97,12 +97,12 @@ function orPluginOpServiceOp(a,b,c,d,a,v){
} }
if( g.status && g.data != 'ok' ) { if( g.status && g.data != 'ok' ) {
layer.msg(g.data, {icon: 2,time: 3000,shade: 0.3,shadeClose: true}); layer.msg(g.data, {icon: 2,time: 10000,shade: 0.3});
} }
setTimeout(function(){ // setTimeout(function(){
location.reload(); // location.reload();
},2000); // },2000);
},'json').error(function() { },'json').error(function() {
layer.close(e); layer.close(e);
layer.msg('操作异常!', {icon: 2}); layer.msg('操作异常!', {icon: 2});

Loading…
Cancel
Save