diff --git a/LICENSE b/LICENSE
index d5bfd919..04544e21 100644
--- a/LICENSE
+++ b/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:
@@ -35,4 +35,4 @@ This EULA agreement is effective from the date you first use the Software and sh
It will also terminate immediately if you fail to comply with any term of this EULA agreement. Upon such termination, the licenses granted by this EULA agreement will immediately terminate and you agree to stop all access and use of the Software. The provisions that by their nature continue and survive will survive any termination of this EULA agreement.
Governing Law
-This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of cn.
\ No newline at end of file
+This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of cn.
diff --git a/main.go b/main.go
index 737d3a6f..8b1c6221 100644
--- a/main.go
+++ b/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")
diff --git a/search-center.yml b/search-center.yml
index d0e77c7f..e026a2d9 100644
--- a/search-center.yml
+++ b/search-center.yml
@@ -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:
diff --git a/ui.go b/ui.go
index 9f2c7d13..7d6b5f32 100644
--- a/ui.go
+++ b/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")
diff --git a/web/config/router.config.js b/web/config/router.config.js
index 9ae058ed..faf8c20d 100644
--- a/web/config/router.config.js
+++ b/web/config/router.config.js
@@ -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',
+ path: '/system/settings',
+ name: 'settings',
+ component: './System/Settings/Base',
+ hideChildrenInMenu: true,
+ routes: [
+ {
+ path: '/system/settings',
+ redirect: '/system/settings/global',
+ },
+ {
+ path: '/system/settings/global',
+ component: './System/Settings/Global',
+ }, {
+ path: '/system/settings/gateway',
+ component: './System/Settings/Gateway',
+ },
+ ]
+ },
+ {
+ path: '/system/security',
name: 'security',
+ component: './System/Security/Base',
hideChildrenInMenu: true,
routes: [
{
- path: '/settings/security',
- name: 'security',
- component: './Settings/Security/General',
+ path: '/system/security',
+ redirect: '/system/security/general',
+ },
+ {
+ path: '/system/security/general',
+ component: './System/Security/General',
}, {
- path: '/settings/security/general',
- name: 'general',
- component: './Forms/BasicForm',
+ 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',
+ },
+ ]
},
]
},
diff --git a/web/src/components/SiderMenu/index.less b/web/src/components/SiderMenu/index.less
index 082b445d..58d3fb02 100644
--- a/web/src/components/SiderMenu/index.less
+++ b/web/src/components/SiderMenu/index.less
@@ -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;
}
diff --git a/web/src/components/TopNavHeader/index.js b/web/src/components/TopNavHeader/index.js
index e89dbd61..ed1da50b 100644
--- a/web/src/components/TopNavHeader/index.js
+++ b/web/src/components/TopNavHeader/index.js
@@ -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 {
-
Logging Center
+
{formatMessage({ id: 'app.setting.appname' })}
{
+ Modal.confirm({
+ title: '删除Pipeline',
+ content: '确定删除该Pipeline吗?',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: () => this.deleteItem(),
+ });
+ };
+ deleteItem = ()=>{
const { dispatch } = this.props;
const { selectedRows } = this.state;
if (!selectedRows) return;
- dispatch({
- type: 'pipeline/delete',
- payload: {
- key: selectedRows.map(row => row.name),
- },
- callback: () => {
- this.setState({
- selectedRows: [],
- });
- },
+ dispatch({
+ type: 'pipeline/delete',
+ payload: {
+ key: selectedRows.map(row => row.name),
+ },
+ callback: () => {
+ this.setState({
+ selectedRows: [],
});
+ },
+ });
};
handleSelectRows = rows => {
diff --git a/web/src/pages/DataManagement/LogstashConfig.js b/web/src/pages/DataManagement/LogstashConfig.js
index 2b67b5fa..5fb9c703 100644
--- a/web/src/pages/DataManagement/LogstashConfig.js
+++ b/web/src/pages/DataManagement/LogstashConfig.js
@@ -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');
@@ -65,6 +91,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;
@@ -92,7 +140,7 @@ class LogstashConfig extends Component {
};
const contentList = {
tab1: (
-
+
+
+ {form.getFieldDecorator('name', {
+ rules: [{ required: true }],
+ })( )}
+
+
+ {form.getFieldDecorator('snapshot', {
+ rules: [{ required: true }],
+ })( )}
+
+
+ {form.getFieldDecorator('repo', {
+ rules: [{ required: true }],
+ })(
+
+
+ my_local_repo
+
+
+ my_remote_repo
+
+
+ )}
+
+
+ {form.getFieldDecorator('frequency', {
+ rules: [{ required: true }],
+ })(
+
+
+ 每天
+
+
+ 每月
+
+
+ )}
+
+
+ {form.getFieldDecorator('time', {
+ rules: [{ required: true }],
+ })(
+
+ )}
+
+
+ );
+ break;
+ case 1:
+ retDom = (
+
+
+ {form.getFieldDecorator('indices', {
+ initialValue: true,
+ })(
+
+ )}
+
+
+ {form.getFieldDecorator('unavaiable', {
+ initialValue: false,
+ })(
+
+ )}
+
+
+ {form.getFieldDecorator('partial', {
+ // initialValue: true,
+ })(
+
+ )}
+
+
+ {form.getFieldDecorator('global', {
+ initialValue: true,
+ })(
+
+ )}
+
+
+ );
+ 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 (
+
+
+
+
+
+
+
+
+ {this.renderStep()}
+
+ this.backward(currentStep)}>
+ 上一步
+
+ this.handleNext(currentStep)}>
+ 下一步
+
+ {}}>
+ 取消
+
+
+
+ )
+ }
+}
/* eslint react/no-multi-comp:0 */
@connect(({ pipeline, loading }) => ({
@@ -296,7 +408,7 @@ class BakCycle extends PureComponent {
-
+
{getFieldDecorator('name')( )}
@@ -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 {
{this.renderForm()}
- this.handleModalVisible(true)}>
+ this.handleNewClick(true)}>
新建
{selectedRows.length > 0 && (
@@ -359,14 +482,6 @@ class BakCycle extends PureComponent {
/>
-
- {updateFormValues && Object.keys(updateFormValues).length ? (
-
- ) : null}
- Some contents...
- Some contents...
- Some contents...
-
+
+
);
}
diff --git a/web/src/pages/SearchManage/dict/Common.js b/web/src/pages/SearchManage/dict/Common.js
index 530ea6b5..cfb54e0a 100644
--- a/web/src/pages/SearchManage/dict/Common.js
+++ b/web/src/pages/SearchManage/dict/Common.js
@@ -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,413 +23,409 @@ 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 = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleAdd(fieldsValue);
- });
- };
- return (
-
handleModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
- })( )}
-
-
- {form.getFieldDecorator('settings', {
- rules: [{ required: true }],
- })( )}
-
+ const { modalVisible, form, handleAdd, handleModalVisible } = props;
+ const okHandle = () => {
+ form.validateFields((err, fieldsValue) => {
+ if (err) return;
+ form.resetFields();
+ handleAdd(fieldsValue);
+ });
+ };
+ return (
+ handleModalVisible()}>
+
+ {form.getFieldDecorator('name', {
+ rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
+ })( )}
+
+
+ {form.getFieldDecorator('keyword_type', {
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 敏感词
+ 提示词
+ 同义词
+ 过滤词
+ 停用词
+ 保留词
+ 纠错词
+ 相关搜索
+ 热点词管理
+
+ )}
+
- );
+);
});
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);
+ if (err) return;
+ form.resetFields();
+ handleUpdate(fieldsValue);
});
- };
-
- return (
- handleUpdateModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- initialValue: values.name,
- rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
- })( )}
+};
+
+return (
+ handleUpdateModalVisible()}>
+
+
+ {form.getFieldDecorator('keyword', {
+ initialValue: values.keyword,
+ rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
+ })( )}
-
- {form.getFieldDecorator('settings', {
- initialValue: values.processors,
- rules: [{ required: true }],
- })( )}
-
-
- );
-});
+
+
+ {form.getFieldDecorator('keyword_type', {
+ initialValue: values.value,
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 敏感词
+ 提示词
+ 同义词
+ 过滤词
+ 停用词
+ 保留词
+ 纠错词
+ 相关搜索
+ 热点词管理
+
+ )}
+
+
+ );
+ });
/* eslint react/no-multi-comp:0 */
@connect(({ pipeline, loading }) => ({
- pipeline,
- loading: loading.models.pipeline,
+ pipeline,
+ loading: loading.models.pipeline,
}))
@Form.create()
class Common extends PureComponent {
- state = {
- modalVisible: false,
- updateModalVisible: false,
- expandForm: false,
- selectedRows: [],
- 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" : ""
- },
- {
- "name" : "apm-7.9.1-span",
- "index_patterns" : "[apm-7.9.1-span*]",
- "order" : "2",
- "version" : null,
- "composed_of" : ""
- },
- {
- "name" : ".lists-default",
- "index_patterns" : "[.lists-default-*]",
- "order" : "0",
- "version" : null,
- "composed_of" : ""
- },
- {
- "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" : ""
- }]`;
+ state = {
+ modalVisible: false,
+ updateModalVisible: false,
+ expandForm: false,
+ selectedRows: [],
+ formValues: {},
+ updateFormValues: {},
+ };
+ datasource = `
+ [
+ {
+ "keyword" : "验收标准",
+ "type" : "停用词",
+ "value": "keyun"
+ },
+ {
+ "keyword" : "桥梁施工技术规范",
+ "type" : "停用词",
+ "value": "keyun"
+ },{
+ "keyword" : "路规",
+ "type" : "停用词",
+ "value": "keyun"
+ },{
+ "keyword" : "遂规",
+ "type" : "热点词",
+ "value": "keyun"
+ },
+ {
+ "keyword" : "铁路技术管理规则",
+ "type" : "热点词",
+ "value": "keyun"
+ },{
+ "keyword" : "行车组织规则",
+ "type" : "热点词",
+ "value": "keyun"
+ },
+ {
+ "keyword" : "铁路交通事故调查处理规则",
+ "type" : "热点词",
+ "value": "keyun"
+ }]`;
- columns = [
- {
- title: '模板名称',
- dataIndex: 'name',
- },
- {
- title: '模式',
- dataIndex: 'index_patterns',
- },
- {
- title: 'order',
- dataIndex: 'order'
- },
- {
- title: '版本',
- dataIndex: 'version'
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleUpdateModalVisible(true, record)}>设置
-
- {
- this.state.selectedRows.push(record);
- this.handleDeleteClick();
- }}>删除
-
- ),
- },
- ];
+ columns = [
+ {
+ title: '关键词名称',
+ dataIndex: 'keyword',
+ },
+ {
+ title: '关键词分类',
+ dataIndex: 'type',
+ },
+ {
+ title: '操作',
+ render: (text, record) => (
+
+ this.handleUpdateModalVisible(true, record)}>修改
+
+ {
+ this.state.selectedRows.push(record);
+ this.handleDeleteClick();
+}}>删除
+
+),
+},
+];
- 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;
const filters = Object.keys(filtersArg).reduce((obj, key) => {
- const newObj = { ...obj };
- newObj[key] = getValue(filtersArg[key]);
- return newObj;
+ const newObj = { ...obj };
+ newObj[key] = getValue(filtersArg[key]);
+ return newObj;
}, {});
const params = {
- currentPage: pagination.current,
- pageSize: pagination.pageSize,
- ...formValues,
- ...filters,
+ currentPage: pagination.current,
+ pageSize: pagination.pageSize,
+ ...formValues,
+ ...filters,
};
if (sorter.field) {
- params.sorter = `${sorter.field}_${sorter.order}`;
+ params.sorter = `${sorter.field}_${sorter.order}`;
}
dispatch({
- type: 'pipeline/fetch',
- payload: params,
+ type: 'pipeline/fetch',
+ payload: params,
});
- };
+};
- handleFormReset = () => {
+handleFormReset = () => {
const { form, dispatch } = this.props;
form.resetFields();
this.setState({
- formValues: {},
+ formValues: {},
});
dispatch({
- type: 'pipeline/fetch',
- payload: {},
+ type: 'pipeline/fetch',
+ payload: {},
});
- };
+};
- handleDeleteClick = e => {
+handleDeleteClick = e => {
const { dispatch } = this.props;
const { selectedRows } = this.state;
if (!selectedRows) return;
- dispatch({
- type: 'pipeline/delete',
- payload: {
+ dispatch({
+ type: 'pipeline/delete',
+ payload: {
key: selectedRows.map(row => row.name),
- },
- callback: () => {
+ },
+ callback: () => {
this.setState({
- selectedRows: [],
+ selectedRows: [],
});
- },
- });
- };
-
- handleSelectRows = rows => {
- this.setState({
- selectedRows: rows,
+ },
});
- };
+};
- handleSearch = e => {
+handleSelectRows = rows => {
+ this.setState({
+ selectedRows: rows,
+ });
+};
+
+handleSearch = e => {
e.preventDefault();
const { dispatch, form } = this.props;
form.validateFields((err, fieldsValue) => {
- if (err) return;
+ if (err) return;
- const values = {
- ...fieldsValue,
- updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf(),
- };
+ const values = {
+ ...fieldsValue,
+ updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf(),
+ };
- this.setState({
- formValues: values,
- });
+ this.setState({
+ formValues: values,
+ });
- dispatch({
- type: 'rule/fetch',
- payload: values,
- });
+ dispatch({
+ type: 'rule/fetch',
+ payload: values,
+ });
});
- };
+};
- handleModalVisible = flag => {
+handleModalVisible = flag => {
this.setState({
- modalVisible: !!flag,
+ modalVisible: !!flag,
});
- };
+};
- handleUpdateModalVisible = (flag, record) => {
+handleUpdateModalVisible = (flag, record) => {
this.setState({
- updateModalVisible: !!flag,
- updateFormValues: record || {},
+ updateModalVisible: !!flag,
+ updateFormValues: record || {},
});
- };
+};
- handleAdd = fields => {
+handleAdd = fields => {
const { dispatch } = this.props;
dispatch({
- type: 'pipeline/add',
- payload: {
- name: fields.name,
- desc: fields.desc,
- processors: fields.processors,
- },
+ type: 'pipeline/add',
+ payload: {
+ name: fields.name,
+ desc: fields.desc,
+ processors: fields.processors,
+ },
});
message.success('添加成功');
this.handleModalVisible();
- };
+};
- handleUpdate = fields => {
+handleUpdate = fields => {
const { dispatch } = this.props;
dispatch({
- type: 'pipeline/update',
- payload: {
- name: fields.name,
- desc: fields.desc,
- processors: fields.processors,
- },
+ type: 'pipeline/update',
+ payload: {
+ name: fields.name,
+ desc: fields.desc,
+ processors: fields.processors,
+ },
});
message.success('修改成功');
this.handleUpdateModalVisible();
- };
+};
- renderSimpleForm() {
+renderSimpleForm() {
const {
- form: { getFieldDecorator },
+ form: { getFieldDecorator },
} = this.props;
return (
-
+
-
-
- {getFieldDecorator('name')( )}
-
-
-
-
-
+
+
+ {getFieldDecorator('keyword_type', {
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 敏感词
+ 提示词
+ 同义词
+ 过滤词
+ 停用词
+ 保留词
+ 纠错词
+ 相关搜索
+ 热点词管理
+
+ )}
+
+
+
+
+ {getFieldDecorator('name')( )}
+
+
+
+
+
查询
-
-
- 重置
-
-
-
-
-
- );
- }
+
+
+ 重置
+
+
+
+
+
+);
+}
- renderForm() {
+renderForm() {
return this.renderSimpleForm();
- }
+}
- render() {
+render() {
const data = {
- list: JSON.parse(this.datasource),
- pagination: {
- pageSize: 5,
- },
+ list: JSON.parse(this.datasource),
+ pagination: {
+ pageSize: 5,
+ },
};
const { selectedRows, modalVisible, updateModalVisible, updateFormValues } = this.state;
const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
+ handleAdd: this.handleAdd,
+ handleModalVisible: this.handleModalVisible,
};
const updateMethods = {
- handleUpdateModalVisible: this.handleUpdateModalVisible,
- handleUpdate: this.handleUpdate,
+ handleUpdateModalVisible: this.handleUpdateModalVisible,
+ handleUpdate: this.handleUpdate,
};
return (
-
+
-
-
{this.renderForm()}
+
+
{this.renderForm()}
- this.handleModalVisible(true)}>
- 新建
-
- {selectedRows.length > 0 && (
-
- this.handleDeleteClick()}>删除
-
- )}
-
+
this.handleModalVisible(true)}>
+ 新增关键词
+
+ {selectedRows.length > 0 && (
+
+ this.handleDeleteClick()}>删除
+
+ )}
+
-
-
-
- {updateFormValues && Object.keys(updateFormValues).length ? (
-
- ) : null}
-
- );
- }
+
+
+
+ {updateFormValues && Object.keys(updateFormValues).length ? (
+
+ ) : null}
+
+ );
+ }
}
-
export default Common;
diff --git a/web/src/pages/SearchManage/dict/Professional.js b/web/src/pages/SearchManage/dict/Professional.js
index 8be3b880..f8f20c6c 100644
--- a/web/src/pages/SearchManage/dict/Professional.js
+++ b/web/src/pages/SearchManage/dict/Professional.js
@@ -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,81 +23,83 @@ 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 = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleAdd(fieldsValue);
- });
- };
- return (
- handleModalVisible()}
- >
-
+ const { modalVisible, form, handleAdd, handleModalVisible } = props;
+ const okHandle = () => {
+ form.validateFields((err, fieldsValue) => {
+ if (err) return;
+ form.resetFields();
+ handleAdd(fieldsValue);
+ });
+ };
+ return (
+ handleModalVisible()}>
+
{form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
- })( )}
-
-
- {form.getFieldDecorator('settings', {
- rules: [{ required: true }],
- })( )}
-
+ rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
+ })( )}
+
+
+ {form.getFieldDecorator('keyword_type', {
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 客运
+ 货运
+ 线路
+
+)}
+
- );
+);
});
const UpdateForm = Form.create()(props => {
- const { updateModalVisible, handleUpdateModalVisible, handleUpdate,values,form } = props;
+ const { updateModalVisible, handleUpdateModalVisible, handleUpdate,values,form } = props;
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleUpdate(fieldsValue);
- });
- };
-
- return (
- handleUpdateModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- initialValue: values.name,
- rules: [{ required: true, message: '请输入至少五个字符的名称!', min: 5 }],
- })( )}
-
-
- {form.getFieldDecorator('settings', {
- initialValue: values.processors,
- rules: [{ required: true }],
- })( )}
-
+ const okHandle = () => {
+ form.validateFields((err, fieldsValue) => {
+ if (err) return;
+ form.resetFields();
+ handleUpdate(fieldsValue);
+ });
+ };
+
+ return (
+ handleUpdateModalVisible()}>
+
+
+ {form.getFieldDecorator('keyword', {
+ initialValue: values.keyword,
+ rules: [{ required: true, message: '请输入至少一个字符的名称!', min: 1 }],
+ })( )}
+
+
+
+ {form.getFieldDecorator('keyword_type', {
+ initialValue: values.value,
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 客运
+ 货运
+ 线路
+
+ )}
+
- );
+);
});
/* 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) => (
- this.handleUpdateModalVisible(true, record)}>设置
+ this.handleUpdateModalVisible(true, record)}>修改
{
this.state.selectedRows.push(record);
@@ -350,9 +319,22 @@ class Professional extends PureComponent {
return (
+
+
+ {getFieldDecorator('keyword_type', {
+ rules: [{ required: true, message: '请选择关键词类型' }],
+ })(
+
+ 客运
+ 货运
+ 线路
+
+ )}
+
+
-
- {getFieldDecorator('name')( )}
+
+ {getFieldDecorator('name')( )}
@@ -397,7 +379,7 @@ class Professional extends PureComponent {
{this.renderForm()}
this.handleModalVisible(true)}>
- 新建
+ 新增关键词
{selectedRows.length > 0 && (
diff --git a/web/src/pages/Settings/Global/Global.js b/web/src/pages/Settings/Global/Global.js
deleted file mode 100644
index 0a831963..00000000
--- a/web/src/pages/Settings/Global/Global.js
+++ /dev/null
@@ -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
- label = {formatMessage({id: 'app.settings.global.domain'})} >
- {getFieldDecorator('domain',
- {
- rules: [
- {
- required: true,
- message: formatMessage({id: 'app.settings.global.domain-message'}, {}),
- },
- ],
- }
- )
- ( < Input / >)
- }
-
- < 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 / >)
- }
-
-
- {getFieldDecorator('isTLS', {
- initialValue: true,
- rules: [
- {
- required: true,
- message: formatMessage({id: 'app.settings.global.is_tls-message'}, {}),
- },
- ],
- })(
- {}} />
- )}
-
-
-
- < 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
- label = {formatMessage({id: 'app.settings.global.log_path'})} >
- {getFieldDecorator('work_dir',
- {
- rules: [
- {
- required: true,
- message: formatMessage({id: 'app.settings.global.log_path-message'}, {}),
- },
- ],
- }
- )
- ( < Input / >)
- }
-
-
-
- < Button type = "primary" >
- < FormattedMessage
- id = "app.settings.global.update"
- defaultMessage = "Update Setting" />
- < /Form>
- < /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;
diff --git a/web/src/pages/Settings/Security/General.js b/web/src/pages/Settings/Security/General.js
deleted file mode 100644
index 5840d66e..00000000
--- a/web/src/pages/Settings/Security/General.js
+++ /dev/null
@@ -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 => {text} ,
- },
- {
- title: '名称',
- dataIndex: 'name',
- key: 'name',
- },
- {
- title: '类型',
- dataIndex: 'type',
- key: 'type',
- },
- {
- title: '启用',
- key: 'enabled',
- dataIndex: 'enabled',
- render: text => ,
- }, {
- title: '最后更新时间',
- key: 'modify_time',
- dataIndex: 'modify_time',
- }, {
- title: '创建时间',
- key: 'create_time',
- dataIndex: 'create_time',
- },
- {
- title: '操作',
- key: 'action',
- render: (text, record) => (
-
- 修改
-
- 删除
-
- ),
- },
- ];
-
- 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 ();
- }
-
- userSettings() {
- const columns = [
- {
- title: 'ID',
- dataIndex: 'key',
- key: 'key',
- render: text => {text} ,
- },
- {
- title: '用户名',
- dataIndex: 'user_name',
- key: 'user_name',
- },
- {
- title: '电子邮件地址',
- dataIndex: 'email',
- key: 'email',
- },
- {
- title: '已激活',
- key: 'enabled',
- dataIndex: 'enabled',
- render: text => ,
- }, {
- title: '管理员',
- key: 'is_admin',
- dataIndex: 'is_admin',
- render: (text, record) => {
- if (record.is_admin){
- return
- }else{
- return
- }
- },
- }, {
- title: '创建时间',
- key: 'create_time',
- dataIndex: 'create_time',
- },{
- title: '上次登录',
- key: 'last_login_time',
- dataIndex: 'last_login_time',
- },
- {
- title: '操作',
- key: 'action',
- render: (text, record) => (
-
- 修改
-
- 删除
-
- ),
- },
- ];
-
- 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 ();
- }
-
- generalSettings = () => {
- const {
- form: {getFieldDecorator},
- } = this.props;
- return (
- < div >
- < Row
- type = "flex"
- justify = "end" >
- < Col
- span = {16} >
- < div > < Form
- layout = "vertical"
- hideRequiredMark >
-
-
-
- {getFieldDecorator('auth2factor_enabled', {
- initialValue: true,
- rules: [
- {
- required: true,
- message: formatMessage({id: 'app.settings.security.auth2factor_enabled-message'}, {}),
- },
- ],
- })(
- {}} />
- )}
-
-
- < FormItem
- label = {formatMessage({id: 'app.settings.security.audit_enabled'})} >
- {getFieldDecorator('audit_enabled',
- {
- rules: [
- {
- required: true,
- message: formatMessage({id: 'app.settings.security.audit_enabled-message'}, {}),
- },
- ],
- }
- )
- (
- {}} />
- )
- }
-
-
-
- < 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;
diff --git a/web/src/pages/System/Logs/Audit.js b/web/src/pages/System/Logs/Audit.js
new file mode 100644
index 00000000..2202238d
--- /dev/null
+++ b/web/src/pages/System/Logs/Audit.js
@@ -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 => {text} ,
+ },
+ {
+ title: '用户名',
+ dataIndex: 'username',
+ key: 'username',
+ },
+ {
+ title: '消息日志',
+ dataIndex: 'message',
+ key: 'message',
+ }, {
+ title: '时间',
+ key: 'time',
+ dataIndex: 'time',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+ 详情
+
+ ),
+ },
+];
+
+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 (
+
+ );
+ }
+}
+
+export default Audit;
diff --git a/web/src/pages/System/Logs/Base.js b/web/src/pages/System/Logs/Base.js
new file mode 100644
index 00000000..95634eda
--- /dev/null
+++ b/web/src/pages/System/Logs/Base.js
@@ -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 (
+
+ {children}
+
+ );
+ }
+}
+
+export default Base;
diff --git a/web/src/pages/System/Logs/Overview.js b/web/src/pages/System/Logs/Overview.js
new file mode 100644
index 00000000..3e4f2960
--- /dev/null
+++ b/web/src/pages/System/Logs/Overview.js
@@ -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 (
+ Overview
+ );
+ }
+}
+
+export default Overview;
diff --git a/web/src/pages/System/Security/Base.js b/web/src/pages/System/Security/Base.js
new file mode 100644
index 00000000..b324a3af
--- /dev/null
+++ b/web/src/pages/System/Security/Base.js
@@ -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 (
+
+ {children}
+
+ );
+ }
+}
+
+export default Base;
diff --git a/web/src/pages/System/Security/Certs.js b/web/src/pages/System/Security/Certs.js
new file mode 100644
index 00000000..1684430d
--- /dev/null
+++ b/web/src/pages/System/Security/Certs.js
@@ -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 (
+ Certs
+ );
+ }
+}
+
+export default Certs;
diff --git a/web/src/pages/System/Security/General.js b/web/src/pages/System/Security/General.js
new file mode 100644
index 00000000..c197db46
--- /dev/null
+++ b/web/src/pages/System/Security/General.js
@@ -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 (
+
+
+
+
+
+
+
+
+
+ {getFieldDecorator('auth2factor_enabled', {
+ initialValue: true,
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.security.auth2factor_enabled-message'}, {}),
+ },
+ ],
+ })(
+ {}} />
+ )}
+
+
+
+ {getFieldDecorator('audit_enabled',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.security.audit_enabled-message'}, {}),
+ },
+ ],
+ }
+ )
+ (
+ {}} />
+ )
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Form.create()(General);
diff --git a/web/src/pages/Settings/Security/General.less b/web/src/pages/System/Security/General.less
similarity index 100%
rename from web/src/pages/Settings/Security/General.less
rename to web/src/pages/System/Security/General.less
diff --git a/web/src/pages/System/Security/Roles.js b/web/src/pages/System/Security/Roles.js
new file mode 100644
index 00000000..77a287e4
--- /dev/null
+++ b/web/src/pages/System/Security/Roles.js
@@ -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 (
+ Roles
+ );
+ }
+}
+
+export default Roles;
diff --git a/web/src/pages/System/Security/SSO.js b/web/src/pages/System/Security/SSO.js
new file mode 100644
index 00000000..08102f2e
--- /dev/null
+++ b/web/src/pages/System/Security/SSO.js
@@ -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 => {text} ,
+ },
+ {
+ title: '名称',
+ dataIndex: 'name',
+ key: 'name',
+ },
+ {
+ title: '类型',
+ dataIndex: 'type',
+ key: 'type',
+ },
+ {
+ title: '启用',
+ key: 'enabled',
+ dataIndex: 'enabled',
+ render: text => ,
+ }, {
+ title: '最后更新时间',
+ key: 'modify_time',
+ dataIndex: 'modify_time',
+ }, {
+ title: '创建时间',
+ key: 'create_time',
+ dataIndex: 'create_time',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+ 修改
+
+ 删除
+
+ ),
+ },
+];
+
+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 (
+
+ );
+ }
+}
+
+export default SSO;
diff --git a/web/src/pages/System/Security/Users.js b/web/src/pages/System/Security/Users.js
new file mode 100644
index 00000000..a4951bfd
--- /dev/null
+++ b/web/src/pages/System/Security/Users.js
@@ -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 => {text} ,
+ },
+ {
+ title: '用户名',
+ dataIndex: 'user_name',
+ key: 'user_name',
+ },
+ {
+ title: '电子邮件地址',
+ dataIndex: 'email',
+ key: 'email',
+ },
+ {
+ title: '已激活',
+ key: 'enabled',
+ dataIndex: 'enabled',
+ render: text => ,
+ }, {
+ title: '管理员',
+ key: 'is_admin',
+ dataIndex: 'is_admin',
+ render: (text, record) => {
+ if (record.is_admin){
+ return
+ }else{
+ return
+ }
+ },
+ }, {
+ title: '创建时间',
+ key: 'create_time',
+ dataIndex: 'create_time',
+ },{
+ title: '上次登录',
+ key: 'last_login_time',
+ dataIndex: 'last_login_time',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+ 修改
+
+ 删除
+
+ ),
+ },
+];
+
+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 (
+
+ );
+ }
+}
+
+export default Users;
diff --git a/web/src/pages/System/Settings/Base.js b/web/src/pages/System/Settings/Base.js
new file mode 100644
index 00000000..9f18b2a5
--- /dev/null
+++ b/web/src/pages/System/Settings/Base.js
@@ -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 (
+
+ {children}
+
+ );
+ }
+}
+
+export default Base;
diff --git a/web/src/pages/System/Settings/Gateway.js b/web/src/pages/System/Settings/Gateway.js
new file mode 100644
index 00000000..f0098f3b
--- /dev/null
+++ b/web/src/pages/System/Settings/Gateway.js
@@ -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 (
+ Gateway
+ );
+ }
+}
+
+export default Gateway;
diff --git a/web/src/pages/System/Settings/Global.js b/web/src/pages/System/Settings/Global.js
new file mode 100644
index 00000000..ef593758
--- /dev/null
+++ b/web/src/pages/System/Settings/Global.js
@@ -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 (
+
+
+
+
+
+
+ {getFieldDecorator('site_name',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.site_name-message'}, {}),
+ },
+ ],
+ }
+ )
+ ( )
+ }
+
+
+
+ {getFieldDecorator('domain',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.domain-message'}, {}),
+ },
+ ],
+ }
+ )
+ ( )
+ }
+
+
+ {getFieldDecorator('listen_addr',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.listen_addr-message'}, {}),
+ },
+ ],
+ }
+ )
+ ( )
+ }
+
+
+ {getFieldDecorator('isTLS', {
+ initialValue: true,
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.is_tls-message'}, {}),
+ },
+ ],
+ })(
+ {
+ }}/>
+ )}
+
+
+
+
+ {getFieldDecorator('work_dir',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.data_path-message'}, {}),
+ },
+ ],
+ }
+ )
+ ( )
+ }
+
+
+
+ {getFieldDecorator('work_dir',
+ {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({id: 'app.settings.global.log_path-message'}, {}),
+ },
+ ],
+ }
+ )
+ ( )
+ }
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Global;
diff --git a/web/src/pages/document.ejs b/web/src/pages/document.ejs
index c5992413..1c9434f5 100644
--- a/web/src/pages/document.ejs
+++ b/web/src/pages/document.ejs
@@ -5,7 +5,7 @@
INFINI
-
+