perf: 优化流水线页面,增加下次执行时间、查看证书显示

This commit is contained in:
xiaojunnuo
2025-06-07 01:19:37 +08:00
parent 2a19b61b7a
commit c820315409
8 changed files with 146 additions and 72 deletions
@@ -0,0 +1,15 @@
import parser from "cron-parser";
import dayjs from "dayjs";
export function getCronNextTimes(cron: string, count: number = 1) {
if (cron == null) {
return [];
}
const nextTimes = [];
const interval = parser.parseExpression(cron);
for (let i = 0; i < count; i++) {
const next = interval.next().getTime();
nextTimes.push(dayjs(next).format("YYYY-MM-DD HH:mm:ss"));
}
return nextTimes;
}