From 16618cb6608f85d0f004bf8fdc0389352eed3665 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Tue, 4 Oct 2022 08:39:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0js=E8=87=AA=E5=8A=A8=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=90=9C=E7=B4=A2=E6=A8=A1=E5=BC=8F=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/rules.db | Bin 86016 -> 86016 bytes controllers/home.py | 4 ++-- js/rules.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/base/rules.db b/base/rules.db index d2dc06ad7914f27ff1c2036d6f30edd22e8cae90..dfaa117be53fbfc0e01d50971c7b6d695899731b 100644 GIT binary patch delta 22 ecmZozz}m2Yb%HeG`-w8njPDy0wk9wx@CN{5_6V#1 delta 22 ecmZozz}m2Yb%HeG>xnYXjISFLwk9wx@CN{5q6nk_ diff --git a/controllers/home.py b/controllers/home.py index 82e3853..4f88780 100644 --- a/controllers/home.py +++ b/controllers/home.py @@ -226,7 +226,7 @@ def config_render(mode): alists = getAlist() alists_str = json.dumps(alists, ensure_ascii=False) live_url = get_live_url(new_conf,mode) - rules = getRules('js') + rules = getRules('js',js_mode) rules = get_multi_rules(rules) # html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,base64Encode=base64Encode,config=new_conf) html = render_template('config.txt',pys=pys,rules=rules,host=host,mode=mode,js_mode=js_mode,jxs=jxs,alists=alists,alists_str=alists_str,live_url=live_url,config=new_conf) @@ -255,7 +255,7 @@ def config_gen(): pys = getPys() if use_py else False alists = getAlist() alists_str = json.dumps(alists,ensure_ascii=False) - rules = getRules('js') + rules = getRules('js',js_mode) rules = get_multi_rules(rules) host0 = getHost(0) jxs = getJxs(host=host0) diff --git a/js/rules.py b/js/rules.py index c39d94a..c56450b 100644 --- a/js/rules.py +++ b/js/rules.py @@ -29,8 +29,9 @@ def getCacheCount(): file_name = list(filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0, file_name)) return len(file_name) -def getRules(path='cache'): +def getRules(path='cache',js_mode=0): t1 = time() + base_path = path+'/' # 当前文件所在目录 # print(base_path) os.makedirs(base_path,exist_ok=True) @@ -70,9 +71,10 @@ def getRules(path='cache'): # print(rule_codes[0].quickSearch) new_rule_list = [] for i in range(len(rule_list)): + sable = rule_codes[i].searchable or 0 tmpObj = { 'name':rule_list[i], - 'searchable':rule_codes[i].searchable or 0, + 'searchable':1 if (js_mode==1 and sable==2) else sable, 'quickSearch':rule_codes[i].quickSearch or 0, 'filterable':rule_codes[i].filterable or 0, } -- GitLab