chore: backend api

This commit is contained in:
jialin
2026-01-30 20:48:55 +08:00
committed by Lawrence Li
parent af6f90c228
commit a2be7f6b36
22 changed files with 11829 additions and 9118 deletions
+36 -1
View File
@@ -29,6 +29,20 @@ export const builtInBackendLogos: Record<string, string> = {
[backendOptionsMap.voxBox]: VoxBoxLogo
};
export const BackendSourceValueMap = {
CUSTOM: 'custom',
BUILTIN: 'built-in',
COMMUNITY: 'community',
USER_DEFINED: 'user_defined'
};
export const BackendSourceLabelMap: Record<string, string> = {
[BackendSourceValueMap.CUSTOM]: 'backend.custom',
[BackendSourceValueMap.BUILTIN]: 'backend.builtin',
[BackendSourceValueMap.COMMUNITY]: 'backend.community',
[BackendSourceValueMap.USER_DEFINED]: 'models.form.backend.custom'
};
export const backendActions = [
{
label: 'common.button.edit',
@@ -44,13 +58,34 @@ export const backendActions = [
locale: true,
icon: icons.Yaml
},
{
label: 'common.button.enable',
value: 'enable',
key: 'enable',
locale: true,
icon: icons.Yaml,
show: (record: any) =>
!record.enabled &&
record.backend_source === BackendSourceValueMap.COMMUNITY
},
{
label: 'common.button.disable',
value: 'disable',
key: 'disable',
locale: true,
icon: icons.Yaml,
show: (record: any) =>
record.enabled &&
record.backend_source === BackendSourceValueMap.COMMUNITY
},
{
label: 'common.button.delete',
value: 'delete',
key: 'delete',
icon: icons.DeleteOutlined,
locale: true,
danger: true
danger: true,
show: (record: any) => !record.is_built_in
}
];
+4
View File
@@ -23,6 +23,7 @@ export interface FormData {
default_backend_param?: string[];
allowed_proxy_uris?: string[];
content?: string;
enabled?: boolean;
}
export interface ListItem extends FormData {
@@ -30,6 +31,9 @@ export interface ListItem extends FormData {
is_built_in?: boolean;
created_at?: string;
updated_at?: string;
backend_source: string;
icon: string;
recommend_models: string[];
built_in_version_configs?: Record<string, VersionConfigs>;
framework_index_map?: Record<string, string[]>;
}