feat: model file is lora

This commit is contained in:
jialin
2026-05-25 13:56:44 +08:00
committed by jialin
parent f0a1dad48e
commit d99c25dd03
7 changed files with 26 additions and 1 deletions
@@ -1,5 +1,6 @@
import { ModelFileFormData as FormData } from '@/pages/resources/config/types';
import {
CheckboxField,
Input as CInput,
Cascader as SealCascader,
Select as SealSelect,
@@ -240,6 +241,20 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
></CInput.Input>
</Form.Item>
)}
{source === modelSourceMap.local_path_value && (
<Form.Item<FormData>
name="is_lora"
key="is_lora"
valuePropName="checked"
noStyle
>
<CheckboxField
label={intl.formatMessage({
id: 'resources.modelfiles.form.isLora'
})}
></CheckboxField>
</Form.Item>
)}
</Form>
</div>
);
@@ -98,7 +98,7 @@ const getResolvedPath = (pathList: string[]) => {
const setActionList = (record: ListItem) => {
return _.filter(modelFileActions, (item: { key: string }) => {
if (item.key === 'deploy') {
return record.state === ModelfileStateMap.Ready;
return record.state === ModelfileStateMap.Ready && !record.is_lora;
}
return true;
});
@@ -244,6 +244,11 @@ const ResolvedPathColumn = (props: { record: ListItem }) => {
</span>
</AutoTooltip>
</TextWrapper>
{record.is_lora && (
<FilesTag color="purple" variant="outlined">
<span style={{ opacity: 1 }}>LoRA</span>
</FilesTag>
)}
<RenderParts record={record}></RenderParts>
</PathWrapper>
)