This commit is contained in:
midoks 2019-05-01 17:23:37 +08:00
parent 15eabc51cb
commit 345808c200
2 changed files with 32 additions and 3 deletions

View File

@ -85,8 +85,12 @@ def initDomainInfo():
def initSiteInfo():
data = []
path_domains = getJsonPath('domains')
path_config = getJsonPath('config')
path_site = getJsonPath('site')
config_contents = public.readFile(path_config)
config_contents = json.loads(config_contents)
domain_contents = public.readFile(path_domains)
domain_contents = json.loads(domain_contents)
@ -109,9 +113,7 @@ def initSiteInfo():
tmp['post'] = True
tmp['open'] = False
data_cc = {}
data_cc['open'] = False
tmp['cc'] = data_cc
tmp['cc'] = config_contents['cc']
site_contents_new[name] = tmp

View File

@ -1040,6 +1040,33 @@ function siteWafConfig(siteName, type) {
<label class="btswitch-btn" for="closewaf_open" onclick="set_site_obj_state(\''+ siteName + '\',\'open\')" style="width:2.4em;height:1.4em;margin-bottom: 0"></label>\
</div>\
</div>\
<div class="lib-con">\
<div class="divtable">\
<table class="table table-hover waftable">\
<thead>\
<tr>\
<th>名称</th>\
<th>描述</th>\
<th width="80">状态</th>\
<th style="text-align: right;">操作</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>CC防御</td>\
<td><font style="color:red;">'+ rdata.cc.cycle + '</font> ,URI <font style="color:red;">' + rdata.cc.limit + '</font> ,IP <font style="color:red;">' + rdata.cc.endtime + '</font> </td>\
<td>\
<div class="ssh-item" style="margin-left:0">\
<input class="btswitch btswitch-ios" id="closecc" type="checkbox" '+ (rdata.cc.open ? 'checked' : '') + '>\
<label class="btswitch-btn" for="closecc" onclick="set_site_obj_state(\''+ siteName + '\',\'cc\')"></label>\
</div>\
</td>\
<td class="text-right"><a class="btlink" onclick="set_cc_rule('+ rdata.cc.cycle + ',' + rdata.cc.limit + ',' + rdata.cc.endtime + ',\'' + siteName + '\',' + rdata.cc.increase + ')">设置</a></td>\
</tr>\
</tbody>\
</table>\
</div>\
</div>\
<ul class="help-info-text c7">\
<li>注意: 此处大部分配置,仅对当前站点有效!</li>\
</ul>\