feat: 插件管理及域名和智能体对应

This commit is contained in:
Rocky Kwok committed 2026-06-29 14:31:40 +08:00
1 parent eb61b332a2
commit e9e4c181b9
9 files changed
+414 -27

No files matched your search

@@ -8,6 +8,7 @@ import {
loadCitationDisplaySettings,
loadLeaderboardSettings,
loadModelConcurrencySettings,
loadPluginManagementSettings,
loadPrivateSquareStatus,
loadPromptPrefixSettings,
loadPublishSquares,
@@ -17,6 +18,7 @@ import {
updateCitationDisplaySettings,
updateLeaderboardSettings,
updateModelConcurrencySettings,
updatePluginManagementSettings,
updatePrivateSquareSettings,
updatePromptPrefixSettings,
updatePublishSquares,
@@ -25,6 +27,7 @@ import {
type CitationDisplayUpdate,
type LeaderboardSettingsUpdate,
type ModelConcurrencyUpdate,
type PluginManagementUpdate,
type PrivateSquareUpdate,
type PromptPrefixUpdate,
type PublishSquaresUpdate,
@@ -41,6 +44,7 @@ const CITATION_DISPLAY_KEY = ["systemSettings", "citationDisplay"] as const;
const LEADERBOARD_KEY = ["systemSettings", "leaderboard"] as const;
const SKILL_COMPRESSION_KEY = ["systemSettings", "skillCompression"] as const;
const MODEL_CONCURRENCY_KEY = ["systemSettings", "modelConcurrency"] as const;
const PLUGIN_MANAGEMENT_KEY = ["systemSettings", "pluginManagement"] as const;
export function usePromptPrefixSettings() {
return useQuery({
@@ -263,6 +267,27 @@ export function useUpdateModelConcurrencySettings() {
});
}
export function usePluginManagementSettings() {
return useQuery({
queryKey: PLUGIN_MANAGEMENT_KEY,
queryFn: () => loadPluginManagementSettings(),
staleTime: 60_000,
refetchOnWindowFocus: false,
retry: false,
});
}
export function useUpdatePluginManagementSettings() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (body: PluginManagementUpdate) =>
updatePluginManagementSettings(body),
onSuccess: (data) => {
queryClient.setQueryData(PLUGIN_MANAGEMENT_KEY, data);
},
});
}
export function useLeaderboardSettings() {
return useQuery({
queryKey: LEADERBOARD_KEY,