update
This commit is contained in:
14825
.windsurfrules
Normal file
14825
.windsurfrules
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,39 +1,38 @@
|
||||
import { useMemo } from "react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import clsx from "clsx";
|
||||
|
||||
export const statusOptions = {
|
||||
1: {
|
||||
text: "正常",
|
||||
color: "var(--color-primary)",
|
||||
color: "bg-primary/10 text-primary",
|
||||
},
|
||||
2: {
|
||||
text: "失效",
|
||||
color: "var(--color-gray-500)",
|
||||
color: "bg-gray-500/10 text-gray-500",
|
||||
},
|
||||
11: {
|
||||
text: "解析中",
|
||||
color: "var(--color-emerald-500)",
|
||||
color: "bg-emerald-500/10 text-emerald-500",
|
||||
},
|
||||
12: {
|
||||
text: "待审核",
|
||||
color: "var(--color-violet-500)",
|
||||
color: "bg-violet-500/10 text-violet-500",
|
||||
},
|
||||
13: {
|
||||
text: "传输中",
|
||||
color: "var(--color-amber-500)",
|
||||
color: "bg-amber-500/10 text-amber-500",
|
||||
},
|
||||
14: {
|
||||
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(
|
||||
() => statusOptions[Number(status) as keyof typeof statusOptions],
|
||||
[status]
|
||||
);
|
||||
return (
|
||||
<Badge style={{ backgroundColor: option?.color }}>{option?.text}</Badge>
|
||||
[status],
|
||||
);
|
||||
return <Badge className={clsx(option?.color)}>{option?.text}</Badge>;
|
||||
}
|
||||
|
||||
@@ -30,11 +30,7 @@ export default defineConfig({
|
||||
target: "http://192.168.1.28:8080/", // 公司
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
},
|
||||
"/anon": {
|
||||
target: "http://192.168.1.28:8080/", // 公司
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user