Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
dr_py
提交
6e657130
dr_py
项目概览
言程序plus
/
dr_py
与 Fork 源项目一致
从无法访问的项目Fork
通知
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看板
提交
6e657130
编写于
1月 10, 2023
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了搜索统计看板
上级
41ea69a8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
133 addition
and
29 deletion
+133
-29
controllers/vod.py
controllers/vod.py
+42
-28
js/version.txt
js/version.txt
+1
-1
templates/admin.html
templates/admin.html
+1
-0
templates/show_search.html
templates/show_search.html
+89
-0
未找到文件。
controllers/vod.py
浏览文件 @
6e657130
...
...
@@ -200,49 +200,55 @@ def sort_lsg_rules2(sites:list,lsg_rule_names:list):
sites
.
sort
(
key
=
functools
.
cmp_to_key
(
comp
),
reverse
=
False
)
return
sites
def
multi_search
(
wd
):
def
getSearchSites
():
val
=
{}
lsg
=
storage_service
()
env
=
get_env
()
t1
=
time
()
try
:
timeout
=
round
(
int
(
lsg
.
getItem
(
'SEARCH_TIMEOUT'
,
5000
))
/
1000
,
2
)
except
:
timeout
=
5
val
[
'timeout'
]
=
timeout
rules
=
getRules
(
'js'
)[
'list'
]
rule_names
=
list
(
map
(
lambda
x
:
x
[
'name'
],
rules
))
rule_names
=
list
(
map
(
lambda
x
:
x
[
'name'
],
rules
))
rules_exclude
=
[
'drpy'
]
new_rules
=
list
(
filter
(
lambda
x
:
x
.
get
(
'searchable'
,
0
)
and
x
.
get
(
'name'
,
''
)
not
in
rules_exclude
,
rules
))
search_sites
=
[
new_rule
[
'name'
]
for
new_rule
in
new_rules
]
# print(search_sites)
nosearch_sites
=
set
(
rule_names
)
^
set
(
search_sites
)
total_search
=
[
new_rule
[
'name'
]
for
new_rule
in
new_rules
]
nosearch_sites
=
set
(
rule_names
)
^
set
(
total_search
)
nosearch_sites
.
remove
(
'drpy'
)
# print(nosearch_sites)
logger
.
info
(
f
'开始聚搜
{
wd
}
,共计
{
len
(
search_sites
)
}
个规则,聚搜超时
{
timeout
}
秒'
)
logger
.
info
(
f
'不支持聚搜的规则,共计
{
len
(
nosearch_sites
)
}
个规则:
{
","
.
join
(
nosearch_sites
)
}
'
)
search_sites
=
merged_hide
(
search_sites
)
# print(len(search_sites))
# search_sites = []
val
[
'total_search'
]
=
total_search
val
[
'nosearch_sites'
]
=
list
(
nosearch_sites
)
search_sites
=
merged_hide
(
total_search
)
lsg_rules
=
rules_service
()
lsg_rule_list
=
lsg_rules
.
query_all
()
# print(len(lsg_rule_list))
# rule_names = list(map(lambda x: x['name'], rule_list))
lsg_rule_list
=
list
(
filter
(
lambda
x
:
x
[
'name'
]
in
search_sites
,
lsg_rule_list
))
lsg_rule_list
=
list
(
filter
(
lambda
x
:
x
[
'name'
]
in
search_sites
,
lsg_rule_list
))
lsg_rule_names
=
list
(
map
(
lambda
x
:
x
[
'name'
],
lsg_rule_list
))
search_sites
=
sort_lsg_rules2
(
search_sites
,
lsg_rule_names
)
# print(len(lsg_rule_list))
# lsg_rule_list = sort_lsg_rules(lsg_rule_list)
# print(len(lsg_rule_list))
# print(search_sites)
SEARCH_LIMIT
=
lsg
.
getItem
(
'SEARCH_LIMIT'
,
24
)
search_sites
=
sort_lsg_rules2
(
search_sites
,
lsg_rule_names
)
search_limit
=
lsg
.
getItem
(
'SEARCH_LIMIT'
,
24
)
try
:
SEARCH_LIMIT
=
int
(
SEARCH_LIMIT
)
search_limit
=
int
(
search_limit
)
except
:
SEARCH_LIMIT
=
0
if
SEARCH_LIMIT
<
1
:
SEARCH_LIMIT
=
0
search_sites
=
search_sites
[:
SEARCH_LIMIT
]
msearch_msg
=
f
'搜索限制条数:
{
SEARCH_LIMIT
}
/
{
len
(
search_sites
)
}
{
search_sites
}
'
search_limit
=
0
if
search_limit
<
1
:
search_limit
=
0
search_sites
=
search_sites
[:
search_limit
]
val
[
'search_limit'
]
=
search_limit
val
[
'search_sites'
]
=
search_sites
return
val
def
multi_search
(
wd
):
t1
=
time
()
val
=
getSearchSites
()
timeout
=
val
[
'timeout'
]
total_search
=
val
[
'total_search'
]
nosearch_sites
=
val
[
'nosearch_sites'
]
search_limit
=
val
[
'search_limit'
]
search_sites
=
val
[
'search_sites'
]
env
=
get_env
()
logger
.
info
(
f
'开始聚搜
{
wd
}
,共计
{
len
(
total_search
)
}
个规则,聚搜超时
{
timeout
}
秒'
)
logger
.
info
(
f
'不支持聚搜的规则,共计
{
len
(
nosearch_sites
)
}
个规则:
{
","
.
join
(
nosearch_sites
)
}
'
)
msearch_msg
=
f
'搜索限制条数:
{
search_limit
}
/
{
len
(
search_sites
)
}
{
search_sites
}
'
logger
.
info
(
msearch_msg
)
print
(
msearch_msg
)
# search_sites = []
...
...
@@ -273,6 +279,14 @@ def multi_search(wd):
"list"
:
res
})
@
vod
.
route
(
'/vods'
)
def
vods_search
():
val
=
getSearchSites
()
print
(
val
)
# return jsonify(val)
return
render_template
(
'show_search.html'
,
val
=
val
)
@
vod
.
route
(
'/vod'
)
def
vod_home
():
lsg
=
storage_service
()
...
...
js/version.txt
浏览文件 @
6e657130
3.9.34beta6
\ No newline at end of file
3.9.34beta7
\ No newline at end of file
templates/admin.html
浏览文件 @
6e657130
...
...
@@ -224,6 +224,7 @@ function getFileSize(fileObj) {
id=
"lives"
>
直播列表
</a></button>
<button
type=
"button"
class=
"yongyin"
><a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"logtail"
>
在线日志
</a></button>
<button
type=
"button"
class=
"yongyin4"
><a
href=
"/vods"
class=
"funcbtn"
target=
"_blank"
>
搜索看板
</a></button>
<input
id=
"live_url"
value=
"{{live_url}}"
style=
"display: none"
>
...
...
templates/show_search.html
0 → 100644
浏览文件 @
6e657130
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<link
rel=
"shortcut icon"
href=
"/favicon.ico"
type=
"image/x-icon"
>
<meta
http-equiv=
"Cache-Control"
content=
"no-siteapp;no-transform"
>
<meta
name=
"applicable-device"
content=
"pc,mobile"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
>
<title>
drpy搜索统计
</title>
<script
src=
"/static/js/jquery.min.js"
></script>
<link
rel=
"stylesheet"
media=
"screen"
href=
"/static/css/home.css"
>
<script
src=
"/static/js/grey.js"
></script>
<link
href=
"/static/css/jquery-confirm.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery-confirm.min.js"
></script>
</head>
<body>
<div
class=
"image"
>
<script>
$
(
document
).
ready
(
function
()
{
$
(
"
#nosearch_sites
"
).
click
(
function
()
{
let
a
=
"
{{val.nosearch_sites|safe}}
"
;
// console.log(a);
let
nosearch_sites
=
eval
(
a
);
console
.
log
(
nosearch_sites
);
let
ss_sites
=
nosearch_sites
.
join
(
'
,
'
);
// console.log(ss_sites);
// $.alert(ss_sites);
$
.
alert
({
title
:
'
不可搜索统计:
'
+
nosearch_sites
.
length
,
content
:
ss_sites
,
buttons
:
{
ok
:
{
text
:
'
确认
'
,
btnClass
:
'
btn-primary
'
,
action
:
function
()
{
}
}
}});
});
$
(
"
#search_sites
"
).
click
(
function
()
{
let
a
=
"
{{val.search_sites|safe}}
"
;
// console.log(a);
let
search_sites
=
eval
(
a
);
console
.
log
(
search_sites
);
let
ss_sites
=
search_sites
.
join
(
'
,
'
);
// console.log(ss_sites);
// $.alert(ss_sites);
$
.
alert
({
title
:
'
可搜索统计:
'
+
search_sites
.
length
,
content
:
ss_sites
,
buttons
:
{
ok
:
{
text
:
'
确认
'
,
btnClass
:
'
btn-primary
'
,
action
:
function
()
{
}
}
}});
});
});
</script>
<h2
class=
"title"
>
欢迎使用drpy搜索统计界面
<div
class=
"kf"
><span
class=
"ver_title"
>
框架开发:道长
</span><span
class=
"ver_title"
>
框架美化:蓝莓
</span></div>
</h2>
<p
class=
"tips"
>
统计内置源参与搜索相关数据
</p>
<center>
<div
class=
"zt"
>
<div
class=
"btn"
>
<a
href=
"javascript:;"
>
聚搜超时: {{val.timeout}} 秒
</a>
</div>
<div
class=
"btn"
>
<a
href=
"javascript:;"
>
搜索限制源数量: {{val.search_limit}}
</a>
</div>
<div
class=
"btn"
>
<a
href=
"javascript:;"
>
总可搜索源: {{val.total_search|length}}
</a>
</div>
<div
class=
"btn"
>
<a
href=
"javascript:;"
id=
"nosearch_sites"
>
不可搜索源: {{val.nosearch_sites|length}}
</a>
</div>
<div
class=
"btn"
>
<a
href=
"javascript:;"
id=
"search_sites"
>
当前搜索源: {{val.search_sites|length}}
</a>
</div>
</div>
</center>
</div>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录