{questions.map((q, index) => (
-
+
-
+
{q.title}
-
diff --git a/frontend-web/src/pages/ScheduledTasksPage.tsx b/frontend-web/src/pages/ScheduledTasksPage.tsx
index fe545c21..d35c553a 100644
--- a/frontend-web/src/pages/ScheduledTasksPage.tsx
+++ b/frontend-web/src/pages/ScheduledTasksPage.tsx
@@ -2,8 +2,10 @@
import { useEffect, useMemo, useRef, useState } from "react";
import {
+ AlertCircle,
BellOff,
BellRing,
+ CheckCircle2,
Download,
Edit3,
Eye,
@@ -62,9 +64,32 @@ import {
statusLabel,
statusVariant,
} from "@/components/workspace/scheduled-tasks/schedule-builder";
+import { useTheme } from "@/contexts/ThemeContext";
import { desensitize } from "@/lib/desensitize";
import { cn } from "@/lib/utils";
+/** 成功 toast:仅暗色模式,浅色走 Sonner 默认 */
+const successToastDarkOptions = {
+ classNames: {
+ toast:
+ "!rounded-[2px] !border !border-[#106455] !bg-[#052934] !text-[#FFFFFF] shadow-md",
+ title: "!text-[#FFFFFF]",
+ description: "!text-[#FFFFFF]",
+ },
+ icon:
,
+} as const;
+
+/** 失败 toast:仅暗色模式,浅色走 Sonner 默认 */
+const errorToastDarkOptions = {
+ classNames: {
+ toast:
+ "!rounded-[2px] !border !border-[#7F1A2A] !bg-[#311629] !text-[#FFFFFF] shadow-md",
+ title: "!text-[#FFFFFF]",
+ description: "!text-[#FFFFFF]",
+ },
+ icon:
,
+} as const;
+
function formatDate(value?: string | null) {
return value ? new Date(value).toLocaleString() : "暂无";
}
@@ -88,6 +113,11 @@ const emptyForm = {
};
export default function ScheduledTasksPage() {
+ const { theme } = useTheme();
+ const darkToastOpts =
+ theme === "dark"
+ ? { success: successToastDarkOptions, error: errorToastDarkOptions }
+ : { success: undefined, error: undefined };
const navigate = useNavigate();
const [searchParams] = useSearchParams();
// When returning from a run-detail page the task id is carried in ?task=,
@@ -207,7 +237,7 @@ export default function ScheduledTasksPage() {
require_markdown: form.require_markdown,
});
setSelectedTaskId(task.task_id);
- toast.success("任务已创建");
+ toast.success("任务已创建", darkToastOpts.success);
} else if (editing) {
await actions.update.mutateAsync({
taskId: editing.task_id,
@@ -221,11 +251,14 @@ export default function ScheduledTasksPage() {
require_markdown: form.require_markdown,
},
});
- toast.success("任务已更新");
+ toast.success("任务已更新", darkToastOpts.success);
}
closeDialog();
} catch (error) {
- toast.error(error instanceof Error ? error.message : "保存失败");
+ toast.error(
+ error instanceof Error ? error.message : "保存失败",
+ darkToastOpts.error,
+ );
}
};
@@ -233,16 +266,22 @@ export default function ScheduledTasksPage() {
try {
await downloadScheduledTaskRun(runId);
} catch (error) {
- toast.error(error instanceof Error ? error.message : "下载失败");
+ toast.error(
+ error instanceof Error ? error.message : "下载失败",
+ darkToastOpts.error,
+ );
}
};
const handleDeleteRun = async (runId: string) => {
try {
await actions.removeRun.mutateAsync(runId);
- toast.success("执行记录已删除");
+ toast.success("执行记录已删除", darkToastOpts.success);
} catch (error) {
- toast.error(error instanceof Error ? error.message : "删除失败");
+ toast.error(
+ error instanceof Error ? error.message : "删除失败",
+ darkToastOpts.error,
+ );
}
};
@@ -273,14 +312,18 @@ export default function ScheduledTasksPage() {
/>
-
{time}
+
{time}
{children}
@@ -139,13 +139,13 @@ export const sharedMarkdownComponents = {
const isBlock = /language-/.test(className ?? "");
if (isBlock) {
return (
-
+
{children}
);
}
return (
-
+
{children}
);
@@ -161,7 +161,7 @@ export const sharedMarkdownComponents = {
),
table: ({ children }: { children?: React.ReactNode }) => (
-
+
),
th: ({ children }: { children?: React.ReactNode }) => (
@@ -254,7 +254,7 @@ export function ReasoningBlock({
|