定时任务 后台任务
{#if loading}
加载中…
{:else if error}
{error}
{:else if tab === "background"} {#each tasks as task (task.id)}

{task.prompt.slice(0, 100)}

{task.session_id}{formatTime(task.created_at)}{task.tool_calls_count} 次工具调用 · {task.iterations} 轮
{#if task.result}

{task.result}

{/if}{#if task.error}

{task.error}

{/if}
{:else}
暂无后台任务
{/each} {:else} {#each jobs as job (job.id)}

{job.name}

{job.prompt}

{job.job_kind === "monitor" ? "巡检" : "任务"} · {job.delivery_policy}{job.channel} · {job.chat_id}下次 {formatTime(job.next_run_at)}上次 {formatTime(job.last_run_at)}
{#if runs[job.id]?.length}
{#each runs[job.id] as run}
{formatTime(run.finished_at)} · {run.duration_ms}ms{run.result_kind ? ` · ${run.result_kind}` : ""}{run.delivery_status ? ` · ${run.delivery_status}` : ""}
{/each}
{/if}
{:else}
暂无定时任务
{/each} {/if}