diff --git a/src/components/dashboard/GiteaPanel.tsx b/src/components/dashboard/GiteaPanel.tsx index 0d88be9..d64070e 100644 --- a/src/components/dashboard/GiteaPanel.tsx +++ b/src/components/dashboard/GiteaPanel.tsx @@ -24,6 +24,7 @@ import { gitPush, type GiteaInstance, } from "../../lib/commands"; +import { confirm } from "@tauri-apps/plugin-dialog"; import { useUIStore } from "../../store/ui"; type BindMode = "create" | "migrate" | "link"; @@ -98,7 +99,7 @@ export function GiteaInstancesSection() { }; const handleDelete = async (inst: GiteaInstance) => { - if (!confirm(`删除实例「${inst.name}」?其下所有项目绑定会一并删除。`)) return; + if (!(await confirm(`删除实例「${inst.name}」?其下所有项目绑定会一并删除。`, { kind: "warning" }))) return; try { await giteaDeleteInstance(inst.id); qc.invalidateQueries({ queryKey: ["gitea-instances"] }); @@ -308,7 +309,7 @@ export function GiteaPanel({ projectId, projectName, projectPath }: Props) { }; const handleUnlink = async () => { - if (!confirm("解绑当前项目与 Gitea 仓库?(Gitea 侧仓库不会删除)")) return; + if (!(await confirm("解绑当前项目与 Gitea 仓库?(Gitea 侧仓库不会删除)", { kind: "warning" }))) return; try { await giteaUnlinkRepo(projectId); refresh(); diff --git a/src/components/dashboard/ProjectDevVariablesPanel.tsx b/src/components/dashboard/ProjectDevVariablesPanel.tsx index 0dacf0d..71898b5 100644 --- a/src/components/dashboard/ProjectDevVariablesPanel.tsx +++ b/src/components/dashboard/ProjectDevVariablesPanel.tsx @@ -6,6 +6,7 @@ import { saveProjectTestAccount, revokeProjectDevVariable, } from "../../lib/commands"; +import { confirm } from "@tauri-apps/plugin-dialog"; import { useUIStore } from "../../store/ui"; import { Dialog } from "../ui/Dialog"; @@ -142,8 +143,8 @@ export function ProjectDevVariablesPanel({ projectId, projectName, onClose }: Pr {item.configured && (