From 1cc43bc0c0cf1da2cb6b39fca1253666a93dc56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E4=BA=8C=E7=8C=9B?= Date: Sat, 14 Dec 2019 15:35:31 +0800 Subject: [PATCH] A web update --- spug_web/src/pages/alarm/contact/Form.js | 16 +++---- spug_web/src/pages/alarm/group/Form.js | 12 ++---- spug_web/src/pages/config/environment/Form.js | 12 ++---- spug_web/src/pages/config/service/Form.js | 12 ++---- spug_web/src/pages/config/setting/Form.js | 14 +++---- spug_web/src/pages/exec/template/Form.js | 14 +++---- spug_web/src/pages/host/Form.js | 12 +++--- spug_web/src/pages/monitor/Form.js | 42 +++++++------------ spug_web/src/pages/schedule/Form.js | 27 ++++-------- spug_web/src/pages/system/account/Form.js | 12 ++---- 10 files changed, 63 insertions(+), 110 deletions(-) diff --git a/spug_web/src/pages/alarm/contact/Form.js b/spug_web/src/pages/alarm/contact/Form.js index 254818c..f08dbaa 100644 --- a/spug_web/src/pages/alarm/contact/Form.js +++ b/spug_web/src/pages/alarm/contact/Form.js @@ -28,10 +28,6 @@ class ComForm extends React.Component { render() { const info = store.record; const {getFieldDecorator} = this.props.form; - const itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> -
- + + {getFieldDecorator('name', {initialValue: info['name']})( )} - + {getFieldDecorator('phone', {initialValue: info['phone']})( )} - + {getFieldDecorator('email', {initialValue: info['email']})( )} - + {getFieldDecorator('wx_token', {initialValue: info['wx_token']})( )} - + {getFieldDecorator('ding', {initialValue: info['ding']})( )} diff --git a/spug_web/src/pages/alarm/group/Form.js b/spug_web/src/pages/alarm/group/Form.js index 57b75bd..85a7c9e 100644 --- a/spug_web/src/pages/alarm/group/Form.js +++ b/spug_web/src/pages/alarm/group/Form.js @@ -29,10 +29,6 @@ class ComForm extends React.Component { render() { const info = store.record; const {getFieldDecorator} = this.props.form; - const itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('name', {initialValue: info['name']})( )} - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} - + {getFieldDecorator('contacts', {valuePropName: 'targetKeys', initialValue: info['contacts']})( item.id} diff --git a/spug_web/src/pages/config/environment/Form.js b/spug_web/src/pages/config/environment/Form.js index 0aaae50..053104e 100644 --- a/spug_web/src/pages/config/environment/Form.js +++ b/spug_web/src/pages/config/environment/Form.js @@ -28,10 +28,6 @@ class ComForm extends React.Component { render() { const info = store.record; const {getFieldDecorator} = this.props.form; - const itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('name', {initialValue: info['name']})( )} - + {getFieldDecorator('key', {initialValue: info['key']})( )} - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} diff --git a/spug_web/src/pages/config/service/Form.js b/spug_web/src/pages/config/service/Form.js index d0455df..3ba6f47 100644 --- a/spug_web/src/pages/config/service/Form.js +++ b/spug_web/src/pages/config/service/Form.js @@ -28,10 +28,6 @@ class ComForm extends React.Component { render() { const info = store.record; const {getFieldDecorator} = this.props.form; - const itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('name', {initialValue: info['name']})( )} - + {getFieldDecorator('key', {initialValue: info['key']})( )} - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} diff --git a/spug_web/src/pages/config/setting/Form.js b/spug_web/src/pages/config/setting/Form.js index 43ed87b..3768745 100644 --- a/spug_web/src/pages/config/setting/Form.js +++ b/spug_web/src/pages/config/setting/Form.js @@ -53,10 +53,6 @@ class ComForm extends React.Component { const info = store.record; const {envs} = this.state; const {getFieldDecorator} = this.props.form; - const itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('key', {initialValue: info['key']})( )} - + {getFieldDecorator('value', {initialValue: info['value']})( )} - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} - + {envStore.records.map((item, index) => ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('type', {initialValue: info['type']})( )} - + this.setState({body: val})} height="300px"/> - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} diff --git a/spug_web/src/pages/host/Form.js b/spug_web/src/pages/host/Form.js index e5815c9..895db72 100644 --- a/spug_web/src/pages/host/Form.js +++ b/spug_web/src/pages/host/Form.js @@ -102,8 +102,8 @@ class ComForm extends React.Component { onCancel={() => store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}> - - + + {getFieldDecorator('zone', {initialValue: info['zone']})( )} - + {getFieldDecorator('username', {initialValue: info['username']})( @@ -139,12 +139,12 @@ class ComForm extends React.Component { )} - + {getFieldDecorator('desc', {initialValue: info['desc']})( )} - + ⚠️ 首次验证时需要输入登录用户名对应的密码,但不会存储该密码。 diff --git a/spug_web/src/pages/monitor/Form.js b/spug_web/src/pages/monitor/Form.js index 56deb1d..d242ec4 100644 --- a/spug_web/src/pages/monitor/Form.js +++ b/spug_web/src/pages/monitor/Form.js @@ -60,16 +60,6 @@ class ComForm extends React.Component { }, () => this.setState({loading: false})) }; - itemLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14} - }; - - itemTailLayout = { - labelCol: {span: 6}, - wrapperCol: {span: 14, offset: 6} - }; - getStyle = (t) => { const type = this.props.form.getFieldValue('type'); return t.indexOf(type) !== -1 ? {display: 'block'} : {display: 'none'} @@ -123,9 +113,9 @@ class ComForm extends React.Component { -
+
- + {getFieldDecorator('type', {initialValue: info['type'] || '1'})( )} - + {getFieldDecorator('name', {initialValue: info['name']})( )} - + this.handleAddr('1', e)}/> - + this.handleAddr('2', e)}/> - + this.handleExtra('2', e)}/> - + this.handleExtra('3', e)}/> - this.setState({showTmp: true})}>从模板添加}> this.handleExtra('4', e)}/> - + {getFieldDecorator('desc', {initialValue: info['desc']})( )}
- + {getFieldDecorator('rate', {initialValue: info['rate'] || 5})( 1分钟 @@ -183,7 +173,7 @@ class ComForm extends React.Component { )} - + {getFieldDecorator('threshold', {initialValue: info['threshold'] || 3})( 1次 @@ -194,7 +184,7 @@ class ComForm extends React.Component { )} - + {getFieldDecorator('notify_grp', {valuePropName: 'targetKeys', initialValue: info['notify_grp']})( item.name}/> )} - + {getFieldDecorator('notify_mode', {initialValue: info['notify_mode']})( )} - + {getFieldDecorator('quiet', {initialValue: info['quiet'] || 24 * 60})( @@ -139,13 +131,12 @@ class ComForm extends React.Component { - + {getFieldDecorator('name', {initialValue: info['name']})( )} this.setState({showTmp: true})}>从模板添加}> @@ -153,16 +144,16 @@ class ComForm extends React.Component { mode="sh" value={this.state.command} onChange={val => this.setState({command: val})} - height="200px"/> + height="150px"/> - + {getFieldDecorator('desc', {initialValue: info['desc']})( )}
- + {store.targets.map((id, index) => ( )} - + {getFieldDecorator('nickname', {initialValue: info['nickname']})( )} - + {getFieldDecorator('password', {initialValue: info.id ? '******' : undefined})( )}