mirror of https://github.com/openspug/spug
U 从模板添加命令变更为在当前内容末尾追加
parent
910e366fc6
commit
2c39b8db89
|
@ -56,7 +56,7 @@ class TaskIndex extends React.Component {
|
|||
<Button icon="thunderbolt" type="primary" onClick={this.handleSubmit}>开始执行</Button>
|
||||
</Form>
|
||||
{store.showHost && <HostSelector onCancel={store.switchHost} onOk={hosts => store.hosts = hosts}/>}
|
||||
{store.showTemplate && <TemplateSelector onCancel={store.switchTemplate} onOk={body => this.setState({body})}/>}
|
||||
{store.showTemplate && <TemplateSelector onCancel={store.switchTemplate} onOk={v => this.setState({body: body + v})}/>}
|
||||
{store.showConsole && <ExecConsole token={token} onCancel={store.switchConsole}/>}
|
||||
</AuthCard>
|
||||
)
|
||||
|
|
|
@ -252,7 +252,7 @@ class ComForm extends React.Component {
|
|||
</Form.Item>
|
||||
</Form>
|
||||
{showTmp && <TemplateSelector
|
||||
onOk={command => this.handleExtra('4', command)}
|
||||
onOk={v => this.handleExtra('4', extra['4'] + v)}
|
||||
onCancel={() => this.setState({showTmp: false})}/>}
|
||||
</Modal>
|
||||
)
|
||||
|
|
|
@ -149,7 +149,7 @@ class ComForm extends React.Component {
|
|||
render() {
|
||||
const info = store.record;
|
||||
const {getFieldDecorator, getFieldValue} = this.props.form;
|
||||
const {page, args, loading, showTmp, nextRunTime} = this.state;
|
||||
const {page, args, command, loading, showTmp, nextRunTime} = this.state;
|
||||
const [b1, b2, b3] = this.verifyButtonStatus();
|
||||
return (
|
||||
<Modal
|
||||
|
@ -192,7 +192,7 @@ class ComForm extends React.Component {
|
|||
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
|
||||
<ACEditor
|
||||
mode="sh"
|
||||
value={this.state.command}
|
||||
value={command}
|
||||
width="100%"
|
||||
height="150px"
|
||||
onChange={val => this.setState({command: val})}/>
|
||||
|
@ -321,7 +321,7 @@ class ComForm extends React.Component {
|
|||
</Form.Item>
|
||||
</Form>
|
||||
{showTmp && <TemplateSelector
|
||||
onOk={command => this.setState({command})}
|
||||
onOk={v => this.setState({command: command + v})}
|
||||
onCancel={() => this.setState({showTmp: false})}/>}
|
||||
</Modal>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue