U 优化命令输入支持自动换行

pull/137/head
vapao 2020-06-20 14:29:20 +08:00
parent c97e294f52
commit 6f5419d07e
7 changed files with 22 additions and 9 deletions

View File

@ -13,6 +13,7 @@ import 'ace-builds/src-noconflict/snippets/sh';
export default function (props) {
return (
<Editor
wrapEnabled
theme="tomorrow"
enableLiveAutocompletion={true}
enableBasicAutocompletion={true}

View File

@ -16,7 +16,7 @@ export default observer(function Ext1From() {
return (
<Modal
visible
width={800}
width={900}
maskClosable={false}
title={store.deploy.id ? '编辑常规发布' : '新建常规发布'}
onCancel={() => store.ext1Visible = false}

View File

@ -81,6 +81,7 @@ class Ext1Setup3 extends React.Component {
className={full === '1' ? styles.fullScreen : null}
label={<this.FilterLabel type={info['filter_rule']['type']}/>}>
<Editor
wrapEnabled
mode="text"
theme="tomorrow"
width="100%"
@ -93,8 +94,9 @@ class Ext1Setup3 extends React.Component {
<Form.Item
colon={false}
className={full === '3' ? styles.fullScreen : null}
label={<this.NormalLabel title="代码出前执行" id="3"/>}>
label={<this.NormalLabel title="代码出前执行" id="3"/>}>
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"
@ -109,6 +111,7 @@ class Ext1Setup3 extends React.Component {
className={full === '5' ? styles.fullScreen : null}
label={<this.NormalLabel title="应用发布前执行" id="5"/>}>
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"
@ -139,6 +142,7 @@ class Ext1Setup3 extends React.Component {
className={full === '2' ? styles.fullScreen : null}
label={<this.NormalLabel title="自定义全局变量" id="2"/>}>
<Editor
wrapEnabled
mode="text"
theme="tomorrow"
width="100%"
@ -151,8 +155,9 @@ class Ext1Setup3 extends React.Component {
<Form.Item
colon={false}
className={full === '4' ? styles.fullScreen : null}
label={<this.NormalLabel title="代码出后执行" id="4"/>}>
label={<this.NormalLabel title="代码出后执行" id="4"/>}>
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"
@ -167,6 +172,7 @@ class Ext1Setup3 extends React.Component {
className={full === '6' ? styles.fullScreen : null}
label={<this.NormalLabel title="应用发布后执行" id="6"/>}>
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"

View File

@ -16,7 +16,7 @@ export default observer(function Ext2From() {
return (
<Modal
visible
width={800}
width={900}
maskClosable={false}
title={store.deploy.id ? '编辑自定义发布' : '新建自定义发布'}
onCancel={() => store.ext2Visible = false}

View File

@ -63,6 +63,7 @@ class Ext2Setup3 extends React.Component {
<Form.Item required label="执行内容">
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"
@ -90,6 +91,7 @@ class Ext2Setup3 extends React.Component {
<Form.Item required label="执行内容">
<Editor
wrapEnabled
mode="sh"
theme="tomorrow"
width="100%"

View File

@ -173,10 +173,13 @@ class ComForm extends React.Component {
required
label="脚本内容"
style={this.getStyle('4')}
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
<ACEditor mode="sh" value={extra['4']} height="200px"
onChange={e => this.handleExtra('4', cleanCommand(e))}/>
<ACEditor
mode="sh"
value={extra['4']}
width="100%"
height="200px"
onChange={e => this.handleExtra('4', cleanCommand(e))}/>
</Form.Item>
<Form.Item label="备注信息">
{getFieldDecorator('desc', {initialValue: info['desc']})(

View File

@ -193,8 +193,9 @@ class ComForm extends React.Component {
<ACEditor
mode="sh"
value={this.state.command}
onChange={val => this.setState({command: val})}
height="150px"/>
width="100%"
height="150px"
onChange={val => this.setState({command: val})}/>
</Form.Item>
<Form.Item label="失败通知" help="任务执行失败告警通知">
{getFieldDecorator('rst_notify.value', {initialValue: info['rst_notify']['value']})(