feat(web): streamline management and knowledge settings

This commit is contained in:
RockChinQ
2026-08-25 23:02:33 +08:00
parent db2a9155f8
commit 22d9053bf1
6 changed files with 203 additions and 107 deletions
@@ -132,7 +132,7 @@ function AgentFormComponent(
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
const [isSaving, setIsSaving] = useState(false);
const [activeSection, setActiveSection] =
useState<AgentConfigSection>('basic');
useState<AgentConfigSection>('events');
const isSavingRef = useRef(false);
const hasUnsavedChangesRef = useRef(false);
@@ -270,11 +270,6 @@ function AgentFormComponent(
label: string;
icon: React.ElementType;
}> = [
{
name: 'basic',
label: t('common.management'),
icon: Power,
},
{
name: 'events',
label: t('agents.bindableEvents'),
@@ -293,6 +288,11 @@ function AgentFormComponent(
icon: SlidersHorizontal,
},
];
const managementSection = {
name: 'basic' as const,
label: t('common.management'),
icon: Power,
};
const runnerStatus = useMemo<AgentRunnerStatus>(() => {
if (pluginStatusLoading) {
@@ -568,7 +568,7 @@ function AgentFormComponent(
}
>
<div className="overflow-x-auto">
<TabsList className="grid min-w-[44rem] w-full grid-cols-4">
<TabsList className="grid min-w-[34rem] w-full grid-cols-3">
{primarySections.map((section) => {
const Icon = section.icon;
return (
@@ -580,6 +580,21 @@ function AgentFormComponent(
})}
</TabsList>
</div>
<div className="flex justify-end pt-2">
<Button
type="button"
variant={
activeSection === managementSection.name
? 'secondary'
: 'ghost'
}
size="sm"
onClick={() => setActiveSection(managementSection.name)}
>
<Power />
{managementSection.label}
</Button>
</div>
</Tabs>
</nav>