(job: CronJob)
| 224 | } |
| 225 | |
| 226 | function getTimeMeta(job: CronJob): { label: string; value: string; hint: string } { |
| 227 | if (job.nextRun) { |
| 228 | return { |
| 229 | label: job.recurrenceKind === "once" ? "Execution Time" : "Next Run", |
| 230 | value: formatPrimaryDate(job.nextRun), |
| 231 | hint: formatRelativeTime(job.nextRun), |
| 232 | }; |
| 233 | } |
| 234 | |
| 235 | if (job.recurrenceKind === "once" && job.lastRun) { |
| 236 | return { |
| 237 | label: "Executed", |
| 238 | value: formatPrimaryDate(job.lastRun), |
| 239 | hint: "This is a one-time job.", |
| 240 | }; |
| 241 | } |
| 242 | |
| 243 | return { |
| 244 | label: "Schedule Info", |
| 245 | value: "Not scheduled", |
| 246 | hint: "Please check the schedule configuration.", |
| 247 | }; |
| 248 | } |
| 249 | |
| 250 | function getStatusIcon(tone: Tone) { |
| 251 | return tone === "error" ? AlertTriangle : tone === "success" ? CheckCircle2 : Clock3; |
no test coverage detected