feat(componentDeployment): 添加组件部署页面及相关组件

master
钟良源 4 months ago
parent 6cfc87a42d
commit ad592ef134

@ -0,0 +1,228 @@
import React from 'react';
import { Collapse, Space, Tag, Button, Table, TableColumnProps } from '@arco-design/web-react';
import styles from './style/collapseList.module.less';
import { IconEye } from '@arco-design/web-react/icon';
const CollapseItem = Collapse.Item;
const headerNode = () => {
return (
<div className={styles['header-node']}>
<Space size={7} style={{ marginRight: 50 }}>
<img src="https://picsum.photos/200/300"
style={{ width: 50, height: 50, borderRadius: 6, overflow: 'hidden' }} />
<div></div>
</Space>
<Space size={10}>
<Tag>AI</Tag>
<Tag>X86_64</Tag>
<Tag color={'green'}></Tag>
<div className={styles['flex-box']}>
<img src={'/icons/countIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}>4</span>
</div>
</Space>
</div>
);
};
const extraNode = () => {
return (
<div className={styles['extra-node']}>
<Space size={20}>
<div className={styles['flex-box']}>
<img src={'/icons/compileIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/recompileIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/addIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/removedIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/moreIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
</Space>
</div>
);
};
const extraNode1 = () => {
return (
<div className={styles['extra-node']}>
<Space size={20}>
<div className={styles['flex-box']}>
<img src={'/icons/compiledIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#40BF6D' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/recompileIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/addIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/removedIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
<div className={styles['flex-box']}>
<img src={'/icons/moreIcon.png'} style={{ width: 16, height: 16, marginRight: 5 }} />
<span style={{ color: '#A2A2AB' }}></span>
</div>
</Space>
</div>
);
};
const columns: TableColumnProps[] = [
{
title: '#',
dataIndex: 'key',
align: 'center'
},
{
title: '组件标识',
dataIndex: 'name',
align: 'center'
},
{
title: '实例名称',
dataIndex: 'salary',
align: 'center'
},
{
title: '运行类型',
dataIndex: 'address',
align: 'center'
},
{
title: '运行状态',
dataIndex: 'email',
align: 'center'
},
{
title: '创建时间',
dataIndex: 'email',
align: 'center'
},
{
title: '操作',
dataIndex: '',
align: 'center',
render: (col, record, index) => (
<div className={styles['table-handle-box']}>
<Space size={20}>
<Button type="text"></Button>
<Button type="text"></Button>
<Button type="text"></Button>
<Button type="text"></Button>
<Button type="text"
icon={<img
src={'/icons/editIcon.png'}
style={{ width: 16, height: 16, marginRight: 5 }} />}
></Button>
<Button type="text"
icon={<img
src={'/icons/powerUpIcon.png'}
style={{ width: 16, height: 16, marginRight: 5 }} />}
></Button>
<Button type="text"
icon={<img
src={'/icons/deleteIcon.png'}
style={{ width: 16, height: 16, marginRight: 5 }} />}
></Button>
</Space>
</div>
)
}
];
const data = [
{
key: '1',
name: 'Jane Doe',
salary: 23000,
address: '32 Park Road, London',
email: 'jane.doe@example.com'
},
{
key: '2',
name: 'Alisa Ross',
salary: 25000,
address: '35 Park Road, London',
email: 'alisa.ross@example.com'
},
{
key: '3',
name: 'Kevin Sandra',
salary: 22000,
address: '31 Park Road, London',
email: 'kevin.sandra@example.com'
},
{
key: '4',
name: 'Ed Hellen',
salary: 17000,
address: '42 Park Road, London',
email: 'ed.hellen@example.com'
},
{
key: '5',
name: 'William Smith',
salary: 27000,
address: '62 Park Road, London',
email: 'william.smith@example.com'
}
];
const listNode = () => {
return (
<Table pagination={false} border={false} columns={columns} data={data} />
);
};
const CollapseList = () => {
return (
<div className={styles['collapse-list']}>
<Collapse
expandIconPosition={'right'}
bordered={false}
>
<CollapseItem
header={headerNode()}
name="1"
extra={extraNode()}
>
{listNode()}
</CollapseItem>
<CollapseItem
header={headerNode()}
name="2"
extra={extraNode1()}>
{listNode()}
</CollapseItem>
<CollapseItem
header={headerNode()}
name="3"
extra={extraNode()}>
{listNode()}
</CollapseItem>
</Collapse>
</div>
);
};
export default CollapseList;

@ -0,0 +1,48 @@
import React from 'react';
import styles from './style/index.module.less';
import { Button, Input, Radio, Space } from '@arco-design/web-react';
import { IconSearch } from '@arco-design/web-react/icon';
import CollapseList from './collapseList';
const ComponentDeployment = () => {
return (
<div className={styles['component-deployment']}>
<div className={styles['header']}>
<Radio.Group defaultValue={'Beijing'} name="button-radio-group">
{['全部', '启用中', '已下架'].map((item) => {
return (
<Radio key={item} value={item}>
{({ checked }) => {
return (
<Button tabIndex={-1} key={item} shape="round" type={checked ? 'primary' : 'default'}>
{item}
</Button>
);
}}
</Radio>
);
})}
</Radio.Group>
<Space>
<Input
prefix={<IconSearch />}
placeholder={'搜索'}
style={{ width: 236 }}
/>
<Button
type="primary"
style={{ marginLeft: 5, borderRadius: 4 }}
>
</Button>
</Space>
</div>
<div className="content">
<CollapseList></CollapseList>
</div>
</div>
);
};
export default ComponentDeployment;

@ -0,0 +1,25 @@
.collapse-list {
:global(.arco-collapse-item-content-box) {
padding: 0;
}
}
.header-node {
display: flex;
align-items: center;
}
.extra-node {
margin-right: 20px;
}
.flex-box {
display: flex;
align-items: center;
}
.table-handle-box {
:global(.arco-btn) {
padding: 0;
}
}

@ -0,0 +1,13 @@
.component-deployment {
height: 98%;
background-color: #ffffff;
padding: 17px 19px 0 24px;
.header {
display: flex;
justify-content: space-between;
padding-bottom: 15px;
border-bottom: 1px solid #ebebeb;
margin-bottom: 25px;
}
}

@ -17,6 +17,7 @@ import GlobalVarContainer from '@/pages/orchestration/globalVar';
import AppCompComponent from '@/pages/orchestration/appCompComponent'; import AppCompComponent from '@/pages/orchestration/appCompComponent';
import ComponentList from '@/pages/componentDevelopment/componentList'; import ComponentList from '@/pages/componentDevelopment/componentList';
import ComponentCoding from '@/pages/componentDevelopment/componentCoding'; import ComponentCoding from '@/pages/componentDevelopment/componentCoding';
import ComponentDeployment from '@/pages/componentDevelopment/componentDeployment';
type UrlParamsOptions = { type UrlParamsOptions = {
identity?: string; identity?: string;
@ -28,7 +29,6 @@ const AppInstanceComponent = () => <div style={{ height: '100%', width: '100%' }
const MyComponents = () => <div style={{ height: '100%', width: '100%' }}></div>; const MyComponents = () => <div style={{ height: '100%', width: '100%' }}></div>;
const MatchingComponents = () => <div style={{ height: '100%', width: '100%' }}></div>; const MatchingComponents = () => <div style={{ height: '100%', width: '100%' }}></div>;
const ComponentReview = () => <div style={{ height: '100%', width: '100%' }}></div>; const ComponentReview = () => <div style={{ height: '100%', width: '100%' }}></div>;
const ComponentDeployment = () => <div style={{ height: '100%', width: '100%' }}></div>;
const ComponentTest = () => <div style={{ height: '100%', width: '100%' }}></div>; const ComponentTest = () => <div style={{ height: '100%', width: '100%' }}></div>;
const EnvConfig = () => <div style={{ height: '100%', width: '100%' }}></div>; const EnvConfig = () => <div style={{ height: '100%', width: '100%' }}></div>;

Loading…
Cancel
Save