chore: user mdoels
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Card from '@/components/templates/card';
|
||||
import React from 'react';
|
||||
|
||||
const ModelItem: React.FC<{ model: any; onDeploy: (model: any) => void }> = (
|
||||
props
|
||||
) => {
|
||||
const { model, onDeploy } = props;
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<div className="model-item" onClick={() => onDeploy(model)}>
|
||||
<h3>{model.name}</h3>
|
||||
<p>{model.description}</p>
|
||||
<span>Deploy</span>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default ModelItem;
|
||||
@@ -2,6 +2,7 @@ import { FilterBar } from '@/components/page-tools';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React from 'react';
|
||||
import ModelItem from './components/model-item';
|
||||
|
||||
const UserModels: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
@@ -12,6 +13,15 @@ const UserModels: React.FC = () => {
|
||||
|
||||
const handleInputChange = () => {};
|
||||
|
||||
const handleOnDeploy = (model: any) => {
|
||||
// Implement deploy functionality here
|
||||
console.log('Deploying model:', model);
|
||||
};
|
||||
|
||||
const renderCard = (data: any) => {
|
||||
return <ModelItem model={data} onDeploy={handleOnDeploy} />;
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
ghost
|
||||
@@ -36,6 +46,15 @@ const UserModels: React.FC = () => {
|
||||
handleSearch={handleSearch}
|
||||
width={{ input: 200 }}
|
||||
></FilterBar>
|
||||
{/* <CardList
|
||||
dataList={dataSource.dataList}
|
||||
loading={dataSource.loading}
|
||||
onDeploy={handleOnDeploy}
|
||||
activeId={-1}
|
||||
isFirst={isFirst}
|
||||
Skeleton={CatalogSkelton}
|
||||
renderItem={renderCard}
|
||||
></CardList> */}
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user