fix: backend selection

This commit is contained in:
jialin
2026-01-30 20:48:55 +08:00
committed by Lawrence Li
parent a2be7f6b36
commit 4000aacb2c
27 changed files with 317 additions and 142 deletions
+8 -2
View File
@@ -43,6 +43,12 @@ export const BackendSourceLabelMap: Record<string, string> = {
[BackendSourceValueMap.USER_DEFINED]: 'models.form.backend.custom'
};
export const TagColorMap: Record<string, string> = {
[BackendSourceValueMap.CUSTOM]: 'purple',
[BackendSourceValueMap.BUILTIN]: 'geekblue',
[BackendSourceValueMap.COMMUNITY]: 'cyan'
};
export const backendActions = [
{
label: 'common.button.edit',
@@ -63,7 +69,7 @@ export const backendActions = [
value: 'enable',
key: 'enable',
locale: true,
icon: icons.Yaml,
icon: icons.Charger,
show: (record: any) =>
!record.enabled &&
record.backend_source === BackendSourceValueMap.COMMUNITY
@@ -73,7 +79,7 @@ export const backendActions = [
value: 'disable',
key: 'disable',
locale: true,
icon: icons.Yaml,
icon: icons.Disabled,
show: (record: any) =>
record.enabled &&
record.backend_source === BackendSourceValueMap.COMMUNITY
+4
View File
@@ -7,6 +7,8 @@ export interface VersionConfigs {
entrypoint?: string;
version_no?: string;
is_built_in?: boolean;
backend_source?: string;
environment: Record<string, any>;
}
export interface VersionListItem extends VersionConfigs {
@@ -24,6 +26,8 @@ export interface FormData {
allowed_proxy_uris?: string[];
content?: string;
enabled?: boolean;
backend_source?: string;
default_environment?: Record<string, any>;
}
export interface ListItem extends FormData {