This commit is contained in:
2026-02-06 13:27:28 +08:00
parent a1e4d6230c
commit ade1d2d2b7
3 changed files with 14836 additions and 16 deletions

14825
.windsurfrules Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,38 @@
import { useMemo } from "react"; import { useMemo } from "react";
import { Badge } from "@/components/ui/badge"; import { Badge } from "@/components/ui/badge";
import clsx from "clsx";
export const statusOptions = { export const statusOptions = {
1: { 1: {
text: "正常", text: "正常",
color: "var(--color-primary)", color: "bg-primary/10 text-primary",
}, },
2: { 2: {
text: "失效", text: "失效",
color: "var(--color-gray-500)", color: "bg-gray-500/10 text-gray-500",
}, },
11: { 11: {
text: "解析中", text: "解析中",
color: "var(--color-emerald-500)", color: "bg-emerald-500/10 text-emerald-500",
}, },
12: { 12: {
text: "待审核", text: "待审核",
color: "var(--color-violet-500)", color: "bg-violet-500/10 text-violet-500",
}, },
13: { 13: {
text: "传输中", text: "传输中",
color: "var(--color-amber-500)", color: "bg-amber-500/10 text-amber-500",
}, },
14: { 14: {
text: "失败", text: "失败",
color: "var(--color-red-500)", color: "bg-red-500/10 text-red-500",
}, },
}; };
export function FileStatusBadge({ status }: { status: number }) { export function FileStatusBadge({ status }: { status: number | string }) {
const option = useMemo( const option = useMemo(
() => statusOptions[Number(status) as keyof typeof statusOptions], () => statusOptions[Number(status) as keyof typeof statusOptions],
[status] [status],
);
return (
<Badge style={{ backgroundColor: option?.color }}>{option?.text}</Badge>
); );
return <Badge className={clsx(option?.color)}>{option?.text}</Badge>;
} }

View File

@@ -30,11 +30,7 @@ export default defineConfig({
target: "http://192.168.1.28:8080/", // 公司 target: "http://192.168.1.28:8080/", // 公司
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""), rewrite: (path) => path.replace(/^\/api/, ""),
}, }
"/anon": {
target: "http://192.168.1.28:8080/", // 公司
changeOrigin: true,
},
}, },
}, },
}); });