chore: pluggable locale config

This commit is contained in:
jialin
2025-10-13 14:40:26 +08:00
parent caabeb065a
commit b5fa40047a
30 changed files with 731 additions and 575 deletions
+13 -10
View File
@@ -10,7 +10,7 @@ import styled from 'styled-components';
import ColumnWrapper from '../../_components/column-wrapper';
import { defaultFormValues, deployFormKeyMap, modelSourceMap } from '../config';
import { backendOptionsMap } from '../config/backend-parameters';
import { BackendOption, FormData, SourceType } from '../config/types';
import { FormData, SourceType } from '../config/types';
import DataForm from '../forms';
import {
MessageStatus,
@@ -63,7 +63,6 @@ type AddModalProps = {
width?: string | number;
initialValues?: any;
deploymentType?: 'modelList' | 'modelFiles';
backendOptions: BackendOption[];
clusterList: Global.BaseOption<
number,
{ provider: string; state: string | number }
@@ -326,15 +325,17 @@ const AddModal: FC<AddModalProps> = (props) => {
return;
}
if (data.local_path || props.source !== modelSourceMap.local_path_value) {
// TODO confirm wheather it is gguf by model file not by backend
handleOnValuesChange?.({
changedValues: {},
allValues:
backend === backendOptionsMap.llamaBox
? data
: _.omit(data, [
'cpu_offloading',
'distributed_inference_across_workers'
]),
// allValues:
// backend === backendOptionsMap.llamaBox
// ? data
// : _.omit(data, [
// 'cpu_offloading',
// 'distributed_inference_across_workers'
// ]),
allValues: data,
source: props.source
});
}
@@ -413,6 +414,9 @@ const AddModal: FC<AddModalProps> = (props) => {
form.current?.getGPUOptionList?.({
clusterId: initClusterId()
});
form.current?.getBackendOptions?.({
cluster_id: initClusterId()
});
} else {
cancelEvaluate();
clearCahceFormValues();
@@ -542,7 +546,6 @@ const AddModal: FC<AddModalProps> = (props) => {
onOk={handleOnOk}
ref={form}
isGGUF={isGGUF}
backendOptions={props.backendOptions}
onBackendChange={handleBackendChange}
onValuesChange={onValuesChange}
></DataForm>