chore: display the direct command in add worker

This commit is contained in:
jialin
2024-12-23 16:33:08 +08:00
parent 4391705c9a
commit e7de1896ea
32 changed files with 359 additions and 125 deletions
@@ -153,6 +153,21 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
const collapseItems = useMemo(() => {
const children = (
<>
{/* <Form.Item<FormData> name="labels">
<ListInput
placeholder={
backendParamsHolderTips[backend]
? intl.formatMessage({
id: backendParamsHolderTips[backend].holder
})
: ''
}
btnText="models.form.button.addlabel"
label="Labels"
dataList={form.getFieldValue('backend_parameters') || []}
options={modelLabels}
></ListInput>
</Form.Item> */}
<Form.Item name="scheduleType">
<SealSelect
label={intl.formatMessage({ id: 'models.form.scheduletype' })}
+47 -31
View File
@@ -508,38 +508,54 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
min={0}
></SealInput.Number>
</Form.Item>
<Form.Item name="backend" id="backend-field">
<SealSelect
onChange={handleBackendChange}
label={intl.formatMessage({ id: 'models.form.backend' })}
options={[
{
label: `llama-box`,
value: backendOptionsMap.llamaBox,
disabled:
props.source === modelSourceMap.local_path_value
? false
: !isGGUF
},
{
label: 'vLLM',
value: backendOptionsMap.vllm,
disabled:
props.source === modelSourceMap.local_path_value
? false
: isGGUF
},
{
label: 'vox-box',
value: backendOptionsMap.voxBox,
disabled: props.source === modelSourceMap.ollama_library_value
<Form.Item name="backend">
<div id="backend-field">
<SealSelect
onChange={handleBackendChange}
label={intl.formatMessage({ id: 'models.form.backend' })}
description={
<div>
<div>
1.{' '}
{intl.formatMessage({ id: 'models.form.backend.llamabox' })}
</div>
<div>
2. {intl.formatMessage({ id: 'models.form.backend.vllm' })}
</div>
<div>
3. {intl.formatMessage({ id: 'models.form.backend.voxbox' })}
</div>
</div>
}
]}
disabled={
action === PageAction.EDIT &&
props.source !== modelSourceMap.local_path_value
}
></SealSelect>
options={[
{
label: `llama-box`,
value: backendOptionsMap.llamaBox,
disabled:
props.source === modelSourceMap.local_path_value
? false
: !isGGUF
},
{
label: 'vLLM',
value: backendOptionsMap.vllm,
disabled:
props.source === modelSourceMap.local_path_value
? false
: isGGUF
},
{
label: 'vox-box',
value: backendOptionsMap.voxBox,
disabled: props.source === modelSourceMap.ollama_library_value
}
]}
disabled={
action === PageAction.EDIT &&
props.source !== modelSourceMap.local_path_value
}
></SealSelect>
</div>
</Form.Item>
<Form.Item<FormData> name="description">
<SealInput.TextArea
@@ -1,6 +1,5 @@
import ModalFooter from '@/components/modal-footer';
import { PageActionType } from '@/config/types';
import useDriver from '@/hooks/use-driver';
import { CloseOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Drawer } from 'antd';
@@ -58,9 +57,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
modelSourceMap.huggingface_value,
modelSourceMap.modelscope_value
];
const { start } = useDriver({
steps
});
// const { start } = useDriver({
// steps,
// id: 'deploy-model'
// });
const form = useRef<any>({});
const intl = useIntl();
const [selectedModel, setSelectedModel] = useState<any>({});
@@ -128,7 +128,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
// useEffect(() => {
// if (open && loadfinish) {
// start();
// setTimeout(() => {
// start();
// }, 1000);
// }
// }, [loadfinish, open]);
@@ -8,8 +8,8 @@ import {
ListItem as WorkerListItem
} from '@/pages/resources/config/types';
import {
DeleteOutlined,
FieldTimeOutlined,
FileSyncOutlined,
InfoCircleOutlined
} from '@ant-design/icons';
import { useIntl } from '@umijs/max';
@@ -71,12 +71,12 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
icon: <FieldTimeOutlined />
},
{
label: 'common.button.recreate',
label: 'common.button.delrecreate',
key: 'delete',
props: {
danger: false
danger: true
},
icon: <FileSyncOutlined />
icon: <DeleteOutlined />
}
];
+13 -2
View File
@@ -1,4 +1,8 @@
import { BulbOutlined, InfoCircleOutlined } from '@ant-design/icons';
import {
BulbOutlined,
QuestionCircleOutlined,
WarningOutlined
} from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Checkbox, Select, Tooltip } from 'antd';
import _ from 'lodash';
@@ -233,6 +237,12 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
onChange={handleSearchInputChange}
modelSource={modelSource}
></SearchInput>
<div className="gguf-tips">
<WarningOutlined className="font-size-14 m-r-5 warning" />
<span>
{intl.formatMessage({ id: 'models.form.search.gguftips' })}
</span>
</div>
<div className={SearchStyle.filter}>
<span>
<span className="value">
@@ -268,7 +278,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
}
>
GGUF
<InfoCircleOutlined className="m-l-4" />
<QuestionCircleOutlined className="m-l-4" />
</Tooltip>
</Checkbox>
</span>
@@ -318,6 +328,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
</div>
)}
</div>
{
<SearchResult
loading={dataSource.loading}
@@ -87,7 +87,7 @@ const SearchResult: React.FC<SearchResultProps> = (props) => {
);
};
return (
<SimpleBar style={{ height: 'calc(100vh - 194px)' }}>
<SimpleBar style={{ height: 'calc(100vh - 224px)' }}>
<div style={{ ...props.style }} className="search-result-wrap">
<Spin spinning={props.loading}>
<div style={{ minHeight: 200 }}>
+1 -1
View File
@@ -449,7 +449,7 @@ const Models: React.FC<ModelsProps> = ({
const handleDeleteInstace = (row: any, list: ModelInstanceListItem[]) => {
modalRef.current.show({
content: 'models.instances',
okText: 'common.button.recreate',
okText: 'common.button.delrecreate',
name: row.name,
async onOk() {
await deleteModelInstance(row.id);