U 从模板添加命令变更为在当前内容末尾追加

pull/191/head
vapao 2020-09-07 15:20:15 +08:00
parent 910e366fc6
commit 2c39b8db89
3 changed files with 5 additions and 5 deletions

View File

@ -56,7 +56,7 @@ class TaskIndex extends React.Component {
<Button icon="thunderbolt" type="primary" onClick={this.handleSubmit}>开始执行</Button> <Button icon="thunderbolt" type="primary" onClick={this.handleSubmit}>开始执行</Button>
</Form> </Form>
{store.showHost && <HostSelector onCancel={store.switchHost} onOk={hosts => store.hosts = hosts}/>} {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}/>} {store.showConsole && <ExecConsole token={token} onCancel={store.switchConsole}/>}
</AuthCard> </AuthCard>
) )

View File

@ -252,7 +252,7 @@ class ComForm extends React.Component {
</Form.Item> </Form.Item>
</Form> </Form>
{showTmp && <TemplateSelector {showTmp && <TemplateSelector
onOk={command => this.handleExtra('4', command)} onOk={v => this.handleExtra('4', extra['4'] + v)}
onCancel={() => this.setState({showTmp: false})}/>} onCancel={() => this.setState({showTmp: false})}/>}
</Modal> </Modal>
) )

View File

@ -149,7 +149,7 @@ class ComForm extends React.Component {
render() { render() {
const info = store.record; const info = store.record;
const {getFieldDecorator, getFieldValue} = this.props.form; 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(); const [b1, b2, b3] = this.verifyButtonStatus();
return ( return (
<Modal <Modal
@ -192,7 +192,7 @@ class ComForm extends React.Component {
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}> extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
<ACEditor <ACEditor
mode="sh" mode="sh"
value={this.state.command} value={command}
width="100%" width="100%"
height="150px" height="150px"
onChange={val => this.setState({command: val})}/> onChange={val => this.setState({command: val})}/>
@ -321,7 +321,7 @@ class ComForm extends React.Component {
</Form.Item> </Form.Item>
</Form> </Form>
{showTmp && <TemplateSelector {showTmp && <TemplateSelector
onOk={command => this.setState({command})} onOk={v => this.setState({command: command + v})}
onCancel={() => this.setState({showTmp: false})}/>} onCancel={() => this.setState({showTmp: false})}/>}
</Modal> </Modal>
) )