feat: 公开定时任务页面、Word 导出、定时任务实时刷新与技能详情重构
- 新增 /public/scheduled-tasks/:taskId 公开只读访问页与对应的 /api/public/scheduled-tasks 后端路由(无需登录) - 新增对话整体 / 单条消息 / Markdown 工件 "另存为 Word (.docx)" 能力 - 定时任务列表与运行列表在任务执行中自动轮询刷新,并新增"正在执行"标记 - 定时任务运行消息接口在事件存储为空时回退到 LangGraph checkpoint, 让正在执行的任务也能立即看到提示词与流式输出 - 技能详情对话框由折叠面板改为 Tab 切换(Detail / SKILL.md), 并支持 Rendered / Raw 切换、一键复制 - config.yaml 增加 database (MySQL) 与 checkpointer (SQLite) 配置块 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7e75c5b9b9
commit
d339db4799
18 files changed
+1617
-125
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
Globe,
|
||||
Heart,
|
||||
HeartOff,
|
||||
Loader2,
|
||||
Lock,
|
||||
Pause,
|
||||
Play,
|
||||
@@ -304,6 +305,9 @@ export default function ScheduledTasksPage() {
|
||||
const isOwner = task.role !== "subscriber";
|
||||
const isSubscriber = task.role === "subscriber";
|
||||
const notifyOn = !!task._subscription?.notify_element;
|
||||
const isRunningNow =
|
||||
task.last_status === "running" ||
|
||||
task.last_status === "pending";
|
||||
return (
|
||||
<button
|
||||
key={task.task_id}
|
||||
@@ -323,6 +327,15 @@ export default function ScheduledTasksPage() {
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="truncate font-medium">{task.name}</div>
|
||||
{isRunningNow && (
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="border-primary/30 bg-primary/10 text-primary shrink-0 text-xs"
|
||||
>
|
||||
<Loader2 className="size-3 animate-spin" />
|
||||
正在执行
|
||||
</Badge>
|
||||
)}
|
||||
{isSubscriber && (
|
||||
<Badge variant="outline" className="shrink-0 text-xs">
|
||||
<Heart className="size-3" />收藏
|
||||
@@ -345,7 +358,12 @@ export default function ScheduledTasksPage() {
|
||||
<div className="text-muted-foreground mt-3 grid gap-1 text-xs">
|
||||
<div>下次执行:{formatDate(task.next_run_at)}</div>
|
||||
<div>上次执行:{formatDate(task.last_run_at)}</div>
|
||||
<div>最近状态:{statusLabel(task.last_status)}</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<span>最近状态:{statusLabel(task.last_status)}</span>
|
||||
{isRunningNow && (
|
||||
<Loader2 className="text-primary size-3 animate-spin" />
|
||||
)}
|
||||
</div>
|
||||
{(task.creator_email || task.creator_user_id) && (
|
||||
<div className="truncate">
|
||||
创建者:
|
||||
@@ -583,10 +601,16 @@ export default function ScheduledTasksPage() {
|
||||
请先选择一个定时任务。
|
||||
</div>
|
||||
)}
|
||||
{filteredRuns.map((run) => (
|
||||
{filteredRuns.map((run) => {
|
||||
const runRunning =
|
||||
run.status === "running" || run.status === "pending";
|
||||
return (
|
||||
<div
|
||||
key={run.id}
|
||||
className="rounded-md border p-4 transition-colors hover:bg-accent/40"
|
||||
className={cn(
|
||||
"rounded-md border p-4 transition-colors hover:bg-accent/40",
|
||||
runRunning && "border-primary/40 bg-primary/5",
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-wrap items-start justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
@@ -598,7 +622,11 @@ export default function ScheduledTasksPage() {
|
||||
{formatDate(run.started_at)}
|
||||
</div>
|
||||
</div>
|
||||
<Badge variant={statusVariant(run.status)}>
|
||||
<Badge
|
||||
variant={statusVariant(run.status)}
|
||||
className={cn(runRunning && "border-primary/30 bg-primary/10 text-primary")}
|
||||
>
|
||||
{runRunning && <Loader2 className="size-3 animate-spin" />}
|
||||
{statusLabel(run.status)}
|
||||
</Badge>
|
||||
</div>
|
||||
@@ -641,7 +669,8 @@ export default function ScheduledTasksPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</CardContent>
|
||||
|
||||
Reference in new issue
Block a user