init commit of setting pages
This commit is contained in:
parent
b687ad5eb0
commit
0425819028
|
@ -160,28 +160,31 @@ export default [
|
|||
path: '/settings',
|
||||
name: 'settings',
|
||||
icon: 'setting',
|
||||
component: './List/TableList',
|
||||
// component: './List/TableList',
|
||||
routes: [
|
||||
{
|
||||
path: '/list/table-list',
|
||||
name: 'authentication',
|
||||
component: './List/TableList',
|
||||
path: '/settings/global',
|
||||
name: 'global',
|
||||
component: './Settings/Global/Global',
|
||||
}, {
|
||||
path: '/list/table-list',
|
||||
name: 'authorization',
|
||||
component: './List/TableList',
|
||||
path: '/settings/security',
|
||||
name: 'security',
|
||||
hideChildrenInMenu: true,
|
||||
routes: [
|
||||
{
|
||||
path: '/settings/security',
|
||||
name: 'security',
|
||||
component: './Settings/Security/General',
|
||||
}, {
|
||||
path: '/settings/security/general',
|
||||
name: 'general',
|
||||
component: './Forms/BasicForm',
|
||||
},
|
||||
]
|
||||
}, {
|
||||
path: '/list/table-list',
|
||||
path: '/settings/audit',
|
||||
name: 'audit',
|
||||
component: './List/TableList',
|
||||
}, {
|
||||
path: '/list/table-list',
|
||||
name: 'certs',
|
||||
component: './List/TableList',
|
||||
}, {
|
||||
path: '/list/table-list',
|
||||
name: 'others',
|
||||
component: './List/TableList',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
|
|
@ -96,11 +96,9 @@ export default {
|
|||
'menu.search.nlp': 'NLP',
|
||||
|
||||
'menu.settings': 'SETTINGS',
|
||||
'menu.settings.authentication': 'AUTHENTICATION',
|
||||
'menu.settings.authorization': 'AUTHORIZATION',
|
||||
'menu.settings.global': 'GLOBAL',
|
||||
'menu.settings.security': 'SECURITY',
|
||||
'menu.settings.audit': 'AUDIT',
|
||||
'menu.settings.certs': 'CERTS',
|
||||
'menu.settings.others': 'OTHERS',
|
||||
|
||||
|
||||
'menu.form': 'Form',
|
||||
|
@ -207,6 +205,10 @@ export default {
|
|||
|
||||
'app.setting.appname':"Search Center",
|
||||
|
||||
|
||||
'app.settings.security.update':"Update Setting",
|
||||
'app.settings.global.update':"Update Setting",
|
||||
|
||||
'app.settings.menuMap.basic': 'Basic Settings',
|
||||
'app.settings.menuMap.security': 'Security Settings',
|
||||
'app.settings.menuMap.binding': 'Account Binding',
|
||||
|
|
|
@ -104,12 +104,11 @@ export default {
|
|||
'menu.search.nlp': '自然语言处理',
|
||||
|
||||
'menu.settings': '系统设置',
|
||||
'menu.settings.authentication': '认证管理',
|
||||
'menu.settings.global': '全局设置',
|
||||
'menu.settings.security': '安全设置',
|
||||
'menu.settings.authorization': '授权管理',
|
||||
'menu.settings.audit': '审计日志',
|
||||
'menu.settings.certs': '证书管理',
|
||||
'menu.settings.others': '其它设置',
|
||||
|
||||
|
||||
|
||||
'menu.form': '表单页',
|
||||
'menu.form.basicform': '基础表单',
|
||||
|
@ -214,7 +213,9 @@ export default {
|
|||
'app.monitor.fund-surplus': '补贴资金剩余',
|
||||
|
||||
'app.setting.appname':"极限搜索中心",
|
||||
|
||||
|
||||
'app.settings.security.update':"更新设置",
|
||||
'app.settings.global.update':"更新设置",
|
||||
|
||||
'app.settings.menuMap.basic': '基本设置',
|
||||
'app.settings.menuMap.security': '安全设置',
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
import React, {Component, Fragment} from 'react';
|
||||
import {connect} from 'dva';
|
||||
import {Card, Form, Input, Select, Button, message, Divider, Drawer, Descriptions} from 'antd';
|
||||
|
||||
const {Option} = Select;
|
||||
import {formatMessage, FormattedMessage} from 'umi/locale';
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
import {Row, Col} from 'antd';
|
||||
|
||||
const operationTabList = [
|
||||
{
|
||||
key: 'tab1',
|
||||
tab: '全局设置',
|
||||
},
|
||||
];
|
||||
|
||||
@Form.create()
|
||||
class Global extends Component {
|
||||
state = {
|
||||
operationkey: 'tab1',
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
}
|
||||
|
||||
onOperationTabChange = key => {
|
||||
this.setState({operationkey: key});
|
||||
};
|
||||
|
||||
globalSettings = () => {
|
||||
const {
|
||||
form: {getFieldDecorator},
|
||||
} = this.props;
|
||||
return (
|
||||
< div >
|
||||
< Row
|
||||
type = "flex"
|
||||
justify = "end" >
|
||||
< Col
|
||||
span = {16} >
|
||||
< div > < Form
|
||||
layout = "vertical"
|
||||
hideRequiredMark >
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.global.cluster_name'})} >
|
||||
{getFieldDecorator('address',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.address-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >)
|
||||
}
|
||||
</FormItem>
|
||||
< Button type = "primary" >
|
||||
< FormattedMessage
|
||||
id = "app.settings.global.update"
|
||||
defaultMessage = "Update Setting" /> </Button>
|
||||
< /Form> </div>
|
||||
< /Col>
|
||||
< Col span = {8} >< /Col>
|
||||
< /Row>
|
||||
< /div>
|
||||
)
|
||||
;
|
||||
};
|
||||
|
||||
render() {
|
||||
const {operationkey} = this.state;
|
||||
const contentList = {
|
||||
tab1: ( < div > {this.globalSettings()} < /div>),
|
||||
}
|
||||
;
|
||||
return (
|
||||
< Fragment >
|
||||
< Card
|
||||
bordered = {false}
|
||||
tabList = {operationTabList}
|
||||
onTabChange = {this.onOperationTabChange}
|
||||
>
|
||||
{contentList[operationkey]}
|
||||
< /Card>
|
||||
< /Fragment>
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
export default Global;
|
|
@ -0,0 +1,258 @@
|
|||
import React, {Component, Fragment} from 'react';
|
||||
import {connect} from 'dva';
|
||||
import {Card, Form, Input, Select, Button, message, Divider, Drawer, Descriptions} from 'antd';
|
||||
|
||||
const {Option} = Select;
|
||||
import {formatMessage, FormattedMessage} from 'umi/locale';
|
||||
import styles from './General.less';
|
||||
import PhoneView from "../../Account/Settings/PhoneView";
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
import {Row, Col} from 'antd';
|
||||
|
||||
const operationTabList = [
|
||||
{
|
||||
key: 'tab1',
|
||||
tab: '基本设置',
|
||||
},
|
||||
{
|
||||
key: 'tab2',
|
||||
tab: 'SSO 集成',
|
||||
},
|
||||
{
|
||||
key: 'tab3',
|
||||
tab: '角色管理',
|
||||
},
|
||||
{
|
||||
key: 'tab4',
|
||||
tab: '用户管理',
|
||||
},
|
||||
{
|
||||
key: 'tab5',
|
||||
tab: '证书管理',
|
||||
}
|
||||
];
|
||||
|
||||
// @connect(({logstash,loading }) => ({
|
||||
// data: logstash.logstash,
|
||||
// loading: loading.models.logstash,
|
||||
// submitting: loading.effects['logstash/submitLogstashConfig'],
|
||||
// }))
|
||||
|
||||
@Form.create()
|
||||
class General extends Component {
|
||||
state = {
|
||||
operationkey: 'tab1',
|
||||
snapshotVisible: false,
|
||||
repVisible: false,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
// message.loading('数据加载中..', 'initdata');
|
||||
// const { dispatch } = this.props;
|
||||
// dispatch({
|
||||
// type: 'logstash/queryInitialLogstashConfig',
|
||||
// });
|
||||
}
|
||||
|
||||
onOperationTabChange = key => {
|
||||
this.setState({operationkey: key});
|
||||
};
|
||||
|
||||
generalSettings = () => {
|
||||
const {
|
||||
form: {getFieldDecorator},
|
||||
} = this.props;
|
||||
return (
|
||||
< div >
|
||||
< Row
|
||||
type = "flex"
|
||||
justify = "end" >
|
||||
< Col
|
||||
span = {16} >
|
||||
< div > < Form
|
||||
layout = "vertical"
|
||||
hideRequiredMark >
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.security.auth2factor_enabled'})} >
|
||||
{getFieldDecorator('profile',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.profile-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input /> )
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.email'})} >
|
||||
{getFieldDecorator('email',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.email-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.nickname'})} >
|
||||
{getFieldDecorator('name',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.nickname-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.profile'})} >
|
||||
{getFieldDecorator('profile',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.profile-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(
|
||||
< Input.TextArea
|
||||
placeholder = {formatMessage({id: 'app.settings.basic.profile-placeholder'})}
|
||||
rows = {4}
|
||||
/>
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.country'})} >
|
||||
{getFieldDecorator('country',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.country-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(
|
||||
< Select
|
||||
style = {
|
||||
{
|
||||
maxWidth: 220
|
||||
}
|
||||
}>
|
||||
<
|
||||
Option
|
||||
value = "China" > 中国 < /Option>
|
||||
< /Select>
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.address'})} >
|
||||
{getFieldDecorator('address',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.address-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.basic.phone'})} >
|
||||
{getFieldDecorator('phone',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.basic.phone-message'}, {}),
|
||||
},
|
||||
// { validator: validatorPhone },
|
||||
],
|
||||
}
|
||||
)
|
||||
( < PhoneView / >
|
||||
)
|
||||
}
|
||||
<
|
||||
/FormItem>
|
||||
< Button
|
||||
type = "primary" >
|
||||
< FormattedMessage
|
||||
id = "app.settings.security.update"
|
||||
defaultMessage = "Update Setting"
|
||||
/ >
|
||||
< /Button>
|
||||
< /Form></
|
||||
div >
|
||||
< /Col>
|
||||
< Col
|
||||
span = {8} >
|
||||
|
||||
< /Col>
|
||||
< /Row>
|
||||
< /div>
|
||||
)
|
||||
;
|
||||
};
|
||||
|
||||
render() {
|
||||
const {operationkey} = this.state;
|
||||
const contentList = {
|
||||
tab1: ( < div > {this.generalSettings()} < /div>),
|
||||
tab2: ( < div > SSO 集成 < /div>),
|
||||
tab3: ( < div > 角色管理 < /div>),
|
||||
tab4: ( < div > 用户管理 < /div>),
|
||||
tab5: ( < div > 证书管理 < /div>),
|
||||
}
|
||||
;
|
||||
return (
|
||||
< Fragment >
|
||||
< Card
|
||||
className = {styles.tabsCard}
|
||||
bordered = {false}
|
||||
tabList = {operationTabList}
|
||||
onTabChange = {this.onOperationTabChange}
|
||||
>
|
||||
{contentList[operationkey]}
|
||||
< /Card>
|
||||
< /Fragment>
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
export default General;
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
.tabsCard {
|
||||
:global {
|
||||
.ant-card-head {
|
||||
padding: 0 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btnRestore{
|
||||
position:absolute;
|
||||
bottom: 20px;
|
||||
}
|
||||
|
||||
.right{
|
||||
float: right;
|
||||
}
|
Loading…
Reference in New Issue