From 42ac74ff1c01bfb03c8e53cf896c6a64cdfb8626 Mon Sep 17 00:00:00 2001 From: nice555 Date: Wed, 25 May 2022 20:18:42 +0800 Subject: [PATCH] 20220525 --- spug_web/src/pages/deploy/app/Form.js | 5 ++++- spug_web/src/pages/deploy/request/Ext1Form.js | 16 +++++++++++++--- spug_web/src/pages/deploy/request/Ext2Form.js | 16 +++++++++++++--- spug_web/src/pages/deploy/request/Table.js | 5 +++++ spug_web/src/pages/deploy/request/store.js | 4 ++-- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/spug_web/src/pages/deploy/app/Form.js b/spug_web/src/pages/deploy/app/Form.js index 1e9adde..795160d 100644 --- a/spug_web/src/pages/deploy/app/Form.js +++ b/spug_web/src/pages/deploy/app/Form.js @@ -45,10 +45,13 @@ export default observer(function () { extra="可以由字母、数字、-和下划线组成。"> + + + ) -}) \ No newline at end of file +}) diff --git a/spug_web/src/pages/deploy/request/Ext1Form.js b/spug_web/src/pages/deploy/request/Ext1Form.js index 52d7a84..c864fe8 100644 --- a/spug_web/src/pages/deploy/request/Ext1Form.js +++ b/spug_web/src/pages/deploy/request/Ext1Form.js @@ -5,7 +5,7 @@ */ import React, { useState, useEffect } from 'react'; import { observer } from 'mobx-react'; -import { Modal, Form, Input, Select, DatePicker, Button, message } from 'antd'; +import { Modal, Form, Input, Select, DatePicker, Button, message,Checkbox } from 'antd'; import { LoadingOutlined, SyncOutlined } from '@ant-design/icons'; import HostSelector from './HostSelector'; import hostStore from 'pages/host/store'; @@ -75,6 +75,7 @@ export default observer(function () { formData['type'] = store.record.type; formData['extra'] = [git_type, extra1, extra2]; if (plan) formData.plan = plan.format('YYYY-MM-DD HH:mm:00'); + formData['module'] = formData['module1'].join(','); http.post('/api/deploy/request/ext1/', formData) .then(res => { message.success('操作成功'); @@ -138,7 +139,11 @@ export default observer(function () { } } - const {app_host_ids, type, rb_id} = store.record; + const {app_host_ids, type, rb_id ,module} = store.record; + let module_list = []; + if (module) { + module_list = module.split(','); + } const {branches, tags} = versions; return ( )} + {module && ( + + + + )} {host_ids.length > 0 && ( 已选择 {host_ids.length} 台(可选{app_host_ids.length}) @@ -233,7 +243,7 @@ export default observer(function () { - + {type !== '2' && ( 0) formData['extra'] = lds.pick(fileList[0], ['path', 'name']); + formData['module'] = formData['module1'].join(','); http.post('/api/deploy/request/ext2/', formData) .then(res => { message.success('操作成功'); @@ -70,7 +71,11 @@ export default observer(function () { return false } - const {app_host_ids, deploy_id, type, require_upload} = store.record; + const { app_host_ids, deploy_id, type, require_upload, module } = store.record; + let module_list = []; + if (module) { + module_list = module.split(','); + } return ( + {module && ( + + + + )} {require_upload && ( @@ -128,4 +138,4 @@ export default observer(function () { onOk={ids => setHostIds(ids)}/>} ) -}) \ No newline at end of file +}) diff --git a/spug_web/src/pages/deploy/request/Table.js b/spug_web/src/pages/deploy/request/Table.js index 2e58b71..42cc97c 100644 --- a/spug_web/src/pages/deploy/request/Table.js +++ b/spug_web/src/pages/deploy/request/Table.js @@ -167,6 +167,11 @@ function ComTable() { return null } } + }, + { + title: '模块', + dataIndex: 'module', + hide: true }]; function DoAction(props) { diff --git a/spug_web/src/pages/deploy/request/store.js b/spug_web/src/pages/deploy/request/store.js index 254460e..d83063c 100644 --- a/spug_web/src/pages/deploy/request/store.js +++ b/spug_web/src/pages/deploy/request/store.js @@ -97,8 +97,8 @@ class Store { }; confirmAdd = (deploy) => { - const {id, host_ids, require_upload} = deploy; - this.record = {deploy_id: id, app_host_ids: host_ids, require_upload}; + const {id, host_ids, require_upload, module} = deploy; + this.record = {deploy_id: id, app_host_ids: host_ids, require_upload, module}; if (deploy.extend === '1') { this.ext1Visible = true } else {