mirror of https://github.com/openspug/spug
A web update
parent
80f055fbcb
commit
b0b8a3f243
|
@ -2,13 +2,16 @@ import React from "react";
|
||||||
import Editor from 'react-ace';
|
import Editor from 'react-ace';
|
||||||
import 'ace-builds/src-noconflict/ext-language_tools';
|
import 'ace-builds/src-noconflict/ext-language_tools';
|
||||||
import 'ace-builds/src-noconflict/mode-sh';
|
import 'ace-builds/src-noconflict/mode-sh';
|
||||||
|
import 'ace-builds/src-noconflict/mode-json';
|
||||||
|
import 'ace-builds/src-noconflict/mode-text';
|
||||||
import 'ace-builds/src-noconflict/theme-tomorrow';
|
import 'ace-builds/src-noconflict/theme-tomorrow';
|
||||||
import 'ace-builds/src-noconflict/snippets/sh';
|
import 'ace-builds/src-noconflict/snippets/sh';
|
||||||
|
import 'ace-builds/src-noconflict/snippets/json';
|
||||||
|
import 'ace-builds/src-noconflict/snippets/text';
|
||||||
|
|
||||||
export default function (props) {
|
export default function (props) {
|
||||||
return (
|
return (
|
||||||
<Editor
|
<Editor
|
||||||
mode="sh"
|
|
||||||
theme="tomorrow"
|
theme="tomorrow"
|
||||||
enableLiveAutocompletion={true}
|
enableLiveAutocompletion={true}
|
||||||
enableBasicAutocompletion={true}
|
enableBasicAutocompletion={true}
|
|
@ -1,11 +1,11 @@
|
||||||
import StatisticsCard from './StatisticsCard';
|
import StatisticsCard from './StatisticsCard';
|
||||||
import SearchForm from './SearchForm';
|
import SearchForm from './SearchForm';
|
||||||
import LinkButton from './LinkButton';
|
import LinkButton from './LinkButton';
|
||||||
import SHEditor from './SHEditor';
|
import ACEditor from './ACEditor';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
StatisticsCard,
|
StatisticsCard,
|
||||||
SearchForm,
|
SearchForm,
|
||||||
LinkButton,
|
LinkButton,
|
||||||
SHEditor,
|
ACEditor,
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Card, Form, Button, Tag } from 'antd';
|
import { Card, Form, Button, Tag } from 'antd';
|
||||||
import { SHEditor } from 'components';
|
import { ACEditor } from 'components';
|
||||||
import HostSelector from './HostSelector';
|
import HostSelector from './HostSelector';
|
||||||
import TemplateSelector from './TemplateSelector';
|
import TemplateSelector from './TemplateSelector';
|
||||||
import ExecConsole from './ExecConsole';
|
import ExecConsole from './ExecConsole';
|
||||||
|
@ -38,7 +38,7 @@ class TaskIndex extends React.Component {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button icon="plus" onClick={store.switchHost}>从主机列表中选择</Button>
|
<Button icon="plus" onClick={store.switchHost}>从主机列表中选择</Button>
|
||||||
<Form.Item label="执行命令">
|
<Form.Item label="执行命令">
|
||||||
<SHEditor value={body} height="300px" onChange={body => this.setState({body})}/>
|
<ACEditor mode="sh" value={body} height="300px" onChange={body => this.setState({body})}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Button icon="plus" onClick={store.switchTemplate}>从执行模版中选择</Button>
|
<Button icon="plus" onClick={store.switchTemplate}>从执行模版中选择</Button>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Modal, Form, Input, Select, Col, Button, message } from 'antd';
|
import { Modal, Form, Input, Select, Col, Button, message } from 'antd';
|
||||||
import { SHEditor } from 'components';
|
import { ACEditor } from 'components';
|
||||||
import http from 'libs/http';
|
import http from 'libs/http';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@ class ComForm extends React.Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item {...itemLayout} required label="模板内容">
|
<Form.Item {...itemLayout} required label="模板内容">
|
||||||
<SHEditor
|
<ACEditor
|
||||||
|
mode="sh"
|
||||||
value={this.state.body}
|
value={this.state.body}
|
||||||
onChange={val => this.setState({body: val})}
|
onChange={val => this.setState({body: val})}
|
||||||
height="300px"/>
|
height="300px"/>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Modal, Form, Input, Select, Radio, message, Steps, Button, Transfer, Checkbox } from 'antd';
|
import { Modal, Form, Input, Select, Radio, message, Steps, Button, Transfer, Checkbox } from 'antd';
|
||||||
import TemplateSelector from '../exec/task/TemplateSelector';
|
import TemplateSelector from '../exec/task/TemplateSelector';
|
||||||
import { LinkButton, SHEditor } from 'components';
|
import { LinkButton, ACEditor } from 'components';
|
||||||
import http from 'libs/http';
|
import http from 'libs/http';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import hostStore from '../host/store';
|
import hostStore from '../host/store';
|
||||||
|
@ -163,7 +163,7 @@ class ComForm extends React.Component {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item {...this.itemLayout} required label="脚本内容" style={this.getStyle('4')}
|
<Form.Item {...this.itemLayout} required label="脚本内容" style={this.getStyle('4')}
|
||||||
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
|
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
|
||||||
<SHEditor value={extra['4']} height="200px" onChange={e => this.handleExtra('4', e)}/>
|
<ACEditor mode="sh" value={extra['4']} height="200px" onChange={e => this.handleExtra('4', e)}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item {...this.itemLayout} label="备注信息">
|
<Form.Item {...this.itemLayout} label="备注信息">
|
||||||
{getFieldDecorator('desc', {initialValue: info['desc']})(
|
{getFieldDecorator('desc', {initialValue: info['desc']})(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Modal, Form, Input, Select, Col, Button, Steps, Tabs, InputNumber, DatePicker, Icon, message } from 'antd';
|
import { Modal, Form, Input, Select, Col, Button, Steps, Tabs, InputNumber, DatePicker, Icon, message } from 'antd';
|
||||||
import { LinkButton, SHEditor } from 'components';
|
import { LinkButton, ACEditor } from 'components';
|
||||||
import TemplateSelector from '../exec/task/TemplateSelector';
|
import TemplateSelector from '../exec/task/TemplateSelector';
|
||||||
import http from 'libs/http';
|
import http from 'libs/http';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
|
@ -149,7 +149,8 @@ class ComForm extends React.Component {
|
||||||
required
|
required
|
||||||
label="任务内容"
|
label="任务内容"
|
||||||
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
|
extra={<LinkButton onClick={() => this.setState({showTmp: true})}>从模板添加</LinkButton>}>
|
||||||
<SHEditor
|
<ACEditor
|
||||||
|
mode="sh"
|
||||||
value={this.state.command}
|
value={this.state.command}
|
||||||
onChange={val => this.setState({command: val})}
|
onChange={val => this.setState({command: val})}
|
||||||
height="200px"/>
|
height="200px"/>
|
||||||
|
|
Loading…
Reference in New Issue