Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guluzhu
dr_py
提交
16618cb6
dr_py
项目概览
guluzhu
/
dr_py
与 Fork 源项目一致
Fork自
晚风拂柳颜 / dr_py
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
dr_py
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
16618cb6
编写于
10月 04, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
本地js自动变更搜索模式为1
上级
87a5059a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
4 deletion
+6
-4
base/rules.db
base/rules.db
+0
-0
controllers/home.py
controllers/home.py
+2
-2
js/rules.py
js/rules.py
+4
-2
未找到文件。
base/rules.db
浏览文件 @
16618cb6
无法预览此类型文件
controllers/home.py
浏览文件 @
16618cb6
...
...
@@ -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
)
...
...
js/rules.py
浏览文件 @
16618cb6
...
...
@@ -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
,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录