批量执行模板可取消已选择的主机

4.0
vapao 2023-03-13 17:44:25 +08:00
parent 29fe6e0742
commit 418d1f6ef7
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,7 @@ export default observer(function () {
<Button type="link" style={{padding: 0}} onClick={() => setParameter({})}>添加参数</Button>
</Form.Item>
<Form.Item label="目标主机">
<HostSelector value={info.host_ids} onChange={ids => info.host_ids = ids}/>
<HostSelector nullable value={info.host_ids} onChange={ids => info.host_ids = ids}/>
</Form.Item>
<Form.Item name="desc" label="备注信息">
<Input.TextArea placeholder="请输入模板备注信息"/>

View File

@ -167,7 +167,7 @@ function HostSelector(props) {
className={styles.modal}
title={props.title || '主机列表'}
onOk={handleSubmit}
okButtonProps={{disabled: selectedRowKeys.length === 0}}
okButtonProps={{disabled: selectedRowKeys.length === 0 && !props.nullable}}
confirmLoading={loading}
onCancel={handleClose}>
<Row>
@ -231,6 +231,7 @@ HostSelector.defaultProps = {
type: 'text',
mode: 'ids',
onlyOne: false,
nullable: false,
onChange: () => null
}