style: model source dropdown

main
jialin 1 year ago
parent 35a5733e82
commit 8f7968302d

@ -1,3 +1,4 @@
import { Col, Row } from 'antd';
import React from 'react';
import '../style/deploy-dropdown.less';
@ -14,12 +15,16 @@ interface DeployDropdownProps {
const DeployDropdown: React.FC<DeployDropdownProps> = ({ items, onSelect }) => {
return (
<div className="deploy-dropdown">
{items.map((item) => (
<div key={item.key} onClick={() => onSelect(item)} className="item">
<span className="icon">{item.icon}</span>
<span className="label">{item.label}</span>
</div>
))}
<Row gutter={[0, 16]}>
{items.map((item) => (
<Col span={8} key={item.key}>
<div key={item.key} onClick={() => onSelect(item)} className="item">
<span className="icon">{item.icon}</span>
<span className="label">{item.label}</span>
</div>
</Col>
))}
</Row>
</div>
);
};

@ -237,12 +237,6 @@ const Models: React.FC<ModelsProps> = ({
}, []);
const sourceOptions = [
{
label: intl.formatMessage({ id: 'menu.models.modelCatalog' }),
value: 'catalog',
key: 'catalog',
icon: <IconFont type="icon-catalog"></IconFont>
},
{
label: 'Hugging Face',
value: modelSourceMap.huggingface_value,
@ -261,6 +255,12 @@ const Models: React.FC<ModelsProps> = ({
key: 'modelscope',
icon: <IconFont type="icon-tu2"></IconFont>
},
{
label: intl.formatMessage({ id: 'menu.models.modelCatalog' }),
value: 'catalog',
key: 'catalog',
icon: <IconFont type="icon-catalog"></IconFont>
},
{
label: intl.formatMessage({ id: 'models.form.localPath' }),
value: modelSourceMap.local_path_value,

Loading…
Cancel
Save