mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-18 08:25:30 +01:00
Feat/startup config api (#518)
* feat: add api for config * feat: add data service to client * feat: update client pages with values from config endpoint * test: update tests * Update configurations and documentation to remove VITE_SHOW_GOOGLE_LOGIN_OPTION and change VITE_APP_TITLE to APP_TITLE * include APP_TITLE with startup config * Add test for new route * update backend-review pipeline * comment out test until we can figure out testing routes in CI * update: .env.example --------- Co-authored-by: fuegovic <32828263+fuegovic@users.noreply.github.com>
This commit is contained in:
parent
2da81db440
commit
3634d8691a
25 changed files with 419 additions and 75 deletions
|
|
@ -89,3 +89,7 @@ export const resetPassword = () => {
|
|||
export const plugins = () => {
|
||||
return '/api/plugins';
|
||||
};
|
||||
|
||||
export const config = () => {
|
||||
return '/api/config';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,3 +111,7 @@ export const getAvailablePlugins = (): Promise<t.TPlugin[]> => {
|
|||
export const updateUserPlugins = (payload: t.TUpdateUserPlugins) => {
|
||||
return request.post(endpoints.userPlugins(), payload);
|
||||
};
|
||||
|
||||
export const getStartupConfig = (): Promise<t.TStartupConfig> => {
|
||||
return request.get(endpoints.config());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ export enum QueryKeys {
|
|||
presets = 'presets',
|
||||
searchResults = 'searchResults',
|
||||
tokenCount = 'tokenCount',
|
||||
availablePlugins = 'availablePlugins'
|
||||
availablePlugins = 'availablePlugins',
|
||||
startupConfig = 'startupConfig',
|
||||
}
|
||||
|
||||
export const useAbortRequestWithMessage = (): UseMutationResult<
|
||||
|
|
@ -336,3 +337,11 @@ export const useUpdateUserPluginsMutation = (): UseMutationResult<
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetStartupConfig = (): QueryObserverResult<t.TStartupConfig> => {
|
||||
return useQuery<t.TStartupConfig>([QueryKeys.startupConfig], () => dataService.getStartupConfig(), {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,3 +233,10 @@ export type TResetPassword = {
|
|||
token: string;
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type TStartupConfig = {
|
||||
appTitle: boolean;
|
||||
googleLoginEnabled: boolean;
|
||||
serverDomain: string;
|
||||
registrationEnabled: boolean;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue