diff --git a/web/src/pages/settings/index.tsx b/web/src/pages/settings/index.tsx index dba7ecc68..276c82a0f 100644 --- a/web/src/pages/settings/index.tsx +++ b/web/src/pages/settings/index.tsx @@ -1,5 +1,5 @@ import { App, Button, Form, Input, InputNumber, Popconfirm, Select, Tag, Tooltip } from "antd"; -import { ArrowLeft, Boxes, CircleCheck, Cloud, Info, Plus, RadioTower, RefreshCw, SlidersHorizontal, Trash2 } from "lucide-react"; +import { ArrowLeft, Boxes, ChevronDown, ChevronUp, CircleCheck, Cloud, Info, Plus, RadioTower, RefreshCw, SlidersHorizontal, Trash2 } from "lucide-react"; import { useEffect, useState, type ReactNode } from "react"; import { useNavigate, useSearchParams } from "react-router"; @@ -55,6 +55,7 @@ export default function SettingsPage() { const requestedSection = searchParams.get("section"); const [activeTab, setActiveTab] = useState(isConfigSection(requestedSection) ? requestedSection : "channels"); const [loadingChannelIds, setLoadingChannelIds] = useState([]); + const [collapsedChannelIds, setCollapsedChannelIds] = useState>(new Set()); const config = useConfigStore((state) => state.config); const updateConfig = useConfigStore((state) => state.updateConfig); const replaceConfig = useConfigStore((state) => state.replaceConfig); @@ -146,6 +147,15 @@ export default function SettingsPage() { setLoadingChannelIds((items) => (loading ? Array.from(new Set([...items, id])) : items.filter((item) => item !== id))); }; + const toggleChannelCollapsed = (id: string) => { + setCollapsedChannelIds((current) => { + const next = new Set(current); + if (next.has(id)) next.delete(id); + else next.add(id); + return next; + }); + }; + const refreshChannelModels = async (channel: ModelChannel) => { const connectionError = channelConnectionError(channel); if (connectionError) { @@ -327,6 +337,17 @@ export default function SettingsPage() { > 拉取模型 + +