Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
M
macos-runtime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭阔
macos-runtime
Commits
384e2be8
Commit
384e2be8
authored
Oct 30, 2026
by
郭阔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(latest): 最近抓取分页,每页 10 场(页码导航+上下页)
parent
049dc070
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
app.py
web/app.py
+9
-1
latest.html
web/templates/latest.html
+35
-2
No files found.
web/app.py
View file @
384e2be8
...
@@ -1450,7 +1450,15 @@ def latest_content():
...
@@ -1450,7 +1450,15 @@ def latest_content():
get_business_result
(
run
[
"data"
])[
0
]),
get_business_result
(
run
[
"data"
])[
0
]),
})
})
cards
.
sort
(
key
=
lambda
c
:
c
[
"run_at"
],
reverse
=
True
)
cards
.
sort
(
key
=
lambda
c
:
c
[
"run_at"
],
reverse
=
True
)
return
render_template
(
"latest.html"
,
cards
=
cards
[:
80
])
total
=
len
(
cards
)
per_page
=
10
pages
=
max
(
1
,
(
total
+
per_page
-
1
)
//
per_page
)
try
:
page
=
max
(
1
,
min
(
pages
,
int
(
request
.
args
.
get
(
"page"
,
1
))))
except
ValueError
:
page
=
1
return
render_template
(
"latest.html"
,
cards
=
cards
[(
page
-
1
)
*
per_page
:
page
*
per_page
],
page
=
page
,
pages
=
pages
,
total
=
total
)
@
app
.
route
(
"/schedules"
)
@
app
.
route
(
"/schedules"
)
...
...
web/templates/latest.html
View file @
384e2be8
{% extends "base.html" %}
{% extends "base.html" %}
{% block title %}最近抓取 — News Harvester{% endblock %}
{% block title %}最近抓取 — News Harvester{% if pages > 1 %}
<div
style=
"display:flex;gap:6px;justify-content:center;align-items:center;margin:16px 0;flex-wrap:wrap"
>
{% if page > 1 %}
<a
class=
"btn btn-sm"
href=
"?page={{ page - 1 }}"
>
← 上一页
</a>
{% endif %}
{% for p in range(1, pages + 1) %}
{% if p == page %}
<span
class=
"btn btn-sm"
style=
"background:#2a3a5a;cursor:default"
>
{{ p }}
</span>
{% else %}
<a
class=
"btn btn-sm"
href=
"?page={{ p }}"
>
{{ p }}
</a>
{% endif %}
{% endfor %}
{% if page
<
pages
%}<
a
class=
"btn btn-sm"
href=
"?page={{ page + 1 }}"
>
下一页 →
</a>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% block extra_head %}
{% block extra_head %}
<style>
<style>
details
.lcard
{
background
:
#161923
;
border
:
1px
solid
#2a2d37
;
border-radius
:
6px
;
margin
:
10px
0
;
padding
:
0
;
}
details
.lcard
{
background
:
#161923
;
border
:
1px
solid
#2a2d37
;
border-radius
:
6px
;
margin
:
10px
0
;
padding
:
0
;
}
...
@@ -12,12 +23,23 @@
...
@@ -12,12 +23,23 @@
ul
.arts
li
{
padding
:
4px
0
;
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
flex-wrap
:
wrap
;
}
ul
.arts
li
{
padding
:
4px
0
;
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
flex-wrap
:
wrap
;
}
ul
.arts
li
.t
{
flex
:
1
1
auto
;
min-width
:
200px
;
}
ul
.arts
li
.t
{
flex
:
1
1
auto
;
min-width
:
200px
;
}
</style>
</style>
{% if pages > 1 %}
<div
style=
"display:flex;gap:6px;justify-content:center;align-items:center;margin:16px 0;flex-wrap:wrap"
>
{% if page > 1 %}
<a
class=
"btn btn-sm"
href=
"?page={{ page - 1 }}"
>
← 上一页
</a>
{% endif %}
{% for p in range(1, pages + 1) %}
{% if p == page %}
<span
class=
"btn btn-sm"
style=
"background:#2a3a5a;cursor:default"
>
{{ p }}
</span>
{% else %}
<a
class=
"btn btn-sm"
href=
"?page={{ p }}"
>
{{ p }}
</a>
{% endif %}
{% endfor %}
{% if page
<
pages
%}<
a
class=
"btn btn-sm"
href=
"?page={{ page + 1 }}"
>
下一页 →
</a>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% endblock %}
{% block content %}
{% block content %}
<h1>
最近抓取
</h1>
<h1>
最近抓取
</h1>
<p
style=
"color:#666;font-size:13px"
>
<p
style=
"color:#666;font-size:13px"
>
最近 24 小时内每次运行各一张卡片(
同源多场并列,如补跑+定时各一张),按运行时间倒序
;点击标题打开原文链接。
最近 24 小时内每次运行各一张卡片(
共 {{ total }} 场),按运行时间倒序,每页 10 场
;点击标题打开原文链接。
带已取尽标记=该源近期无新文章(正常),空列表=本次未交付(看上次运行详情排查)。
带已取尽标记=该源近期无新文章(正常),空列表=本次未交付(看上次运行详情排查)。
</p>
</p>
...
@@ -50,4 +72,15 @@
...
@@ -50,4 +72,15 @@
</details>
</details>
{% endfor %}
{% endfor %}
{% if pages > 1 %}
<div
style=
"display:flex;gap:6px;justify-content:center;align-items:center;margin:16px 0;flex-wrap:wrap"
>
{% if page > 1 %}
<a
class=
"btn btn-sm"
href=
"?page={{ page - 1 }}"
>
← 上一页
</a>
{% endif %}
{% for p in range(1, pages + 1) %}
{% if p == page %}
<span
class=
"btn btn-sm"
style=
"background:#2a3a5a;cursor:default"
>
{{ p }}
</span>
{% else %}
<a
class=
"btn btn-sm"
href=
"?page={{ p }}"
>
{{ p }}
</a>
{% endif %}
{% endfor %}
{% if page
<
pages
%}<
a
class=
"btn btn-sm"
href=
"?page={{ page + 1 }}"
>
下一页 →
</a>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment