diff --git a/admin/dashboard/templates/plugin_schedules.html b/admin/dashboard/templates/plugin_schedules.html
index 8af30f4..1952250 100644
--- a/admin/dashboard/templates/plugin_schedules.html
+++ b/admin/dashboard/templates/plugin_schedules.html
@@ -27,8 +27,16 @@
{% raw %}{{ scope.row.enabled ? '是' : '否' }}{% endraw %}
-
-
+
+
+ {% raw %}{{ formatDateTime(scope.row.next_run_at) }}{% endraw %}
+
+
+
+
+ {% raw %}{{ formatDateTime(scope.row.last_run_at) }}{% endraw %}
+
+
{% raw %}{{ scope.row.last_status || 'never' }}{% endraw %}
@@ -129,7 +137,11 @@
-
+
+
+ {% raw %}{{ formatDateTime(scope.row.triggered_at) }}{% endraw %}
+
+
@@ -185,6 +197,26 @@ new Vue({
if (status === 'running') return 'warning'
return 'info'
},
+ formatDateTime(value) {
+ // 统一清洗时间展示:去掉 ISO 'T',并兼容字符串与日期对象。
+ if (!value) return ''
+ if (typeof value === 'string') {
+ return value.replace('T', ' ').slice(0, 19)
+ }
+ try {
+ const date = new Date(value)
+ if (Number.isNaN(date.getTime())) return String(value)
+ const yyyy = date.getFullYear()
+ const mm = String(date.getMonth() + 1).padStart(2, '0')
+ const dd = String(date.getDate()).padStart(2, '0')
+ const hh = String(date.getHours()).padStart(2, '0')
+ const mi = String(date.getMinutes()).padStart(2, '0')
+ const ss = String(date.getSeconds()).padStart(2, '0')
+ return `${yyyy}-${mm}-${dd} ${hh}:${mi}:${ss}`
+ } catch (e) {
+ return String(value)
+ }
+ },
async loadSchedules() {
this.loading = true
try {
diff --git a/utils/decorator/async_job.py b/utils/decorator/async_job.py
index 8bfdb56..eea4351 100644
--- a/utils/decorator/async_job.py
+++ b/utils/decorator/async_job.py
@@ -48,7 +48,22 @@ class AsyncJob:
@staticmethod
def _safe_iso(dt: Optional[datetime]) -> Optional[str]:
- return dt.isoformat(timespec="seconds") if dt else None
+ # 后台展示统一使用空格分隔时间,避免前端看到 ISO 格式中的 'T'。
+ return dt.strftime("%Y-%m-%d %H:%M:%S") if dt else None
+
+ @staticmethod
+ def _weekday_to_label(weekday: int) -> str:
+ """把 0-6(周一到周日)转换为中文星期标签。"""
+ mapping = {
+ 0: "周一",
+ 1: "周二",
+ 2: "周三",
+ 3: "周四",
+ 4: "周五",
+ 5: "周六",
+ 6: "周日",
+ }
+ return mapping.get(int(weekday), f"周{weekday}")
@staticmethod
def _normalize_time_str(time_str: str) -> str:
@@ -94,9 +109,11 @@ class AsyncJob:
if trigger_type == "at_times":
return "每天 " + ", ".join(trigger_config.get("time_list", []))
if trigger_type == "every_weekday_time":
- return f"每周{trigger_config['weekday']} {trigger_config['time_str']}"
+ # 触发文案显示中文星期,避免出现“周5显示成4”的数字歧义。
+ return f"每{self._weekday_to_label(trigger_config['weekday'])} {trigger_config['time_str']}"
if trigger_type == "every_week_time":
- return f"每周{trigger_config['weekday']} {trigger_config['time_str']}"
+ # 与 every_weekday_time 保持一致,统一中文星期展示。
+ return f"每{self._weekday_to_label(trigger_config['weekday'])} {trigger_config['time_str']}"
if trigger_type == "every_month_last_day_time":
return f"每月最后一天 {trigger_config['time_str']}"
return trigger_type