diff --git a/spug_web/src/pages/deploy/app/Ext1Setup1.js b/spug_web/src/pages/deploy/app/Ext1Setup1.js
index a88f9f7..1405f38 100644
--- a/spug_web/src/pages/deploy/app/Ext1Setup1.js
+++ b/spug_web/src/pages/deploy/app/Ext1Setup1.js
@@ -9,7 +9,7 @@ import { Link } from 'react-router-dom';
import { Switch, Form, Input, Select, Button, Radio } from 'antd';
import Repo from './Repo';
import envStore from 'pages/config/environment/store';
-import Selector from 'pages/host/Selector';
+import HostSelector from 'pages/host/Selector';
import store from './store';
export default observer(function Ext1Setup1() {
@@ -62,8 +62,7 @@ export default observer(function Ext1Setup1() {
- {info.host_ids.length > 0 && 已选择 {info.host_ids.length} 台}
-
+ info.host_ids = ids}/>
setVisible(true)}>私有仓库?}>
info['git_repo'] = e.target.value}
@@ -116,11 +115,6 @@ export default observer(function Ext1Setup1() {
disabled={!(info.env_id && info.git_repo && info.host_ids.length)}
onClick={() => store.page += 1}>下一步
- store.selectorVisible = false}
- onOk={(_, ids) => info.host_ids = ids}/>
{visible && info['git_repo'] = v} onCancel={() => setVisible(false)}/>}
)
diff --git a/spug_web/src/pages/deploy/app/Ext2Setup1.js b/spug_web/src/pages/deploy/app/Ext2Setup1.js
index 90dda9e..358089a 100644
--- a/spug_web/src/pages/deploy/app/Ext2Setup1.js
+++ b/spug_web/src/pages/deploy/app/Ext2Setup1.js
@@ -8,12 +8,11 @@ import { observer } from 'mobx-react';
import { Link } from 'react-router-dom';
import { Form, Switch, Select, Button, Input, Radio } from 'antd';
import envStore from 'pages/config/environment/store';
-import Selector from 'pages/host/Selector';
+import HostSelector from 'pages/host/Selector';
import store from './store';
export default observer(function Ext2Setup1() {
const [envs, setEnvs] = useState([]);
- const [selectorVisible, setSelectorVisible] = useState(false);
function updateEnvs() {
const ids = store.currentRecord['deploys'].map(x => x.env_id);
@@ -61,8 +60,7 @@ export default observer(function Ext2Setup1() {
- {info.host_ids.length > 0 && 已选择 {info.host_ids.length} 台}
-
+ info.host_ids = ids}/>
store.page += 1}>下一步
- setSelectorVisible(false)}
- onOk={(_, ids) => info.host_ids = ids}/>
)
})
diff --git a/spug_web/src/pages/deploy/app/store.js b/spug_web/src/pages/deploy/app/store.js
index 80d7d37..8963f55 100644
--- a/spug_web/src/pages/deploy/app/store.js
+++ b/spug_web/src/pages/deploy/app/store.js
@@ -20,7 +20,6 @@ class Store {
@observable ext1Visible = false;
@observable ext2Visible = false;
@observable autoVisible = false;
- @observable selectorVisible = false;
@observable f_name;
@observable f_desc;
diff --git a/spug_web/src/pages/exec/task/index.js b/spug_web/src/pages/exec/task/index.js
index a91f9eb..94dc604 100644
--- a/spug_web/src/pages/exec/task/index.js
+++ b/spug_web/src/pages/exec/task/index.js
@@ -6,9 +6,9 @@
import React, { useState, useEffect } from 'react';
import { observer } from 'mobx-react';
import { PlusOutlined, ThunderboltOutlined, BulbOutlined, QuestionCircleOutlined } from '@ant-design/icons';
-import { Form, Button, Alert, Radio, Tooltip } from 'antd';
+import { Form, Button, Radio, Tooltip } from 'antd';
import { ACEditor, AuthDiv, Breadcrumb } from 'components';
-import Selector from 'pages/host/Selector';
+import HostSelector from 'pages/host/Selector';
import TemplateSelector from './TemplateSelector';
import Parameter from './Parameter';
import Output from './Output';
@@ -87,17 +87,7 @@ function TaskIndex() {
- {store.host_ids.length > 0 ? (
- 已选择 {store.host_ids.length} 台主机 }
- onClick={() => store.showHost = true}/>
- ) : (
-
- )}
+ store.host_ids = ids}/>
@@ -144,12 +134,6 @@ function TaskIndex() {
{store.showTemplate && }
{store.showConsole &&
- {info.host_ids.length > 0 && 已选择 {info.host_ids.length} 台}
-
+ info.host_ids = ids}/>
- setVisible(false)}
- onOk={(_, ids) => info.host_ids = ids}/>
{parameter ? (
setSProps({visible: false}),
- onOk: (_, __, row) => setFiles([{id: uniqueId(), type: 'host', name: row.name, path: '', host_id: row.id}]),
- })
- }
-
- function handleAddHost() {
- setSProps({
- visible: true,
- selectedRowKeys: hosts.map(x => x.id),
- onCancel: () => setSProps({visible: false}),
- onOk: (_, __, rows) => setHosts(rows),
- })
+ function makeFile(row) {
+ setFiles([{
+ id: uniqueId(),
+ type: 'host',
+ name: row.name,
+ path: '',
+ host_id: row.id
+ }])
}
function handleUpload(_, fileList) {
@@ -131,7 +120,9 @@ function TransferIndex() {
上传本地文件
- 添加主机文件
+ makeFile(row)}>
+ 添加主机文件
+
)}>
@@ -153,13 +144,7 @@ function TransferIndex() {
setDir(e.target.value)} placeholder="请输入目标路径"/>
- {hosts.length > 0 ? (已选择 {hosts.length} 台主机}
- onClick={handleAddHost}/>) : ()}
+ x.id)} onChange={(_, __, rows) => setHosts(rows)}/>
@@ -191,7 +176,6 @@ function TransferIndex() {
-
{token ?