fix: polish credential traffic cards and support copying over HTTP

This commit is contained in:
ji ruo committed 2026-10-20 13:12:51 +08:00
1 parent 851e3f99ed
commit 123b9dcd61
3 files changed
+130 -49

No files matched your search

+3 -6
View File
@@ -23,6 +23,7 @@ import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { api } from "@/lib/api";
import { statusMeta } from "@/lib/status";
import type { IntelligenceKind, IntelligencePage, TaskIntelligence } from "@/lib/types";
import { copyText } from "@/lib/utils";
const KINDS: { value: IntelligenceKind; label: string }[] = [
{ value: "credential", label: "凭据" },
@@ -397,12 +398,8 @@ export function IntelligencePanel({
size="sm"
variant="ghost"
onClick={async () => {
try {
await navigator.clipboard.writeText(selected.content);
toast.success("已复制");
} catch {
toast.error("复制失败,请手动选择内容复制");
}
if (await copyText(selected.content)) toast.success("已复制");
else toast.error("复制失败,请手动选择内容复制");
}}
>
<CopyIcon data-icon="inline-start" />