refactor(dashboard): 优化配置页面布局和交互

- 移除 AlertDialog 中的 Info 图标和触发器
- 在卡片标题下添加配置保存提示文本
- 调整配置页面按钮和布局结构
- 简化页面组件和图标导入
This commit is contained in:
wood chen 2025-03-12 19:19:12 +08:00
parent 07e63eea5f
commit 2626f63770

View File

@ -25,7 +25,7 @@ import {
} from "@/components/ui/dialog"
import { Switch } from "@/components/ui/switch"
import { Slider } from "@/components/ui/slider"
import { Plus, Trash2, Edit, Save, Download, Upload, Info } from "lucide-react"
import { Plus, Trash2, Edit, Save, Download, Upload } from "lucide-react"
import {
AlertDialog,
AlertDialogAction,
@ -35,7 +35,6 @@ import {
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
interface PathMapping {
@ -572,38 +571,34 @@ export default function ConfigPage() {
return (
<div className="space-y-6">
<Card>
<CardHeader className="flex flex-row items-center justify-between">
<CardTitle>Proxy Go配置</CardTitle>
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="outline">
<Info className="w-4 h-4 mr-2" />
<CardHeader>
<div className="flex flex-row items-center justify-between">
<div>
<CardTitle>Proxy Go配置</CardTitle>
<p className="text-sm text-muted-foreground mt-1"></p>
</div>
<div className="flex space-x-2">
<Button onClick={exportConfig} variant="outline">
<Download className="w-4 h-4 mr-2" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent></AlertDialogContent>
</AlertDialog>
<div className="flex space-x-2">
<Button onClick={exportConfig} variant="outline">
<Download className="w-4 h-4 mr-2" />
</Button>
<label>
<Button variant="outline" className="cursor-pointer">
<Upload className="w-4 h-4 mr-2" />
<label>
<Button variant="outline" className="cursor-pointer">
<Upload className="w-4 h-4 mr-2" />
</Button>
<input
type="file"
className="hidden"
accept=".json"
onChange={importConfig}
/>
</label>
<Button onClick={handleSave} disabled={saving}>
<Save className="w-4 h-4 mr-2" />
{saving ? "保存中..." : "保存配置"}
</Button>
<input
type="file"
className="hidden"
accept=".json"
onChange={importConfig}
/>
</label>
<Button onClick={handleSave} disabled={saving}>
<Save className="w-4 h-4 mr-2" />
{saving ? "保存中..." : "保存配置"}
</Button>
</div>
</div>
</CardHeader>
<CardContent>