Merge branch 'master' of ssh://git.infini.ltd:64221/infini/search-center
This commit is contained in:
commit
b498b8b147
12
LICENSE
12
LICENSE
|
@ -1,21 +1,21 @@
|
|||
End-User License Agreement (EULA) of INFINI LOGGING CENTER
|
||||
End-User License Agreement (EULA) of INFINI SOFTWARE
|
||||
|
||||
This End-User License Agreement ("EULA") is a legal agreement between you and HUNAN INFINI TECHNOLOGY CO,LTD
|
||||
|
||||
This EULA agreement governs your acquisition and use of our INFINI LOGGING CENTER software ("Software") directly from HUNAN INFINI TECHNOLOGY CO,LTD or indirectly through a HUNAN INFINI TECHNOLOGY CO,LTD authorized reseller or distributor (a "Reseller").
|
||||
This EULA agreement governs your acquisition and use of our INFINI software ("Software") directly from HUNAN INFINI TECHNOLOGY CO,LTD or indirectly through a HUNAN INFINI TECHNOLOGY CO,LTD authorized reseller or distributor (a "Reseller").
|
||||
|
||||
Please read this EULA agreement carefully before completing the installation process and using the INFINI LOGGING CENTER software. It provides a license to use the INFINI LOGGING CENTER software and contains warranty information and liability disclaimers.
|
||||
Please read this EULA agreement carefully before completing the installation process and using the INFINI software. It provides a license to use the INFINI LOGGING CENTER software and contains warranty information and liability disclaimers.
|
||||
|
||||
If you register for a free trial of the INFINI LOGGING CENTER software, this EULA agreement will also govern that trial. By clicking "accept" or installing and/or using the INFINI LOGGING CENTER software, you are confirming your acceptance of the Software and agreeing to become bound by the terms of this EULA agreement.
|
||||
If you register for a free trial of the INFINI software, this EULA agreement will also govern that trial. By clicking "accept" or installing and/or using the INFINI LOGGING CENTER software, you are confirming your acceptance of the Software and agreeing to become bound by the terms of this EULA agreement.
|
||||
|
||||
If you are entering into this EULA agreement on behalf of a company or other legal entity, you represent that you have the authority to bind such entity and its affiliates to these terms and conditions. If you do not have such authority or if you do not agree with the terms and conditions of this EULA agreement, do not install or use the Software, and you must not accept this EULA agreement.
|
||||
|
||||
This EULA agreement shall apply only to the Software supplied by HUNAN INFINI TECHNOLOGY CO,LTD herewith regardless of whether other software is referred to or described herein. The terms also apply to any HUNAN INFINI TECHNOLOGY CO,LTD updates, supplements, Internet-based services, and support services for the Software, unless other terms accompany those items on delivery. If so, those terms apply.
|
||||
|
||||
License Grant
|
||||
HUNAN INFINI TECHNOLOGY CO,LTD hereby grants you a personal, non-transferable, non-exclusive licence to use the INFINI LOGGING CENTER software on your devices in accordance with the terms of this EULA agreement.
|
||||
HUNAN INFINI TECHNOLOGY CO,LTD hereby grants you a personal, non-transferable, non-exclusive licence to use the INFINI software on your devices in accordance with the terms of this EULA agreement.
|
||||
|
||||
You are permitted to load the INFINI LOGGING CENTER software (for example a PC, laptop, mobile or tablet) under your control. You are responsible for ensuring your device meets the minimum requirements of the INFINI LOGGING CENTER software.
|
||||
You are permitted to load the INFINI software (for example a PC, laptop, mobile or tablet) under your control. You are responsible for ensuring your device meets the minimum requirements of the INFINI LOGGING CENTER software.
|
||||
|
||||
You are not permitted to:
|
||||
|
||||
|
|
23
main.go
23
main.go
|
@ -15,19 +15,16 @@ var appUI *UI
|
|||
|
||||
func main() {
|
||||
|
||||
terminalHeader := (" __ _ __ ____ __ _ __ __ \n")
|
||||
terminalHeader += (" / // |/ // __// // |/ // / \n")
|
||||
terminalHeader += (" / // || // _/ / // || // / \n")
|
||||
terminalHeader += ("/_//_/|_//_/ /_//_/|_//_/ \n")
|
||||
terminalHeader += (" __ _ __ __ __ _ __ __\n")
|
||||
terminalHeader += (" / / ,' \\ ,'_/ ,'_/ / // |/ /,'_/\n")
|
||||
terminalHeader += (" / /_/ o |/ /_n/ /_n / // || // /_n\n")
|
||||
terminalHeader += ("/___/|_,' |__,'|__,'/_//_/|_/ |__,'\n")
|
||||
terminalHeader += (" __ ___ _ __ _____ ___ ___ \n")
|
||||
terminalHeader += (" ,'_/ / _/ / |/ //_ _// _/ / o | \n")
|
||||
terminalHeader += ("/ /_ / _/ / || / / / / _/ / ,' \n")
|
||||
terminalHeader += ("|__//___//_/|_/ /_/ /___//_/`_\\ \n")
|
||||
terminalHeader += (" \n")
|
||||
terminalHeader := (" .__ \n")
|
||||
terminalHeader += (" ______ ____ _____ _______ ____ | |__ \n")
|
||||
terminalHeader += (" / ___/_/ __ \\ \\__ \\ \\_ __ \\_/ ___\\ | | \\ \n")
|
||||
terminalHeader += (" \\___ \\ \\ ___/ / __ \\_| | \\/\\ \\___ | Y \\ \n")
|
||||
terminalHeader += ("/____ > \\___ >(____ /___| \\___ >|___| /\n")
|
||||
terminalHeader += (" ____/ ____\\/ ____\\_/ |_ ____ _______ \\/ \n")
|
||||
terminalHeader += ("_/ ___\\_/ __ \\ / \\\\ __\\_/ __ \\\\_ __ \\ \n")
|
||||
terminalHeader += ("\\ \\___\\ ___/ | | \\| | \\ ___/ | | \\/ \n")
|
||||
terminalHeader += (" \\___ >\\___ >|___| /|__| \\___ >|__| \n")
|
||||
terminalHeader += (" \\/ \\/ \\/ \\/ \n")
|
||||
|
||||
terminalFooter := (" __ _ __ ____ __ _ __ __ __ _____ __ \n")
|
||||
terminalFooter += (" / // |/ // __// // |/ // / / //_ _// \\ \n")
|
||||
|
|
|
@ -1,13 +1,30 @@
|
|||
elasticsearch:
|
||||
- name: default
|
||||
enabled: true
|
||||
endpoint: https://192.168.3.98:9200
|
||||
endpoint: http://localhost:9200
|
||||
index_prefix: infini-
|
||||
basic_auth:
|
||||
username: elastic
|
||||
password: 13A1EcwWs1He6w3BXHuJ
|
||||
|
||||
web:
|
||||
enabled: true
|
||||
ui:
|
||||
enabled: true
|
||||
path: .public
|
||||
vfs: true
|
||||
local: true
|
||||
network:
|
||||
binding: 127.0.0.1:2900
|
||||
skip_occupied_port: true
|
||||
|
||||
modules:
|
||||
- name: elastic
|
||||
elasticsearch: default
|
||||
enabled: true
|
||||
indexer_enabled: false
|
||||
store_enabled: false
|
||||
orm_enabled: false
|
||||
- name: web
|
||||
enabled: true
|
||||
network:
|
||||
|
|
4
ui.go
4
ui.go
|
@ -8,7 +8,7 @@ import (
|
|||
"infini.sh/framework/core/util"
|
||||
"infini.sh/framework/core/vfs"
|
||||
"infini.sh/search-center/.public"
|
||||
"infini.sh/search-center/api/index_management"
|
||||
uiapi "infini.sh/search-center/api"
|
||||
"infini.sh/search-center/config"
|
||||
"net/http"
|
||||
)
|
||||
|
@ -24,7 +24,7 @@ func (h UI) InitUI() {
|
|||
|
||||
ui.HandleUI("/", vfs.FileServer(vfs.VFS()))
|
||||
|
||||
index_management.Init()
|
||||
uiapi.Init()
|
||||
|
||||
ui.HandleUIFunc("/api/", func(w http.ResponseWriter, req *http.Request) {
|
||||
log.Warn("api: ",req.URL," not implemented")
|
||||
|
|
|
@ -247,34 +247,80 @@ export default [
|
|||
|
||||
//settings
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'settings',
|
||||
path: '/system',
|
||||
name: 'system',
|
||||
icon: 'setting',
|
||||
// component: './List/TableList',
|
||||
routes: [
|
||||
{
|
||||
path: '/settings/global',
|
||||
name: 'global',
|
||||
component: './Settings/Global/Global',
|
||||
}, {
|
||||
path: '/settings/security',
|
||||
name: 'security',
|
||||
path: '/system/settings',
|
||||
name: 'settings',
|
||||
component: './System/Settings/Base',
|
||||
hideChildrenInMenu: true,
|
||||
routes: [
|
||||
{
|
||||
path: '/settings/security',
|
||||
name: 'security',
|
||||
component: './Settings/Security/General',
|
||||
path: '/system/settings',
|
||||
redirect: '/system/settings/global',
|
||||
},
|
||||
{
|
||||
path: '/system/settings/global',
|
||||
component: './System/Settings/Global',
|
||||
}, {
|
||||
path: '/settings/security/general',
|
||||
name: 'general',
|
||||
component: './Forms/BasicForm',
|
||||
path: '/system/settings/gateway',
|
||||
component: './System/Settings/Gateway',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/security',
|
||||
name: 'security',
|
||||
component: './System/Security/Base',
|
||||
hideChildrenInMenu: true,
|
||||
routes: [
|
||||
{
|
||||
path: '/system/security',
|
||||
redirect: '/system/security/general',
|
||||
},
|
||||
{
|
||||
path: '/system/security/general',
|
||||
component: './System/Security/General',
|
||||
}, {
|
||||
path: '/system/security/sso',
|
||||
component: './System/Security/SSO',
|
||||
}, {
|
||||
path: '/system/security/roles',
|
||||
component: './System/Security/Roles',
|
||||
}, {
|
||||
path: '/system/security/users',
|
||||
component: './System/Security/Users',
|
||||
}, {
|
||||
path: '/system/security/certs',
|
||||
component: './System/Security/Certs',
|
||||
},
|
||||
]
|
||||
}, {
|
||||
path: '/settings/audit',
|
||||
name: 'audit',
|
||||
component: './List/TableList',
|
||||
path: '/system/logs',
|
||||
name: 'logs',
|
||||
component: './System/Logs/Base',
|
||||
hideChildrenInMenu: true,
|
||||
routes: [
|
||||
{
|
||||
path: '/system/logs',
|
||||
redirect: '/system/logs/overview',
|
||||
},
|
||||
{
|
||||
path: '/system/logs/overview',
|
||||
component: './System/Logs/Overview',
|
||||
}, {
|
||||
path: '/system/logs/audit',
|
||||
component: './System/Logs/Audit',
|
||||
}, {
|
||||
path: '/system/logs/query',
|
||||
component: './System/Logs/Audit',
|
||||
}, {
|
||||
path: '/system/logs/slow',
|
||||
component: './System/Logs/Audit',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
margin: 3px 0 0 12px;
|
||||
margin: 6px 0 0 12px;
|
||||
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import Link from 'umi/link';
|
|||
import RightContent from '../GlobalHeader/RightContent';
|
||||
import BaseMenu from '../SiderMenu/BaseMenu';
|
||||
import styles from './index.less';
|
||||
import { formatMessage, FormattedMessage } from 'umi/locale';
|
||||
|
||||
export default class TopNavHeader extends PureComponent {
|
||||
state = {
|
||||
|
@ -30,7 +31,7 @@ export default class TopNavHeader extends PureComponent {
|
|||
<div className={styles.logo} key="logo" id="logo">
|
||||
<Link to="/">
|
||||
<img src={logo} alt="logo" />
|
||||
<h1>Logging Center</h1>
|
||||
<h1>{formatMessage({ id: 'app.setting.appname' })}</h1>
|
||||
</Link>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
@ -3,6 +3,8 @@ export default {
|
|||
|
||||
'layout.user.appname':"INFINI SEARCH CENTER",
|
||||
'layout.user.appslogon':"INFINI search center is the best search platform in the world",
|
||||
'app.setting.appname':"Search Center",
|
||||
|
||||
|
||||
'layout.user.link.help': 'Help',
|
||||
'layout.user.link.privacy': 'Privacy',
|
||||
|
@ -95,10 +97,24 @@ export default {
|
|||
'menu.search.analyzer': 'ANALYZER',
|
||||
'menu.search.nlp': 'NLP',
|
||||
|
||||
'menu.settings': 'SETTINGS',
|
||||
'menu.settings.global': 'GLOBAL',
|
||||
'menu.settings.security': 'SECURITY',
|
||||
'menu.settings.audit': 'AUDIT',
|
||||
'menu.system': 'SYSTEM',
|
||||
'menu.system.settings': 'SETTINGS',
|
||||
'menu.system.settings.global': 'GLOBAL',
|
||||
'menu.system.settings.gateway': 'GATEWAY',
|
||||
|
||||
'menu.system.security': 'SECURITY',
|
||||
'menu.system.security.general': 'GENERAL',
|
||||
'menu.system.security.sso': 'SSO',
|
||||
'menu.system.security.roles': 'ROLES',
|
||||
'menu.system.security.users': 'USERS',
|
||||
'menu.system.security.certs': 'CERTS',
|
||||
|
||||
|
||||
'menu.system.logs': 'LOGS',
|
||||
'menu.system.logs.overview': 'OVERVIEW',
|
||||
'menu.system.logs.audit': 'AUDIT',
|
||||
'menu.system.logs.query': 'QUERY',
|
||||
'menu.system.logs.slow': 'SLOW',
|
||||
|
||||
|
||||
'menu.form': 'Form',
|
||||
|
@ -203,9 +219,6 @@ export default {
|
|||
'app.monitor.resource-surplus': 'Resource Surplus',
|
||||
'app.monitor.fund-surplus': 'Fund Surplus',
|
||||
|
||||
'app.setting.appname':"Search Center",
|
||||
|
||||
|
||||
'app.settings.security.update':"Update Setting",
|
||||
'app.settings.global.update':"Update Setting",
|
||||
'app.settings.global.site_name':"Site Name",
|
||||
|
|
|
@ -3,6 +3,7 @@ export default {
|
|||
|
||||
'layout.user.appname':"极限搜索管理后台",
|
||||
'layout.user.appslogon':"极限科技的搜索平台是东半球最好用的搜索服务平台",
|
||||
'app.setting.appname':"极限搜索中心",
|
||||
|
||||
'layout.user.link.help': '帮助',
|
||||
'layout.user.link.privacy': '隐私',
|
||||
|
@ -103,11 +104,23 @@ export default {
|
|||
'menu.search.analyzer': '分词管理',
|
||||
'menu.search.nlp': '自然语言处理',
|
||||
|
||||
'menu.settings': '系统设置',
|
||||
'menu.settings.global': '全局设置',
|
||||
'menu.settings.security': '安全设置',
|
||||
'menu.settings.authorization': '授权管理',
|
||||
'menu.settings.audit': '审计日志',
|
||||
'menu.system': '系统管理',
|
||||
'menu.system.settings': '系统设置',
|
||||
'menu.system.settings.global': '全局设置',
|
||||
'menu.system.settings.gateway': '网关设置',
|
||||
|
||||
'menu.system.security': '安全设置',
|
||||
'menu.system.security.general': '基础设置',
|
||||
'menu.system.security.sso': '单点登录',
|
||||
'menu.system.security.roles': '角色管理',
|
||||
'menu.system.security.users': '用户管理',
|
||||
'menu.system.security.certs': '证书管理',
|
||||
|
||||
'menu.system.logs': '系统日志',
|
||||
'menu.system.logs.overview': '日志概要',
|
||||
'menu.system.logs.audit': '审计日志',
|
||||
'menu.system.logs.query': '查询日志',
|
||||
'menu.system.logs.slow': '慢日志',
|
||||
|
||||
|
||||
'menu.form': '表单页',
|
||||
|
@ -212,7 +225,6 @@ export default {
|
|||
'app.monitor.resource-surplus': '资源剩余',
|
||||
'app.monitor.fund-surplus': '补贴资金剩余',
|
||||
|
||||
'app.setting.appname':"极限搜索中心",
|
||||
|
||||
'app.settings.security.update':"更新设置",
|
||||
'app.settings.global.update':"更新设置",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component,Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import { Card,Form,Input, Select,Button,message,Upload, Icon } from 'antd';
|
||||
import { Card,Form,Input, Select,Button,message,Upload, Icon,Switch } from 'antd';
|
||||
const { Option } = Select;
|
||||
import { formatMessage, FormattedMessage } from 'umi/locale';
|
||||
import DescriptionList from '@/components/DescriptionList';
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
Badge,
|
||||
Divider,
|
||||
Steps,
|
||||
Radio,
|
||||
Popconfirm
|
||||
} from 'antd';
|
||||
import StandardTable from '@/components/StandardTable';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
@ -213,6 +213,15 @@ class IngestPipeline extends PureComponent {
|
|||
};
|
||||
|
||||
handleDeleteClick = e => {
|
||||
Modal.confirm({
|
||||
title: '删除Pipeline',
|
||||
content: '确定删除该Pipeline吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => this.deleteItem(),
|
||||
});
|
||||
};
|
||||
deleteItem = ()=>{
|
||||
const { dispatch } = this.props;
|
||||
const { selectedRows } = this.state;
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import React, { Component,Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import { Card,Form,Input, Select,Button,message } from 'antd';
|
||||
import { Card,Form,Input, Select,Button,message, Drawer,
|
||||
List
|
||||
} from 'antd';
|
||||
const { Option } = Select;
|
||||
import { formatMessage, FormattedMessage } from 'umi/locale';
|
||||
import DescriptionList from '@/components/DescriptionList';
|
||||
|
@ -18,6 +20,28 @@ const operationTabList = [
|
|||
tab: '对接Kafka',
|
||||
}
|
||||
];
|
||||
const configRawData = [
|
||||
{
|
||||
title: 'schedule',
|
||||
content: [`Schedule of when to periodically run statement, in Cron format for example: "* * * * *" (execute query every minute, on the minute)`,
|
||||
`There is no schedule by default. If no schedule is given, then the statement is run exactly once.`],
|
||||
},
|
||||
{
|
||||
title: 'jdbc_driver_library',
|
||||
content: ['JDBC driver library path to third party driver library. In case of multiple libraries being required you can pass them separated by a comma.'],
|
||||
},
|
||||
{
|
||||
title: 'jdbc_driver_class',
|
||||
content: ['JDBC driver class to load, for example, "org.apache.derby.jdbc.ClientDriver"'],
|
||||
},
|
||||
{
|
||||
title: 'jdbc_connection_string',
|
||||
content: ['JDBC connection string, for example, "jdbc:oracle:test:@192.168.1.68:1521/testdb"'],
|
||||
},{
|
||||
title:'jdbc_paging_enabled',
|
||||
content: ['This will cause a sql statement to be broken up into multiple queries. Each query will use limits and offsets to collectively retrieve the full result-set. The limit size is set with jdbc_page_size.','Be aware that ordering is not guaranteed between queries.']
|
||||
},
|
||||
];
|
||||
|
||||
@connect(({logstash,loading }) => ({
|
||||
data: logstash.logstash,
|
||||
|
@ -29,6 +53,8 @@ const operationTabList = [
|
|||
class LogstashConfig extends Component {
|
||||
state = {
|
||||
operationkey: 'tab1',
|
||||
drawerVisible: false,
|
||||
drawerData: configRawData,
|
||||
};
|
||||
componentDidMount() {
|
||||
message.loading('数据加载中..', 'initdata');
|
||||
|
@ -66,6 +92,28 @@ class LogstashConfig extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
handleDrawerVisible = () => {
|
||||
this.setState(preState=>{
|
||||
return {
|
||||
drawerVisible: !preState.drawerVisible,
|
||||
}
|
||||
})
|
||||
};
|
||||
onCloseDrawer = ()=>{
|
||||
this.setState({
|
||||
drawerVisible: false,
|
||||
});
|
||||
};
|
||||
|
||||
onDrawerSearch = (value)=>{
|
||||
let data = configRawData.filter((conf)=>{
|
||||
return conf.title.includes(value);
|
||||
});
|
||||
this.setState({
|
||||
drawerData: data,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { operationkey } = this.state;
|
||||
const { submitting, data, loading } = this.props;
|
||||
|
@ -92,7 +140,7 @@ class LogstashConfig extends Component {
|
|||
};
|
||||
const contentList = {
|
||||
tab1: (
|
||||
<div>
|
||||
<div style={{position:"relative"}}>
|
||||
<Form onSubmit={this.handleSubmit} name="jdbc" hideRequiredMark style={{ marginTop: 8 }}>
|
||||
<FormItem {...formItemLayout} label={<FormattedMessage id="form.dbtype.label" />}>
|
||||
{getFieldDecorator('dbtype', {
|
||||
|
@ -112,6 +160,7 @@ class LogstashConfig extends Component {
|
|||
</Select>
|
||||
)}
|
||||
</FormItem>
|
||||
<a href="javascript:void(0);" onClick={this.handleDrawerVisible} style={{position:"absolute", top:15,right:50}}>配置释义</a>
|
||||
<FormItem {...formItemLayout} label={<FormattedMessage id="form.logstash.jdbcconf.label" />}>
|
||||
{getFieldDecorator('logstash.jdbcconf', {
|
||||
initialValue: data.jdbc.config,
|
||||
|
@ -173,6 +222,30 @@ class LogstashConfig extends Component {
|
|||
onTabChange={this.onOperationTabChange}
|
||||
>
|
||||
{contentList[operationkey]}
|
||||
<Drawer visible={this.state.drawerVisible}
|
||||
title="配置释义"
|
||||
onClose={this.onCloseDrawer}
|
||||
width={720}
|
||||
>
|
||||
<Input.Search placeholder="input config key" onChange={(e) => {this.onDrawerSearch(e.target.value)}} onSearch={this.onDrawerSearch} enterButton />
|
||||
<List
|
||||
itemLayout="vertical"
|
||||
size="small"
|
||||
dataSource={this.state.drawerData}
|
||||
renderItem={item => (
|
||||
<List.Item key={item.title}>
|
||||
<List.Item.Meta
|
||||
title={item.title}
|
||||
/>
|
||||
<div>
|
||||
{item.content.map((c)=>{
|
||||
return (<p>{c}</p>);
|
||||
})}
|
||||
</div>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
</Drawer>
|
||||
</Card>
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { PureComponent, Fragment } from 'react';
|
||||
import React, { PureComponent, Fragment,forwardRef } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import {
|
||||
Row,
|
||||
|
@ -11,7 +11,13 @@ import {
|
|||
message,
|
||||
Divider,
|
||||
Drawer,
|
||||
Steps,
|
||||
Select,
|
||||
TimePicker,
|
||||
Switch,
|
||||
Icon,
|
||||
} from 'antd';
|
||||
import moment from 'moment';
|
||||
import StandardTable from '@/components/StandardTable';
|
||||
|
||||
import styles from '../../List/TableList.less';
|
||||
|
@ -19,81 +25,187 @@ import styles from '../../List/TableList.less';
|
|||
const FormItem = Form.Item;
|
||||
const { TextArea } = Input;
|
||||
|
||||
const CreateForm = Form.create()(props => {
|
||||
const { modalVisible, form, handleAdd, handleModalVisible } = props;
|
||||
const okHandle = () => {
|
||||
form.validateFields((err, fieldsValue) => {
|
||||
if (err) return;
|
||||
form.resetFields();
|
||||
handleAdd(fieldsValue);
|
||||
});
|
||||
};
|
||||
let RightSwitch = forwardRef((props, _ref) => {
|
||||
return (
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="新建索引模板"
|
||||
visible={modalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="索引模板名称">
|
||||
{form.getFieldDecorator('name', {
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板设置">
|
||||
{form.getFieldDecorator('settings', {
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
</FormItem>
|
||||
</Modal>
|
||||
);
|
||||
<div>
|
||||
<Switch
|
||||
name={props.id}
|
||||
checkedChildren={<Icon type="check" />}
|
||||
unCheckedChildren={<Icon type="close" />}
|
||||
checked={props.value}
|
||||
style={{marginRight:5}}
|
||||
onChange={(v)=>{props.onChange(v)}}
|
||||
/>
|
||||
{props.description}
|
||||
</div>
|
||||
)
|
||||
});
|
||||
|
||||
const UpdateForm = Form.create()(props => {
|
||||
const { updateModalVisible, handleUpdateModalVisible, handleUpdate,values,form } = props;
|
||||
@Form.create()
|
||||
class NewForm extends PureComponent {
|
||||
state = {
|
||||
currentStep: 0,
|
||||
}
|
||||
|
||||
const okHandle = () => {
|
||||
form.validateFields((err, fieldsValue) => {
|
||||
if (err) return;
|
||||
form.resetFields();
|
||||
handleUpdate(fieldsValue);
|
||||
});
|
||||
renderStep=()=>{
|
||||
let {form} = this.props;
|
||||
let retDom = '';
|
||||
let formLayout = {
|
||||
labelCol:{span:5},
|
||||
wrapperCol:{span:15}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="索引模板设置"
|
||||
visible={updateModalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleUpdateModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="索引模板名称">
|
||||
let sformLayout = {
|
||||
labelCol:{span:15},
|
||||
wrapperCol:{span:5}
|
||||
};
|
||||
const format = 'HH:mm';
|
||||
switch(this.state.currentStep){
|
||||
case 0:
|
||||
retDom = (
|
||||
<Form>
|
||||
<Form.Item label="策略名称" {...formLayout}>
|
||||
{form.getFieldDecorator('name', {
|
||||
initialValue: values.name,
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="索引模板设置">
|
||||
{form.getFieldDecorator('policy', {
|
||||
initialValue: values.policy,
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
</FormItem>
|
||||
</Modal>
|
||||
})(<Input placeholder="请输入策略名称" style={{width:200}} />)}
|
||||
</Form.Item>
|
||||
<Form.Item label="快照名称" {...formLayout}>
|
||||
{form.getFieldDecorator('snapshot', {
|
||||
rules: [{ required: true }],
|
||||
})(<Input placeholder="请输入快照名称" style={{width:200}} />)}
|
||||
</Form.Item>
|
||||
<Form.Item label="选择仓库" {...formLayout}>
|
||||
{form.getFieldDecorator('repo', {
|
||||
rules: [{ required: true }],
|
||||
})(
|
||||
<Select style={{width:200}}>
|
||||
<Select.Option value="my_local_repo">
|
||||
my_local_repo
|
||||
</Select.Option>
|
||||
<Select.Option value="my_local_repo">
|
||||
my_remote_repo
|
||||
</Select.Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="频率" {...formLayout}>
|
||||
{form.getFieldDecorator('frequency', {
|
||||
rules: [{ required: true }],
|
||||
})(
|
||||
<Select style={{width:200}}>
|
||||
<Select.Option value="day">
|
||||
每天
|
||||
</Select.Option>
|
||||
<Select.Option value="month">
|
||||
每月
|
||||
</Select.Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="时间" {...formLayout}>
|
||||
{form.getFieldDecorator('time', {
|
||||
rules: [{ required: true }],
|
||||
})(
|
||||
<TimePicker format={format} style={{width:200}} />
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
retDom = (
|
||||
<Form>
|
||||
<Form.Item label="">
|
||||
{form.getFieldDecorator('indices', {
|
||||
initialValue: true,
|
||||
})(
|
||||
<RightSwitch description="all data streams and indices, including system indices"/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{form.getFieldDecorator('unavaiable', {
|
||||
initialValue: false,
|
||||
})(
|
||||
<RightSwitch description="Ignore unavaiable indices"/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="">
|
||||
{form.getFieldDecorator('partial', {
|
||||
// initialValue: true,
|
||||
})(
|
||||
<RightSwitch description="Allow partial indices"/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="" >
|
||||
{form.getFieldDecorator('global', {
|
||||
initialValue: true,
|
||||
})(
|
||||
<RightSwitch description="Include global state"/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
return retDom;
|
||||
}
|
||||
handleNext(currentStep){
|
||||
const {form} = this.props;
|
||||
form.validateFieldsAndScroll((err, values) => {
|
||||
console.log(values);
|
||||
});
|
||||
form.validate
|
||||
this.setState({
|
||||
currentStep: currentStep +1,
|
||||
});
|
||||
}
|
||||
backward(){
|
||||
this.setState(preState=>{
|
||||
if(preState.currentStep < 1) {
|
||||
return preState;
|
||||
}
|
||||
return {
|
||||
currentStep: preState.currentStep - 1
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
render(){
|
||||
const {currentStep} = this.state;
|
||||
return (
|
||||
<div>
|
||||
<Steps current={this.state.currentStep}>
|
||||
<Steps.Step title="基本设置" description=""/>
|
||||
<Steps.Step title="快照设置" description=""/>
|
||||
<Steps.Step title="快照保存设置" description=""/>
|
||||
<Steps.Step title="确认" description=""/>
|
||||
</Steps>
|
||||
<Divider />
|
||||
{this.renderStep()}
|
||||
<div style={{
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
width: '100%',
|
||||
borderTop: '1px solid #e9e9e9',
|
||||
padding: '10px 16px',
|
||||
background: '#fff',
|
||||
}}>
|
||||
<Button key="back" onClick={()=>this.backward(currentStep)}>
|
||||
上一步
|
||||
</Button>
|
||||
<Button key="forward" style={{marginLeft:'2em'}} type="primary" onClick={() => this.handleNext(currentStep)}>
|
||||
下一步
|
||||
</Button>
|
||||
<Button key="cancel" style={{float:'right'}} onClick={() =>{}}>
|
||||
取消
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint react/no-multi-comp:0 */
|
||||
@connect(({ pipeline, loading }) => ({
|
||||
|
@ -296,7 +408,7 @@ class BakCycle extends PureComponent {
|
|||
<Form onSubmit={this.handleSearch} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="索引模板名称">
|
||||
<FormItem label="备份策略模板名称">
|
||||
{getFieldDecorator('name')(<Input placeholder="请输入" />)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
|
@ -318,6 +430,17 @@ class BakCycle extends PureComponent {
|
|||
renderForm() {
|
||||
return this.renderSimpleForm();
|
||||
}
|
||||
handleNewClick = ()=>{
|
||||
this.setState({
|
||||
drawerVisible: true,
|
||||
});
|
||||
};
|
||||
|
||||
onCloseDrawer = ()=>{
|
||||
this.setState({
|
||||
drawerVisible: false,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const data = {
|
||||
|
@ -341,7 +464,7 @@ class BakCycle extends PureComponent {
|
|||
<div className={styles.tableList}>
|
||||
<div className={styles.tableListForm}>{this.renderForm()}</div>
|
||||
<div className={styles.tableListOperator}>
|
||||
<Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>
|
||||
<Button icon="plus" type="primary" onClick={() => this.handleNewClick(true)}>
|
||||
新建
|
||||
</Button>
|
||||
{selectedRows.length > 0 && (
|
||||
|
@ -359,14 +482,6 @@ class BakCycle extends PureComponent {
|
|||
/>
|
||||
</div>
|
||||
</Card>
|
||||
<CreateForm {...parentMethods} modalVisible={modalVisible} />
|
||||
{updateFormValues && Object.keys(updateFormValues).length ? (
|
||||
<UpdateForm
|
||||
{...updateMethods}
|
||||
updateModalVisible={updateModalVisible}
|
||||
values={updateFormValues}
|
||||
/>
|
||||
) : null}
|
||||
<Drawer
|
||||
title="备份策略"
|
||||
placement="right"
|
||||
|
@ -374,9 +489,7 @@ class BakCycle extends PureComponent {
|
|||
onClose={this.onCloseDrawer}
|
||||
visible={this.state.drawerVisible}
|
||||
>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
<NewForm />
|
||||
</Drawer>
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { connect } from 'dva';
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
Button,
|
||||
Modal,
|
||||
message,
|
||||
Divider,
|
||||
Row,
|
||||
Col,
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
Button,
|
||||
Modal,
|
||||
message,
|
||||
Divider,
|
||||
Icon,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Select,
|
||||
Popover,
|
||||
} from 'antd';
|
||||
import StandardTable from '@/components/StandardTable';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
@ -18,6 +23,11 @@ import styles from '../../List/TableList.less';
|
|||
|
||||
const FormItem = Form.Item;
|
||||
const { TextArea } = Input;
|
||||
const fieldLabels = {
|
||||
keyword_type: '关键词分类'
|
||||
|
||||
};
|
||||
|
||||
|
||||
const CreateForm = Form.create()(props => {
|
||||
const { modalVisible, form, handleAdd, handleModalVisible } = props;
|
||||
|
@ -35,65 +45,76 @@ const CreateForm = Form.create()(props => {
|
|||
visible={modalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板名称">
|
||||
onCancel={() => handleModalVisible()}>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="关键词">
|
||||
{form.getFieldDecorator('name', {
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板设置">
|
||||
{form.getFieldDecorator('settings', {
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
|
||||
})(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
<Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label='关键词分类'>
|
||||
{form.getFieldDecorator('keyword_type', {
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} placeholder="请选择关键词类型">
|
||||
<Option value="keyun">敏感词</Option>
|
||||
<Option value="huoyun">提示词</Option>
|
||||
<Option value="xianlu1">同义词</Option>
|
||||
<Option value="xianlu2">过滤词</Option>
|
||||
<Option value="xianlu3">停用词</Option>
|
||||
<Option value="xianlu4">保留词</Option>
|
||||
<Option value="xianlu5">纠错词</Option>
|
||||
<Option value="xianlu6">相关搜索</Option>
|
||||
<Option value="xianlu7">热点词管理</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Modal>
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
const UpdateForm = Form.create()(props => {
|
||||
const { updateModalVisible, handleUpdateModalVisible, handleUpdate,values,form } = props;
|
||||
const { updateModalVisible, handleUpdateModalVisible, handleUpdate,values,form } = props;
|
||||
|
||||
const okHandle = () => {
|
||||
const okHandle = () => {
|
||||
form.validateFields((err, fieldsValue) => {
|
||||
if (err) return;
|
||||
form.resetFields();
|
||||
handleUpdate(fieldsValue);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="模板设置"
|
||||
visible={updateModalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleUpdateModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板名称">
|
||||
{form.getFieldDecorator('name', {
|
||||
initialValue: values.name,
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板设置">
|
||||
{form.getFieldDecorator('settings', {
|
||||
initialValue: values.processors,
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
return (
|
||||
<Modal destroyOnClose title="新增关键词" visible={updateModalVisible} width={640} onOk={okHandle}
|
||||
onCancel={() => handleUpdateModalVisible()}>
|
||||
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="关键词">
|
||||
{form.getFieldDecorator('keyword', {
|
||||
initialValue: values.keyword,
|
||||
rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
|
||||
})(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
|
||||
<Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label={fieldLabels.keyword_type}>
|
||||
{form.getFieldDecorator('keyword_type', {
|
||||
initialValue: values.value,
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select placeholder="请选择关键词类型">
|
||||
<Option value="keyun">敏感词</Option>
|
||||
<Option value="huoyun">提示词</Option>
|
||||
<Option value="xianlu">同义词</Option>
|
||||
<Option value="xianlu">过滤词</Option>
|
||||
<Option value="xianlu">停用词</Option>
|
||||
<Option value="xianlu">保留词</Option>
|
||||
<Option value="xianlu">纠错词</Option>
|
||||
<Option value="xianlu">相关搜索</Option>
|
||||
<Option value="xianlu">热点词管理</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Modal>
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint react/no-multi-comp:0 */
|
||||
@connect(({ pipeline, loading }) => ({
|
||||
|
@ -110,111 +131,73 @@ class Common extends PureComponent {
|
|||
formValues: {},
|
||||
updateFormValues: {},
|
||||
};
|
||||
//index template detail example
|
||||
// {
|
||||
// ".ml-state" : {
|
||||
// "order" : 0,
|
||||
// "version" : 7090199,
|
||||
// "index_patterns" : [
|
||||
// ".ml-state*"
|
||||
// ],
|
||||
// "settings" : {
|
||||
// "index" : {
|
||||
// "hidden" : "true",
|
||||
// "lifecycle" : {
|
||||
// "name" : "ml-size-based-ilm-policy",
|
||||
// "rollover_alias" : ".ml-state-write"
|
||||
// },
|
||||
// "auto_expand_replicas" : "0-1"
|
||||
// }
|
||||
// },
|
||||
// "mappings" : {
|
||||
// "_meta" : {
|
||||
// "version" : "7090199"
|
||||
// },
|
||||
// "enabled" : false
|
||||
// },
|
||||
// "aliases" : { }
|
||||
// }
|
||||
// }
|
||||
datasource = `
|
||||
[
|
||||
{
|
||||
"name" : "filebeat-7.9.1",
|
||||
"index_patterns" : "[filebeat-7.9.1-*]",
|
||||
"order" : "1",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "验收标准",
|
||||
"type" : "停用词",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : "apm-7.9.1-span",
|
||||
"index_patterns" : "[apm-7.9.1-span*]",
|
||||
"order" : "2",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "桥梁施工技术规范",
|
||||
"type" : "停用词",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "路规",
|
||||
"type" : "停用词",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "遂规",
|
||||
"type" : "热点词",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : ".lists-default",
|
||||
"index_patterns" : "[.lists-default-*]",
|
||||
"order" : "0",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "铁路技术管理规则",
|
||||
"type" : "热点词",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "行车组织规则",
|
||||
"type" : "热点词",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : ".monitoring-es",
|
||||
"index_patterns" : "[.monitoring-es-7-*]",
|
||||
"order" : "0",
|
||||
"version" : "7000199",
|
||||
"composed_of" : ""
|
||||
},
|
||||
{
|
||||
"name" : ".monitoring-beats",
|
||||
"index_patterns" : "[.monitoring-beats-7-*]",
|
||||
"order" : "0",
|
||||
"version" : "7000199",
|
||||
"composed_of" : ""
|
||||
"keyword" : "铁路交通事故调查处理规则",
|
||||
"type" : "热点词",
|
||||
"value": "keyun"
|
||||
}]`;
|
||||
|
||||
columns = [
|
||||
{
|
||||
title: '模板名称',
|
||||
dataIndex: 'name',
|
||||
title: '关键词名称',
|
||||
dataIndex: 'keyword',
|
||||
},
|
||||
{
|
||||
title: '模式',
|
||||
dataIndex: 'index_patterns',
|
||||
},
|
||||
{
|
||||
title: 'order',
|
||||
dataIndex: 'order'
|
||||
},
|
||||
{
|
||||
title: '版本',
|
||||
dataIndex: 'version'
|
||||
title: '关键词分类',
|
||||
dataIndex: 'type',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
render: (text, record) => (
|
||||
<Fragment>
|
||||
<a onClick={() => this.handleUpdateModalVisible(true, record)}>设置</a>
|
||||
<Divider type="vertical" />
|
||||
<a onClick={() => this.handleUpdateModalVisible(true, record)}>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a onClick={() => {
|
||||
this.state.selectedRows.push(record);
|
||||
this.handleDeleteClick();
|
||||
}}>删除</a>
|
||||
</Fragment>
|
||||
),
|
||||
},
|
||||
];
|
||||
}}>删除</a>
|
||||
</Fragment>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
componentDidMount() {
|
||||
componentDidMount() {
|
||||
const { dispatch } = this.props;
|
||||
// dispatch({
|
||||
// type: 'pipeline/fetch',
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
handleStandardTableChange = (pagination, filtersArg, sorter) => {
|
||||
handleStandardTableChange = (pagination, filtersArg, sorter) => {
|
||||
const { dispatch } = this.props;
|
||||
const { formValues } = this.state;
|
||||
|
||||
|
@ -238,9 +221,9 @@ class Common extends PureComponent {
|
|||
type: 'pipeline/fetch',
|
||||
payload: params,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleFormReset = () => {
|
||||
handleFormReset = () => {
|
||||
const { form, dispatch } = this.props;
|
||||
form.resetFields();
|
||||
this.setState({
|
||||
|
@ -250,9 +233,9 @@ class Common extends PureComponent {
|
|||
type: 'pipeline/fetch',
|
||||
payload: {},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleDeleteClick = e => {
|
||||
handleDeleteClick = e => {
|
||||
const { dispatch } = this.props;
|
||||
const { selectedRows } = this.state;
|
||||
|
||||
|
@ -268,15 +251,15 @@ class Common extends PureComponent {
|
|||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleSelectRows = rows => {
|
||||
handleSelectRows = rows => {
|
||||
this.setState({
|
||||
selectedRows: rows,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleSearch = e => {
|
||||
handleSearch = e => {
|
||||
e.preventDefault();
|
||||
|
||||
const { dispatch, form } = this.props;
|
||||
|
@ -298,22 +281,22 @@ class Common extends PureComponent {
|
|||
payload: values,
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleModalVisible = flag => {
|
||||
handleModalVisible = flag => {
|
||||
this.setState({
|
||||
modalVisible: !!flag,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleUpdateModalVisible = (flag, record) => {
|
||||
handleUpdateModalVisible = (flag, record) => {
|
||||
this.setState({
|
||||
updateModalVisible: !!flag,
|
||||
updateFormValues: record || {},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
handleAdd = fields => {
|
||||
handleAdd = fields => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch({
|
||||
type: 'pipeline/add',
|
||||
|
@ -326,9 +309,9 @@ class Common extends PureComponent {
|
|||
|
||||
message.success('添加成功');
|
||||
this.handleModalVisible();
|
||||
};
|
||||
};
|
||||
|
||||
handleUpdate = fields => {
|
||||
handleUpdate = fields => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch({
|
||||
type: 'pipeline/update',
|
||||
|
@ -341,18 +324,37 @@ class Common extends PureComponent {
|
|||
|
||||
message.success('修改成功');
|
||||
this.handleUpdateModalVisible();
|
||||
};
|
||||
};
|
||||
|
||||
renderSimpleForm() {
|
||||
renderSimpleForm() {
|
||||
const {
|
||||
form: { getFieldDecorator },
|
||||
} = this.props;
|
||||
return (
|
||||
<Form onSubmit={this.handleSearch} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col lg={6} md={12} sm={24}>
|
||||
<Form.Item label={fieldLabels.keyword_type}>
|
||||
{getFieldDecorator('keyword_type', {
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select placeholder="请选择关键词类型">
|
||||
<Option value="keyun">敏感词</Option>
|
||||
<Option value="huoyun">提示词</Option>
|
||||
<Option value="xianlu">同义词</Option>
|
||||
<Option value="xianlu">过滤词</Option>
|
||||
<Option value="xianlu">停用词</Option>
|
||||
<Option value="xianlu">保留词</Option>
|
||||
<Option value="xianlu">纠错词</Option>
|
||||
<Option value="xianlu">相关搜索</Option>
|
||||
<Option value="xianlu">热点词管理</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="模板名称">
|
||||
{getFieldDecorator('name')(<Input placeholder="请输入" />)}
|
||||
<FormItem label="关键词">
|
||||
{getFieldDecorator('name')(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
|
@ -367,14 +369,14 @@ class Common extends PureComponent {
|
|||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
renderForm() {
|
||||
renderForm() {
|
||||
return this.renderSimpleForm();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
render() {
|
||||
const data = {
|
||||
list: JSON.parse(this.datasource),
|
||||
pagination: {
|
||||
|
@ -397,7 +399,7 @@ class Common extends PureComponent {
|
|||
<div className={styles.tableListForm}>{this.renderForm()}</div>
|
||||
<div className={styles.tableListOperator}>
|
||||
<Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>
|
||||
新建
|
||||
新增关键词
|
||||
</Button>
|
||||
{selectedRows.length > 0 && (
|
||||
<span>
|
||||
|
@ -426,5 +428,4 @@ class Common extends PureComponent {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Common;
|
||||
|
|
|
@ -10,6 +10,11 @@ import {
|
|||
Modal,
|
||||
message,
|
||||
Divider,
|
||||
Icon,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Select,
|
||||
Popover,
|
||||
} from 'antd';
|
||||
import StandardTable from '@/components/StandardTable';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
@ -18,7 +23,10 @@ import styles from '../../List/TableList.less';
|
|||
|
||||
const FormItem = Form.Item;
|
||||
const { TextArea } = Input;
|
||||
const fieldLabels = {
|
||||
keyword_type: '关键词分类'
|
||||
|
||||
};
|
||||
const CreateForm = Form.create()(props => {
|
||||
const { modalVisible, form, handleAdd, handleModalVisible } = props;
|
||||
const okHandle = () => {
|
||||
|
@ -35,24 +43,25 @@ const CreateForm = Form.create()(props => {
|
|||
visible={modalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板名称">
|
||||
onCancel={() => handleModalVisible()}>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="关键词">
|
||||
{form.getFieldDecorator('name', {
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板设置">
|
||||
{form.getFieldDecorator('settings', {
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
</FormItem>
|
||||
rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
|
||||
})(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
<Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label='关键词分类'>
|
||||
{form.getFieldDecorator('keyword_type', {
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select placeholder="请选择关键词类型">
|
||||
<Option value="keyun">客运</Option>
|
||||
<Option value="huoyun">货运</Option>
|
||||
<Option value="xianlu">线路</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Modal>
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
const UpdateForm = Form.create()(props => {
|
||||
|
@ -67,32 +76,30 @@ const UpdateForm = Form.create()(props => {
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="模板设置"
|
||||
visible={updateModalVisible}
|
||||
width={640}
|
||||
onOk={okHandle}
|
||||
onCancel={() => handleUpdateModalVisible()}
|
||||
>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板名称">
|
||||
{form.getFieldDecorator('name', {
|
||||
initialValue: values.name,
|
||||
rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
|
||||
})(<Input placeholder="请输入名称" />)}
|
||||
</FormItem>
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板设置">
|
||||
{form.getFieldDecorator('settings', {
|
||||
initialValue: values.processors,
|
||||
rules: [{ required: true }],
|
||||
})(<TextArea
|
||||
style={{ minHeight: 24 }}
|
||||
placeholder="请输入"
|
||||
rows={9}
|
||||
/>)}
|
||||
</FormItem>
|
||||
<Modal destroyOnClose title="新增关键词" visible={updateModalVisible} width={640} onOk={okHandle}
|
||||
onCancel={() => handleUpdateModalVisible()}>
|
||||
|
||||
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="关键词">
|
||||
{form.getFieldDecorator('keyword', {
|
||||
initialValue: values.keyword,
|
||||
rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
|
||||
})(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
|
||||
<Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label={fieldLabels.keyword_type}>
|
||||
{form.getFieldDecorator('keyword_type', {
|
||||
initialValue: values.value,
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select placeholder="请选择关键词类型">
|
||||
<Option value="keyun">客运</Option>
|
||||
<Option value="huoyun">货运</Option>
|
||||
<Option value="xianlu">线路</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Modal>
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
/* eslint react/no-multi-comp:0 */
|
||||
|
@ -110,93 +117,55 @@ class Professional extends PureComponent {
|
|||
formValues: {},
|
||||
updateFormValues: {},
|
||||
};
|
||||
//index template detail example
|
||||
// {
|
||||
// ".ml-state" : {
|
||||
// "order" : 0,
|
||||
// "version" : 7090199,
|
||||
// "index_patterns" : [
|
||||
// ".ml-state*"
|
||||
// ],
|
||||
// "settings" : {
|
||||
// "index" : {
|
||||
// "hidden" : "true",
|
||||
// "lifecycle" : {
|
||||
// "name" : "ml-size-based-ilm-policy",
|
||||
// "rollover_alias" : ".ml-state-write"
|
||||
// },
|
||||
// "auto_expand_replicas" : "0-1"
|
||||
// }
|
||||
// },
|
||||
// "mappings" : {
|
||||
// "_meta" : {
|
||||
// "version" : "7090199"
|
||||
// },
|
||||
// "enabled" : false
|
||||
// },
|
||||
// "aliases" : { }
|
||||
// }
|
||||
// }
|
||||
datasource = `
|
||||
[
|
||||
{
|
||||
"name" : "filebeat-7.9.1",
|
||||
"index_patterns" : "[filebeat-7.9.1-*]",
|
||||
"order" : "1",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "验收标准",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : "apm-7.9.1-span",
|
||||
"index_patterns" : "[apm-7.9.1-span*]",
|
||||
"order" : "2",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "桥梁施工技术规范",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "路规",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "遂规",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : ".lists-default",
|
||||
"index_patterns" : "[.lists-default-*]",
|
||||
"order" : "0",
|
||||
"version" : null,
|
||||
"composed_of" : ""
|
||||
"keyword" : "铁路技术管理规则",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},{
|
||||
"keyword" : "行车组织规则",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
},
|
||||
{
|
||||
"name" : ".monitoring-es",
|
||||
"index_patterns" : "[.monitoring-es-7-*]",
|
||||
"order" : "0",
|
||||
"version" : "7000199",
|
||||
"composed_of" : ""
|
||||
},
|
||||
{
|
||||
"name" : ".monitoring-beats",
|
||||
"index_patterns" : "[.monitoring-beats-7-*]",
|
||||
"order" : "0",
|
||||
"version" : "7000199",
|
||||
"composed_of" : ""
|
||||
"keyword" : "铁路交通事故调查处理规则",
|
||||
"type" : "客运",
|
||||
"value": "keyun"
|
||||
}]`;
|
||||
|
||||
columns = [
|
||||
{
|
||||
title: '模板名称',
|
||||
dataIndex: 'name',
|
||||
title: '关键词名称',
|
||||
dataIndex: 'keyword',
|
||||
},
|
||||
{
|
||||
title: '模式',
|
||||
dataIndex: 'index_patterns',
|
||||
},
|
||||
{
|
||||
title: 'order',
|
||||
dataIndex: 'order'
|
||||
},
|
||||
{
|
||||
title: '版本',
|
||||
dataIndex: 'version'
|
||||
title: '关键词分类',
|
||||
dataIndex: 'type',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
render: (text, record) => (
|
||||
<Fragment>
|
||||
<a onClick={() => this.handleUpdateModalVisible(true, record)}>设置</a>
|
||||
<a onClick={() => this.handleUpdateModalVisible(true, record)}>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a onClick={() => {
|
||||
this.state.selectedRows.push(record);
|
||||
|
@ -350,9 +319,22 @@ class Professional extends PureComponent {
|
|||
return (
|
||||
<Form onSubmit={this.handleSearch} layout="inline">
|
||||
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
|
||||
<Col lg={6} md={12} sm={24}>
|
||||
<Form.Item label={fieldLabels.keyword_type}>
|
||||
{getFieldDecorator('keyword_type', {
|
||||
rules: [{ required: true, message: '请选择关键词类型' }],
|
||||
})(
|
||||
<Select placeholder="请选择关键词类型">
|
||||
<Option value="keyun">客运</Option>
|
||||
<Option value="huoyun">货运</Option>
|
||||
<Option value="xianlu">线路</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
<FormItem label="模板名称">
|
||||
{getFieldDecorator('name')(<Input placeholder="请输入" />)}
|
||||
<FormItem label="关键词">
|
||||
{getFieldDecorator('name')(<Input placeholder="请输入关键词" />)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col md={8} sm={24}>
|
||||
|
@ -397,7 +379,7 @@ class Professional extends PureComponent {
|
|||
<div className={styles.tableListForm}>{this.renderForm()}</div>
|
||||
<div className={styles.tableListOperator}>
|
||||
<Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>
|
||||
新建
|
||||
新增关键词
|
||||
</Button>
|
||||
{selectedRows.length > 0 && (
|
||||
<span>
|
||||
|
|
|
@ -1,175 +0,0 @@
|
|||
import React, {Component, Fragment} from 'react';
|
||||
import {connect} from 'dva';
|
||||
import {Card, Form, Input,Switch, 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.site_name'})} >
|
||||
{getFieldDecorator('site_name',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.site_name-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.global.domain'})} >
|
||||
{getFieldDecorator('domain',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.domain-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >)
|
||||
}
|
||||
</FormItem>
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.global.listen_addr'})} >
|
||||
{getFieldDecorator('listen_addr',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.listen_addr-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >)
|
||||
}
|
||||
</FormItem>
|
||||
<Form.Item label = {formatMessage({id: 'app.settings.global.is_tls'})}>
|
||||
{getFieldDecorator('isTLS', {
|
||||
initialValue: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.is_tls-message'}, {}),
|
||||
},
|
||||
],
|
||||
})(
|
||||
<Switch defaultChecked onChange={()=>{}} />
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.global.data_path'})} >
|
||||
{getFieldDecorator('work_dir',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.data_path-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
( < Input / >)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.global.log_path'})} >
|
||||
{getFieldDecorator('work_dir',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.log_path-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;
|
|
@ -1,305 +0,0 @@
|
|||
import React, {Component, Fragment} from 'react';
|
||||
import {connect} from 'dva';
|
||||
import {Card, Form, Input, Select,Switch, Button, message, Divider, Drawer, Descriptions} from 'antd';
|
||||
import { Table, Tag } from 'antd';
|
||||
import { Icon } 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});
|
||||
};
|
||||
|
||||
ssoSettings() {
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: text => <a>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
key: 'enabled',
|
||||
dataIndex: 'enabled',
|
||||
render: text => <Icon type="check-square" />,
|
||||
}, {
|
||||
title: '最后更新时间',
|
||||
key: 'modify_time',
|
||||
dataIndex: 'modify_time',
|
||||
}, {
|
||||
title: '创建时间',
|
||||
key: 'create_time',
|
||||
dataIndex: 'create_time',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a>删除</a>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const data = [
|
||||
{
|
||||
key: '1',
|
||||
name: 'github',
|
||||
type: "OAuth2",
|
||||
enabled: true,
|
||||
modify_time: "Mar 01, 2020",
|
||||
create_time: "Oct 19, 2019",
|
||||
},{
|
||||
key: '2',
|
||||
name: 'okta',
|
||||
type: "OAuth2",
|
||||
enabled: true,
|
||||
modify_time: "Mar 02, 2020",
|
||||
create_time: "Oct 29, 2019",
|
||||
},
|
||||
];
|
||||
return (<Table columns={columns} dataSource={data} />);
|
||||
}
|
||||
|
||||
userSettings() {
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: text => <a>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'user_name',
|
||||
key: 'user_name',
|
||||
},
|
||||
{
|
||||
title: '电子邮件地址',
|
||||
dataIndex: 'email',
|
||||
key: 'email',
|
||||
},
|
||||
{
|
||||
title: '已激活',
|
||||
key: 'enabled',
|
||||
dataIndex: 'enabled',
|
||||
render: text => <Icon type="check-square" />,
|
||||
}, {
|
||||
title: '管理员',
|
||||
key: 'is_admin',
|
||||
dataIndex: 'is_admin',
|
||||
render: (text, record) => {
|
||||
if (record.is_admin){
|
||||
return <Icon type="check-square" />
|
||||
}else{
|
||||
return <Icon type="border" />
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '创建时间',
|
||||
key: 'create_time',
|
||||
dataIndex: 'create_time',
|
||||
},{
|
||||
title: '上次登录',
|
||||
key: 'last_login_time',
|
||||
dataIndex: 'last_login_time',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a>删除</a>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const data = [
|
||||
{
|
||||
key: '1',
|
||||
user_name: 'admin',
|
||||
email: "admin@infini.ltd",
|
||||
enabled: true,
|
||||
is_admin: true,
|
||||
create_time: "Oct 19, 2019",
|
||||
last_login_time: "Mar 01, 2020",
|
||||
|
||||
}, {
|
||||
key: '2',
|
||||
user_name: 'user',
|
||||
email: "user@infini.ltd",
|
||||
enabled: true,
|
||||
is_admin: false,
|
||||
create_time: "Oct 19, 2019",
|
||||
last_login_time: "Mar 01, 2020",
|
||||
|
||||
},
|
||||
];
|
||||
return (<Table columns={columns} dataSource={data} />);
|
||||
}
|
||||
|
||||
generalSettings = () => {
|
||||
const {
|
||||
form: {getFieldDecorator},
|
||||
} = this.props;
|
||||
return (
|
||||
< div >
|
||||
< Row
|
||||
type = "flex"
|
||||
justify = "end" >
|
||||
< Col
|
||||
span = {16} >
|
||||
< div > < Form
|
||||
layout = "vertical"
|
||||
hideRequiredMark >
|
||||
|
||||
|
||||
<Form.Item label = {formatMessage({id: 'app.settings.security.auth2factor_enabled'})}>
|
||||
{getFieldDecorator('auth2factor_enabled', {
|
||||
initialValue: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.security.auth2factor_enabled-message'}, {}),
|
||||
},
|
||||
],
|
||||
})(
|
||||
<Switch defaultChecked onChange={()=>{}} />
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
< FormItem
|
||||
label = {formatMessage({id: 'app.settings.security.audit_enabled'})} >
|
||||
{getFieldDecorator('audit_enabled',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.security.audit_enabled-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(
|
||||
<Switch defaultChecked onChange={()=>{}} />
|
||||
)
|
||||
}
|
||||
</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 > {this.ssoSettings()}< /div>),
|
||||
tab3: ( < div > 角色管理 < /div>),
|
||||
tab4: ( < div > {this.userSettings()} < /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,74 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: text => <a>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
},
|
||||
{
|
||||
title: '消息日志',
|
||||
dataIndex: 'message',
|
||||
key: 'message',
|
||||
}, {
|
||||
title: '时间',
|
||||
key: 'time',
|
||||
dataIndex: 'time',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a>详情</a>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const data = [
|
||||
{
|
||||
key: '1',
|
||||
username: 'admin',
|
||||
enabled: true,
|
||||
message: "User Login Success",
|
||||
time: "Oct 19, 2019",
|
||||
|
||||
}, {
|
||||
key: '2',
|
||||
username: 'user',
|
||||
enabled: true,
|
||||
message: "User Login Failed",
|
||||
time: "Oct 19, 2019",
|
||||
},
|
||||
];
|
||||
|
||||
@connect()
|
||||
class Audit extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card><Table columns={columns} dataSource={data} /></Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Audit;
|
|
@ -0,0 +1,73 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
|
||||
@connect()
|
||||
class Base extends Component {
|
||||
handleTabChange = key => {
|
||||
const { match,children } = this.props;
|
||||
switch (key) {
|
||||
case 'overview':
|
||||
router.push(`${match.url}/overview`);
|
||||
break;
|
||||
case 'audit':
|
||||
router.push(`${match.url}/audit`);
|
||||
break;
|
||||
case 'query':
|
||||
router.push(`${match.url}/query`);
|
||||
break;
|
||||
case 'slow':
|
||||
router.push(`${match.url}/slow`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const tabList = [
|
||||
{
|
||||
key: 'overview',
|
||||
tab: '日志概要',
|
||||
},
|
||||
{
|
||||
key: 'audit',
|
||||
tab: '审计日志',
|
||||
},
|
||||
{
|
||||
key: 'query',
|
||||
tab: '查询日志',
|
||||
},
|
||||
{
|
||||
key: 'slow',
|
||||
tab: '慢日志',
|
||||
}
|
||||
];
|
||||
|
||||
const { match, children, location } = this.props;
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper
|
||||
tabList={tabList}
|
||||
tabActiveKey={location.pathname.replace(`${match.path}/`, '')}
|
||||
onTabChange={this.handleTabChange}
|
||||
>
|
||||
{children}
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Base;
|
|
@ -0,0 +1,26 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
@connect()
|
||||
class Overview extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card>Overview</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Overview;
|
|
@ -0,0 +1,80 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
|
||||
@connect()
|
||||
class Base extends Component {
|
||||
handleTabChange = key => {
|
||||
const { match,children } = this.props;
|
||||
switch (key) {
|
||||
case 'general':
|
||||
router.push(`${match.url}/general`);
|
||||
break;
|
||||
case 'sso':
|
||||
router.push(`${match.url}/sso`);
|
||||
break;
|
||||
case 'roles':
|
||||
router.push(`${match.url}/roles`);
|
||||
break;
|
||||
case 'users':
|
||||
router.push(`${match.url}/users`);
|
||||
break;
|
||||
case 'certs':
|
||||
router.push(`${match.url}/certs`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const tabList = [
|
||||
{
|
||||
key: 'general',
|
||||
tab: '基础设置',
|
||||
},
|
||||
{
|
||||
key: 'sso',
|
||||
tab: '单点登录',
|
||||
},
|
||||
{
|
||||
key: 'roles',
|
||||
tab: '角色管理',
|
||||
},
|
||||
{
|
||||
key: 'users',
|
||||
tab: '用户管理',
|
||||
},
|
||||
{
|
||||
key: 'certs',
|
||||
tab: '证书管理',
|
||||
}
|
||||
];
|
||||
|
||||
const { match, children, location } = this.props;
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper
|
||||
tabList={tabList}
|
||||
tabActiveKey={location.pathname.replace(`${match.path}/`, '')}
|
||||
onTabChange={this.handleTabChange}
|
||||
>
|
||||
{children}
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Base;
|
|
@ -0,0 +1,26 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
@connect()
|
||||
class Certs extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card>Certs</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Certs;
|
|
@ -0,0 +1,88 @@
|
|||
import {formatMessage, FormattedMessage} from 'umi/locale';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
import {connect} from 'dva';
|
||||
import {Card, Form, Input, Select,Switch, Button,Row, message,Col, Divider, Drawer, Descriptions} from 'antd';
|
||||
import { Table, Tag } from 'antd';
|
||||
import { Icon } from 'antd';
|
||||
|
||||
import router from 'umi/router';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
import styles from './General.less';
|
||||
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
@connect()
|
||||
class General extends Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
form: {getFieldDecorator},
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<div>
|
||||
<Row
|
||||
type = "flex"
|
||||
justify = "end" >
|
||||
<Col
|
||||
span = {16} >
|
||||
<div>
|
||||
<Form layout = "vertical"
|
||||
hideRequiredMark >
|
||||
|
||||
|
||||
<Form.Item label = {formatMessage({id: 'app.settings.security.auth2factor_enabled'})}>
|
||||
{getFieldDecorator('auth2factor_enabled', {
|
||||
initialValue: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.security.auth2factor_enabled-message'}, {}),
|
||||
},
|
||||
],
|
||||
})(
|
||||
<Switch defaultChecked onChange={()=>{}} />
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<FormItem label = {formatMessage({id: 'app.settings.security.audit_enabled'})} >
|
||||
{getFieldDecorator('audit_enabled',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.security.audit_enabled-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(
|
||||
<Switch defaultChecked onChange={()=>{}} />
|
||||
)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
|
||||
<Button
|
||||
type = "primary" >
|
||||
<FormattedMessage
|
||||
id = "app.settings.security.update"
|
||||
defaultMessage = "Update Setting" />
|
||||
</Button>
|
||||
</Form>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span = {8} ></Col>
|
||||
</Row>
|
||||
</div></Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Form.create()(General);
|
|
@ -0,0 +1,26 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
@connect()
|
||||
class Roles extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card>Roles</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Roles;
|
|
@ -0,0 +1,87 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: text => <a>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
key: 'enabled',
|
||||
dataIndex: 'enabled',
|
||||
render: text => <Icon type="check-square" />,
|
||||
}, {
|
||||
title: '最后更新时间',
|
||||
key: 'modify_time',
|
||||
dataIndex: 'modify_time',
|
||||
}, {
|
||||
title: '创建时间',
|
||||
key: 'create_time',
|
||||
dataIndex: 'create_time',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a>删除</a>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const data = [
|
||||
{
|
||||
key: '1',
|
||||
name: 'github',
|
||||
type: "OAuth2",
|
||||
enabled: true,
|
||||
modify_time: "Mar 01, 2020",
|
||||
create_time: "Oct 19, 2019",
|
||||
},{
|
||||
key: '2',
|
||||
name: 'okta',
|
||||
type: "OAuth2",
|
||||
enabled: true,
|
||||
modify_time: "Mar 02, 2020",
|
||||
create_time: "Oct 29, 2019",
|
||||
},
|
||||
];
|
||||
|
||||
@connect()
|
||||
class SSO extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card><Table columns={columns} dataSource={data} /></Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SSO;
|
|
@ -0,0 +1,102 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
render: text => <a>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'user_name',
|
||||
key: 'user_name',
|
||||
},
|
||||
{
|
||||
title: '电子邮件地址',
|
||||
dataIndex: 'email',
|
||||
key: 'email',
|
||||
},
|
||||
{
|
||||
title: '已激活',
|
||||
key: 'enabled',
|
||||
dataIndex: 'enabled',
|
||||
render: text => <Icon type="check-square" />,
|
||||
}, {
|
||||
title: '管理员',
|
||||
key: 'is_admin',
|
||||
dataIndex: 'is_admin',
|
||||
render: (text, record) => {
|
||||
if (record.is_admin){
|
||||
return <Icon type="check-square" />
|
||||
}else{
|
||||
return <Icon type="border" />
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '创建时间',
|
||||
key: 'create_time',
|
||||
dataIndex: 'create_time',
|
||||
},{
|
||||
title: '上次登录',
|
||||
key: 'last_login_time',
|
||||
dataIndex: 'last_login_time',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a>修改</a>
|
||||
<Divider type="vertical" />
|
||||
<a>删除</a>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const data = [
|
||||
{
|
||||
key: '1',
|
||||
user_name: 'admin',
|
||||
email: "admin@infini.ltd",
|
||||
enabled: true,
|
||||
is_admin: true,
|
||||
create_time: "Oct 19, 2019",
|
||||
last_login_time: "Mar 01, 2020",
|
||||
|
||||
}, {
|
||||
key: '2',
|
||||
user_name: 'user',
|
||||
email: "user@infini.ltd",
|
||||
enabled: true,
|
||||
is_admin: false,
|
||||
create_time: "Oct 19, 2019",
|
||||
last_login_time: "Mar 01, 2020",
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
@connect()
|
||||
class Users extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card><Table columns={columns} dataSource={data} /></Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Users;
|
|
@ -0,0 +1,59 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
|
||||
@connect()
|
||||
class Base extends Component {
|
||||
handleTabChange = key => {
|
||||
const { match,children } = this.props;
|
||||
switch (key) {
|
||||
case 'global':
|
||||
router.push(`${match.url}/global`);
|
||||
break;
|
||||
case 'gateway':
|
||||
router.push(`${match.url}/gateway`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const tabList = [
|
||||
{
|
||||
key: 'global',
|
||||
tab: '全局设置',
|
||||
},
|
||||
{
|
||||
key: 'gateway',
|
||||
tab: '网关设置',
|
||||
},
|
||||
];
|
||||
|
||||
const { match, children, location } = this.props;
|
||||
|
||||
return (
|
||||
<PageHeaderWrapper
|
||||
tabList={tabList}
|
||||
tabActiveKey={location.pathname.replace(`${match.path}/`, '')}
|
||||
onTabChange={this.handleTabChange}
|
||||
>
|
||||
{children}
|
||||
</PageHeaderWrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Base;
|
|
@ -0,0 +1,25 @@
|
|||
import router from 'umi/router';
|
||||
import { connect } from 'dva';
|
||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||
|
||||
import React, {Component, Fragment} from 'react';
|
||||
|
||||
import {Col, Divider,Card, Form, Icon, Input, Row, Select, Table} from 'antd';
|
||||
import {formatMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
@connect()
|
||||
class Gateway extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card>Gateway</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Gateway;
|
|
@ -0,0 +1,139 @@
|
|||
import React, {Component, Fragment} from 'react';
|
||||
import {Button, Card, Col, Form, Input, Row, Select, Switch} from 'antd';
|
||||
import {formatMessage, FormattedMessage} from 'umi/locale';
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
const FormItem = Form.Item;
|
||||
const {TextArea} = Input;
|
||||
|
||||
@Form.create()
|
||||
class Global extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
form: {getFieldDecorator},
|
||||
} = this.props;
|
||||
return (
|
||||
<Card>
|
||||
<Row
|
||||
type="flex"
|
||||
justify="end">
|
||||
<Col
|
||||
span={16}>
|
||||
<div><Form
|
||||
layout="vertical"
|
||||
hideRequiredMark>
|
||||
|
||||
<FormItem
|
||||
label={formatMessage({id: 'app.settings.global.site_name'})}>
|
||||
{getFieldDecorator('site_name',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.site_name-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(<Input/>)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={formatMessage({id: 'app.settings.global.domain'})}>
|
||||
{getFieldDecorator('domain',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.domain-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(<Input/>)
|
||||
}
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label={formatMessage({id: 'app.settings.global.listen_addr'})}>
|
||||
{getFieldDecorator('listen_addr',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.listen_addr-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(<Input/>)
|
||||
}
|
||||
</FormItem>
|
||||
<Form.Item label={formatMessage({id: 'app.settings.global.is_tls'})}>
|
||||
{getFieldDecorator('isTLS', {
|
||||
initialValue: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.is_tls-message'}, {}),
|
||||
},
|
||||
],
|
||||
})(
|
||||
<Switch defaultChecked onChange={() => {
|
||||
}}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<FormItem
|
||||
label={formatMessage({id: 'app.settings.global.data_path'})}>
|
||||
{getFieldDecorator('work_dir',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.data_path-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(<Input/>)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={formatMessage({id: 'app.settings.global.log_path'})}>
|
||||
{getFieldDecorator('work_dir',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: formatMessage({id: 'app.settings.global.log_path-message'}, {}),
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
(<Input/>)
|
||||
}
|
||||
</FormItem>
|
||||
|
||||
|
||||
<Button type="primary">
|
||||
<FormattedMessage
|
||||
id="app.settings.global.update"
|
||||
defaultMessage="Update Setting"/> </Button>
|
||||
</Form></div>
|
||||
</Col>
|
||||
<Col span={8}></Col>
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Global;
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>INFINI</title>
|
||||
<link rel="icon" href="/public/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue