diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index 09b6b695c..239ba9086 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -1097,16 +1097,5 @@ function repTools(db_name, res){ ' }); tableFixed('database_fix'); - //表格头固定 - function tableFixed(name) { - var tableName = document.querySelector('#' + name); - tableName.addEventListener('scroll', scrollHandle); - } - - function scrollHandle(e) { - var scrollTop = this.scrollTop; - //this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)'; - $(this).find("thead").css({ "transform": "translateY(" + scrollTop + "px)", "position": "relative", "z-index": "1" }); - } }); } diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index 79fd59449..7d6cd9dc4 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -58,7 +58,6 @@ def checkArgs(data, ck=[]): return (True, public.returnJson(True, 'ok')) - def getConf(): path = public.getServerDir() + "/openresty/nginx/conf/nginx.conf" return path @@ -120,11 +119,9 @@ def start(): def stop(): path = public.getServerDir() + "/openresty/nginx/conf/waf" if os.path.exists(path): - cmd = 'rm -rf '+path + cmd = 'rm -rf ' + path public.execShell(cmd) - - path = getConf() conf = public.readFile(path) conf = conf.replace('include luawaf.conf;', "#include luawaf.conf;") @@ -141,14 +138,34 @@ def restart(): def reload(): stop() - public.execShell('rm -rf '+public.getServerDir() + "/openresty/nginx/logs/error.log") + public.execShell('rm -rf ' + public.getServerDir() + + "/openresty/nginx/logs/error.log") start() return 'ok' + def getJsonPath(name): - path = public.getServerDir() + "/openresty/nginx/conf/waf/"+name+".json" + path = public.getServerDir() + "/openresty/nginx/conf/waf/" + name + ".json" return path + +def getRuleJsonPath(name): + path = public.getServerDir() + "/openresty/nginx/conf/waf/rule/" + name + ".json" + return path + + +def getRule(): + args = getArgs() + data = checkArgs(args, ['rule_name']) + if not data[0]: + return data[1] + + rule_name = args['rule_name'] + fpath = getRuleJsonPath(rule_name) + content = public.readFile(fpath) + return public.returnJson(True, 'ok', content) + + def setObjStatus(): args = getArgs() data = checkArgs(args, ['obj', 'statusCode']) @@ -159,13 +176,14 @@ def setObjStatus(): content = public.readFile(conf) cobj = json.loads(content) - o = args['obj'] + o = args['obj'] status = args['statusCode'] cobj[o]['status'] = status cjson = public.getJson(cobj) - public.writeFile(conf,cjson) - return public.returnJson(True,'设置成功!') + public.writeFile(conf, cjson) + return public.returnJson(True, '设置成功!') + def setObjOpen(): args = getArgs() @@ -184,8 +202,9 @@ def setObjOpen(): cobj[o]["open"] = True cjson = public.getJson(cobj) - public.writeFile(conf,cjson) - return public.returnJson(True,'设置成功!') + public.writeFile(conf, cjson) + return public.returnJson(True, '设置成功!') + def getWafSrceen(): conf = getJsonPath('total') @@ -196,6 +215,7 @@ def getWafConf(): conf = getJsonPath('config') return public.readFile(conf) + def getWafSite(): return '' @@ -214,6 +234,8 @@ if __name__ == "__main__": print reload() elif func == 'conf': print getConf() + elif func == 'get_rule': + print getRule() elif func == 'set_obj_status': print setObjStatus() elif func == 'set_obj_open': diff --git a/plugins/op_waf/js/op_waf.js b/plugins/op_waf/js/op_waf.js index 263222b6d..dabea549e 100755 --- a/plugins/op_waf/js/op_waf.js +++ b/plugins/op_waf/js/op_waf.js @@ -15,6 +15,13 @@ function owPost(method, args, callback){ } +function getRuleByName(rule_name, callback){ + owPost('get_rule', {rule_name:rule_name}, function(data){ + callback(data); + }) +} + + function setRequestCode(ruleName, statusCode){ layer.open({ type: 1, @@ -207,6 +214,115 @@ function setRetry(retry_cycle, retry, retry_time, siteName) { } +//URL白名单 +function urlWhite(type) { + if (type == undefined) { + layer.open({ + type: 1, + title: "管理URL白名单", + area: ['500px', '400px'], + closeBtn: 2, + shadeClose: false, + content: '
URL | \ +操作 | \ +
---|