feat: generate select options for SystemModelSettingModal grouped by type and add llm icon and add upgrade button to UserSettingTeam and replace the icon in the sidebar of the user settings page (#128)

* feat: generate select options for SystemModelSettingModal grouped by type

* feat: add llm icon

* feat: add upgrade button to UserSettingTeam

* feat: replace the icon in the sidebar of the user settings page
This commit is contained in:
balibabu
2024-03-18 16:45:01 +08:00
committed by GitHub
parent a0f1e1fa95
commit 0e2aff2a48
22 changed files with 287 additions and 112 deletions

View File

@@ -5,13 +5,14 @@ import {
useFetchLlmList,
useSaveApiKey,
useSaveTenantInfo,
useSelectLlmOptionsByModelType,
} from '@/hooks/llmHooks';
import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
import {
useFetchTenantInfo,
useSelectTenantInfo,
} from '@/hooks/userSettingHook';
import { useCallback, useState } from 'react';
import { useCallback, useEffect, useState } from 'react';
type SavingParamsState = Omit<IApiKeySavingParams, 'api_key'>;
@@ -97,10 +98,18 @@ export const useSubmitSystemModelSetting = () => {
};
};
export const useFetchSystemModelSettingOnMount = () => {
export const useFetchSystemModelSettingOnMount = (visible: boolean) => {
const systemSetting = useSelectTenantInfo();
useFetchLlmList();
useFetchTenantInfo();
const allOptions = useSelectLlmOptionsByModelType();
const fetchLlmList = useFetchLlmList();
const fetchTenantInfo = useFetchTenantInfo();
return systemSetting;
useEffect(() => {
if (visible) {
fetchLlmList();
fetchTenantInfo();
}
}, [fetchLlmList, fetchTenantInfo, visible]);
return { systemSetting, allOptions };
};