fix: can not paste a text in env vars input box

This commit is contained in:
jialin
2025-03-19 20:09:43 +08:00
parent 2ceefab18c
commit b8f58b2cc1
4 changed files with 28 additions and 53 deletions
+6 -48
View File
@@ -7,64 +7,22 @@ import StatusTag from '@/components/status-tag';
import useTableFetch from '@/hooks/use-table-fetch';
import { modelSourceMap } from '@/pages/llmodels/config';
import {
generateSource,
modalConfig,
modelFileActions,
onLineSourceOptions
} from '@/pages/llmodels/config/button-actions';
import DownloadModal from '@/pages/llmodels/download';
import {
DeleteOutlined,
DownOutlined,
SyncOutlined,
ThunderboltOutlined
} from '@ant-design/icons';
import { DeleteOutlined, DownOutlined, SyncOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import React, {
Button,
ConfigProvider,
Empty,
Input,
Space,
Table
} from 'antd';
import { Button, ConfigProvider, Empty, Input, Space, Table } from 'antd';
import dayjs from 'dayjs';
import { useState } from 'react';
import { deleteWorker, queryWorkersList } from '../apis';
import { WorkerStatusMapValue, status } from '../config';
import { ModelFile as ListItem } from '../config/types';
const ActionList = [
{
label: 'common.button.deploy',
key: 'deploy',
icon: <ThunderboltOutlined />
},
{
label: 'common.button.delete',
key: 'delete',
props: {
danger: true
},
icon: <DeleteOutlined />
}
];
const generateSource = (record: ListItem) => {
if (record.source === modelSourceMap.modelscope_value) {
return `${modelSourceMap.modelScope}/${record.model_scope_model_id}`;
}
if (record.source === modelSourceMap.huggingface_value) {
return `${modelSourceMap.huggingface}/${record.huggingface_repo_id}`;
}
if (record.source === modelSourceMap.local_path_value) {
return `${record.local_path}`;
}
if (record.source === modelSourceMap.ollama_library_value) {
return `${modelSourceMap.ollama_library}/${record.ollama_library_model_name}`;
}
return '';
};
const ModelFiles: React.FC = () => {
const ModelFiles = () => {
const {
dataSource,
rowSelection,
@@ -208,7 +166,7 @@ const ModelFiles: React.FC = () => {
dataIndex: 'operation',
render: (text: string, record: ListItem) => (
<DropdownButtons
items={ActionList}
items={modelFileActions}
onSelect={(val) => handleSelect(val, record)}
></DropdownButtons>
)