fix(scheduler_admin): 修复定时任务列表页码显示逻辑 (#2016)

* fix(scheduler_admin): 修复定时任务列表页码显示逻辑

- 在格式化定时任务列表图像时,添加对当前页码的可用性判断
- 如果页码不可用,则将当前页码默认设置为 1,避免显示错误的页码信息

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
molanp 2025-08-11 10:15:31 +08:00 committed by GitHub
parent 6d1789bbee
commit 2fed781350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,7 +76,9 @@ async def handle_view(
await schedule_cmd.finish("没有找到任何相关的定时任务。") await schedule_cmd.finish("没有找到任何相关的定时任务。")
img = await presenters.format_schedule_list_as_image( img = await presenters.format_schedule_list_as_image(
schedules=schedules, title=title, current_page=page.result schedules=schedules,
title=title,
current_page=page.result if page.available else 1,
) )
await MessageUtils.build_message(img).send(reply_to=True) await MessageUtils.build_message(img).send(reply_to=True)