fix: provider yaml inital value

This commit is contained in:
jialin
2026-02-12 12:20:05 +08:00
parent 978d327bcd
commit 9cb7145b4e
8 changed files with 12 additions and 11 deletions
@@ -14,8 +14,6 @@ const useFinishFailed = (options: FinishFailedOptions) => {
const handleOnFinishFailed = (errorInfo: any) => {
const { errorFields } = errorInfo;
console.log('Finish failed:', errorInfo);
if (errorFields && errorFields.length > 0) {
const collapseKeys: { sort: number; key: string }[] = [];
const names = errorFields.map((item: any) => item.name[0]);
@@ -40,7 +40,6 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
...builtInVersions,
...currentData.version_configs
};
const versionList: VersionListItem[] = Object.entries(versions).map(
([key, value]: [string, any]) => ({
version_no: key,
@@ -223,6 +223,7 @@ const useColumnSettings = (options: {
<AutoTooltip
ghost
minWidth={20}
maxWidth={'max-content'}
showTitle={text > 0}
title={<InfoColumn fieldList={fieldList} data={record}></InfoColumn>}
>
@@ -146,7 +146,7 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
}}
>
{data.activated_size
? `${data.size}${data.size_unit || 'B'}-A${data.activated_size}${data.size_unit || 'B'}`
? `${data.size}${data.size_unit || 'B'}-A${data.activated_size}B`
: `${data.size}${data.size_unit || 'B'}`}
</AutoTooltip>
</>
@@ -27,6 +27,7 @@ const AdvanceConfig: React.FC<{
setYamlValue: (values: any) => {
console.log('setYamlValue:', values);
editorRef.current?.setValue(values || '');
setFileContent(values || '');
}
}));
+5 -3
View File
@@ -138,15 +138,17 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
const apiTokensList = _.get(currentData, 'api_tokens', []).map(
(item: any) => item.hash || ''
);
const customConfigYaml = json2Yaml(
_.omit(currentData.config, ['type', 'openaiCustomUrl']) || {}
);
form.setFieldsValue({
...currentData,
api_key: apiTokensList?.[0] || '',
api_tokens: apiTokensList?.slice(1) || [],
proxy_enabled: !!currentData.proxy_url,
custom_config: json2Yaml(
_.omit(currentData.config, ['type', 'openaiCustomUrl']) || {}
)
custom_config: customConfigYaml
});
advanceRef.current?.setYamlValue?.(customConfigYaml);
}
}, [form, currentData, action]);
+3 -3
View File
@@ -38,18 +38,18 @@ const Basic = () => {
})}
rules={[
{
required: true,
required: false,
message: getRuleMessage('select', 'models.form.categories')
}
]}
>
<CategorySelect
required={true}
allowNull
options={[
...categoryOptions,
{
label: intl.formatMessage({ id: 'common.option.other' }),
value: 'other'
value: null
}
]}
label={intl.formatMessage({ id: 'models.form.categories' })}
+1 -1
View File
@@ -9,7 +9,7 @@ export const GPUDriverMap = {
ILUVATAR: 'corex',
CAMBRICON: 'neuware',
METAX: 'maca',
THEAD: 'ppu'
THEAD: 'hggc'
};
export const ManufacturerMap = {