diff --git a/spug_web/src/pages/deploy/app/Ext1Setup1.js b/spug_web/src/pages/deploy/app/Ext1Setup1.js
index 1405f38..3f8da29 100644
--- a/spug_web/src/pages/deploy/app/Ext1Setup1.js
+++ b/spug_web/src/pages/deploy/app/Ext1Setup1.js
@@ -62,7 +62,7 @@ export default observer(function Ext1Setup1() {
- info.host_ids = ids}/>
+ info.host_ids = ids}/>
setVisible(true)}>私有仓库?}>
info['git_repo'] = e.target.value}
diff --git a/spug_web/src/pages/deploy/app/Ext2Setup1.js b/spug_web/src/pages/deploy/app/Ext2Setup1.js
index 358089a..22485b6 100644
--- a/spug_web/src/pages/deploy/app/Ext2Setup1.js
+++ b/spug_web/src/pages/deploy/app/Ext2Setup1.js
@@ -60,7 +60,7 @@ export default observer(function Ext2Setup1() {
- info.host_ids = ids}/>
+ info.host_ids = ids}/>
- store.host_ids = ids}/>
+ store.host_ids = ids}/>
diff --git a/spug_web/src/pages/exec/template/Form.js b/spug_web/src/pages/exec/template/Form.js
index 7774044..c67c9b5 100644
--- a/spug_web/src/pages/exec/template/Form.js
+++ b/spug_web/src/pages/exec/template/Form.js
@@ -135,7 +135,7 @@ export default observer(function () {
- info.host_ids = ids}/>
+ info.host_ids = ids}/>
diff --git a/spug_web/src/pages/exec/transfer/index.js b/spug_web/src/pages/exec/transfer/index.js
index 9eb82ad..66663de 100644
--- a/spug_web/src/pages/exec/transfer/index.js
+++ b/spug_web/src/pages/exec/transfer/index.js
@@ -120,7 +120,7 @@ function TransferIndex() {
上传本地文件
- makeFile(row)}>
+ makeFile(row)}>
添加主机文件
)}>
@@ -144,7 +144,7 @@ function TransferIndex() {
setDir(e.target.value)} placeholder="请输入目标路径"/>
- x.id)} onChange={(_, __, rows) => setHosts(rows)}/>
+ x.id)} onChange={rows => setHosts(rows)}/>
diff --git a/spug_web/src/pages/host/Selector.js b/spug_web/src/pages/host/Selector.js
index da1c4c5..f2ab447 100644
--- a/spug_web/src/pages/host/Selector.js
+++ b/spug_web/src/pages/host/Selector.js
@@ -62,20 +62,17 @@ function HostSelector(props) {
}
function handleSubmit() {
- if (props.onChange) {
- setLoading(true);
- let res
- const selectedRows = store.rawRecords.filter(x => selectedRowKeys.includes(x.id))
- if (props.onlyOne) {
- res = props.onChange(store.group, selectedRowKeys[0], selectedRows[0])
- } else {
- res = props.onChange(store.group, selectedRowKeys, selectedRows);
- }
- if (res && res.then) {
- res.then(handleClose, () => setLoading(false))
- } else {
- handleClose()
- }
+ if (props.mode === 'ids') {
+ props.onChange(props.onlyOne ? selectedRowKeys[0] : selectedRowKeys)
+ handleClose()
+ } else if (props.mode === 'rows') {
+ const value = store.rawRecords.filter(x => selectedRowKeys.includes(x.id))
+ props.onChange(props.onlyOne ? value[0] : value)
+ handleClose()
+ } else if (props.mode === 'group') {
+ setLoading(true)
+ props.onChange(store.group, selectedRowKeys)
+ .then(handleClose, () => setLoading(false))
}
}
@@ -112,34 +109,39 @@ function HostSelector(props) {
setSelectedRowKeys([])
setLoading(false)
setVisible(false)
+ if (props.onCancel) {
+ props.onCancel()
+ }
}
return (
- {props.children ? (
-
setVisible(true)}>{props.children}
- ) : (
- props.type === 'button' ? (
- props.value.length > 0 ? (
-
已选择 {props.value.length} 台主机 }
- onClick={() => setVisible(true)}/>
- ) : (
-
- )) : (
-
- {props.value.length > 0 && 已选择 {props.value.length} 台}
-
-
+ {props.mode !== 'group' && (
+ props.children ? (
+ setVisible(true)}>{props.children}
+ ) : (
+ props.type === 'button' ? (
+ props.value.length > 0 ? (
+ 已选择 {props.value.length} 台主机}
+ onClick={() => setVisible(true)}/>
+ ) : (
+
+ )) : (
+
+ {props.value.length > 0 && 已选择 {props.value.length} 台}
+
+
+ )
)
)}
null
}
export default observer(HostSelector)
\ No newline at end of file
diff --git a/spug_web/src/pages/host/index.js b/spug_web/src/pages/host/index.js
index fc43907..abbe600 100644
--- a/spug_web/src/pages/host/index.js
+++ b/spug_web/src/pages/host/index.js
@@ -51,9 +51,10 @@ export default observer(function () {
{store.syncVisible && }
{store.selectorVisible &&
store.selectorVisible = false}
- onOk={store.updateGroup}
+ onChange={store.updateGroup}
/>}
);
diff --git a/spug_web/src/pages/monitor/Step1.js b/spug_web/src/pages/monitor/Step1.js
index 1dd1e19..007cb2b 100644
--- a/spug_web/src/pages/monitor/Step1.js
+++ b/spug_web/src/pages/monitor/Step1.js
@@ -130,7 +130,7 @@ export default observer(function () {
notFoundContent={null}/>
- store.record.targets = ids}/>
+ store.record.targets = ids}/>