mirror of https://github.com/openspug/spug
improve
parent
13d9d0a589
commit
162680e64b
|
@ -94,9 +94,8 @@ export default observer(function () {
|
||||||
http.post('/api/repository/', formData)
|
http.post('/api/repository/', formData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
message.success('操作成功');
|
message.success('操作成功');
|
||||||
store.record = res;
|
|
||||||
store.formVisible = false;
|
store.formVisible = false;
|
||||||
store.fetchRecords()
|
store.showConsole(res)
|
||||||
}, () => setLoading(false))
|
}, () => setLoading(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,31 @@ function ComTable() {
|
||||||
.finally(() => setLoading(null))
|
.finally(() => setLoading(null))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function expandedRowRender(record) {
|
||||||
|
return (
|
||||||
|
<Table rowKey="id" dataSource={record.child} pagination={false}>
|
||||||
|
<Table.Column title="版本" render={info => (
|
||||||
|
<div style={{color: '#1890ff', cursor: 'pointer'}} onClick={() => store.showDetail(info)}>{info.version}</div>
|
||||||
|
)}/>
|
||||||
|
<Table.Column title="环境" dataIndex="env_name"/>
|
||||||
|
<Table.Column title="构建时间" dataIndex="created_at"/>
|
||||||
|
<Table.Column title="备注" dataIndex="remarks"/>
|
||||||
|
<Table.Column title="状态" render={info => <Tag color={statusColorMap[info.status]}>{info.status_alias}</Tag>}/>
|
||||||
|
{hasPermission('deploy.repository.detail|deploy.repository.build|deploy.repository.log') && (
|
||||||
|
<Table.Column width={180} title="操作" render={info => (
|
||||||
|
<Action>
|
||||||
|
<Action.Button
|
||||||
|
auth="deploy.repository.build"
|
||||||
|
loading={loading === info.id}
|
||||||
|
onClick={() => handleRebuild(info)}>构建</Action.Button>
|
||||||
|
<Action.Button auth="deploy.repository.build" onClick={() => store.showConsole(info)}>日志</Action.Button>
|
||||||
|
</Action>
|
||||||
|
)}/>
|
||||||
|
)}
|
||||||
|
</Table>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const statusColorMap = {'0': 'cyan', '1': 'blue', '2': 'red', '5': 'green'};
|
const statusColorMap = {'0': 'cyan', '1': 'blue', '2': 'red', '5': 'green'};
|
||||||
return (
|
return (
|
||||||
<TableCard
|
<TableCard
|
||||||
|
@ -50,6 +75,7 @@ function ComTable() {
|
||||||
icon={<PlusOutlined/>}
|
icon={<PlusOutlined/>}
|
||||||
onClick={store.showForm}>新建</AuthButton>
|
onClick={store.showForm}>新建</AuthButton>
|
||||||
]}
|
]}
|
||||||
|
expandable={{expandedRowRender, expandRowByClick: true}}
|
||||||
pagination={{
|
pagination={{
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
showLessItems: true,
|
showLessItems: true,
|
||||||
|
@ -58,25 +84,12 @@ function ComTable() {
|
||||||
pageSizeOptions: ['10', '20', '50', '100']
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
}}>
|
}}>
|
||||||
<Table.Column title="应用" dataIndex="app_name"/>
|
<Table.Column title="应用" dataIndex="app_name"/>
|
||||||
<Table.Column title="环境" dataIndex="env_name"/>
|
<Table.Column title="最新版本" render={info => `${info.version}(${info.env_name})`}/>
|
||||||
<Table.Column title="版本" dataIndex="version"/>
|
<Table.Column title="构建时间" dataIndex="created_at"/>
|
||||||
<Table.Column title="备注" dataIndex="remarks"/>
|
<Table.Column title="构建人" dataIndex="created_by_user"/>
|
||||||
<Table.Column hide title="构建时间" dataIndex="created_at"/>
|
|
||||||
<Table.Column hide title="构建人" dataIndex="created_by_user"/>
|
|
||||||
<Table.Column width={100} title="状态"
|
<Table.Column width={100} title="状态"
|
||||||
render={info => <Tag color={statusColorMap[info.status]}>{info.status_alias}</Tag>}/>
|
render={info => <Tag color={statusColorMap[info.status]}>{info.status_alias}</Tag>}/>
|
||||||
{hasPermission('deploy.repository.detail|deploy.repository.build|deploy.repository.log') && (
|
|
||||||
<Table.Column width={180} title="操作" render={info => (
|
|
||||||
<Action>
|
|
||||||
<Action.Button auth="deploy.repository.view" onClick={() => store.showDetail(info)}>详情</Action.Button>
|
|
||||||
<Action.Button
|
|
||||||
auth="deploy.repository.build"
|
|
||||||
loading={loading === info.id}
|
|
||||||
onClick={() => handleRebuild(info)}>构建</Action.Button>
|
|
||||||
<Action.Button auth="deploy.repository.build" onClick={() => store.showConsole(info)}>日志</Action.Button>
|
|
||||||
</Action>
|
|
||||||
)}/>
|
|
||||||
)}
|
|
||||||
</TableCard>
|
</TableCard>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
.out {
|
.out {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
padding: 8px 0 0 15px;
|
padding: 8px 0 8px 15px;
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
|
|
Loading…
Reference in New Issue