From 0ea47aeae7517d528c97308ba7a1e1f20ff00a6a Mon Sep 17 00:00:00 2001 From: chenhua Date: Thu, 12 Nov 2020 00:28:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=AE=A1=E7=90=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/config/router.config.js | 29 +- web/docker/entrypoint-build.sh | 0 web/docker/entrypoint-dev.sh | 0 web/docker/entrypoint.sh | 0 web/src/pages/SearchManage/AliasManage.js | 624 ++++++++++++++++ web/src/pages/SearchManage/AliasManage.less | 49 ++ web/src/pages/SearchManage/AnalyzerManage.js | 675 ++++++++++++++++++ .../pages/SearchManage/AnalyzerManage.less | 49 ++ web/src/pages/SearchManage/DictManage.js | 675 ++++++++++++++++++ web/src/pages/SearchManage/DictManage.less | 49 ++ web/src/pages/SearchManage/NLPManage.js | 675 ++++++++++++++++++ web/src/pages/SearchManage/NLPManage.less | 49 ++ web/src/pages/SearchManage/SearchTemplate.js | 311 ++++++++ .../pages/SearchManage/SearchTemplate.less | 195 +++++ web/src/pages/SearchManage/models/rule.js | 55 ++ 15 files changed, 3420 insertions(+), 15 deletions(-) mode change 100644 => 100755 web/docker/entrypoint-build.sh mode change 100644 => 100755 web/docker/entrypoint-dev.sh mode change 100644 => 100755 web/docker/entrypoint.sh create mode 100644 web/src/pages/SearchManage/AliasManage.js create mode 100644 web/src/pages/SearchManage/AliasManage.less create mode 100644 web/src/pages/SearchManage/AnalyzerManage.js create mode 100644 web/src/pages/SearchManage/AnalyzerManage.less create mode 100644 web/src/pages/SearchManage/DictManage.js create mode 100644 web/src/pages/SearchManage/DictManage.less create mode 100644 web/src/pages/SearchManage/NLPManage.js create mode 100644 web/src/pages/SearchManage/NLPManage.less create mode 100644 web/src/pages/SearchManage/SearchTemplate.js create mode 100644 web/src/pages/SearchManage/SearchTemplate.less create mode 100644 web/src/pages/SearchManage/models/rule.js diff --git a/web/config/router.config.js b/web/config/router.config.js index d745e14a..49056d30 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -26,13 +26,13 @@ export default [ component: './Dashboard/Analysis', routes: [ { - path: '/list/table-list', + path: '/platform/gateway', name: 'gateway', - component: './List/TableList', + component: './Dashboard/Analysis', }, { - path: '/list/table-list', + path: '/platform/cluster', name: 'cluster', - component: './List/TableList', + component: './Dashboard/Monitor', }, { path: '/list/table-list', name: 'tasks', @@ -95,28 +95,27 @@ export default [ path: '/search', name: 'search', icon: 'search', - component: './Logs/Overview', routes: [ { - path: '/list/table-list', + path: '/search/template', name: 'template', - component: './List/TableList', + component: './SearchManage/SearchTemplate', }, { - path: '/list/table-list', + path: '/search/alias', name: 'alias', - component: './List/TableList', + component: './SearchManage/AliasManage', }, { - path: '/list/table-list', + path: '/search/dict', name: 'dict', - component: './List/TableList', + component: './SearchManage/DictManage', }, { - path: '/list/table-list', + path: '/search/analyzer', name: 'analyzer', - component: './List/TableList', + component: './SearchManage/AnalyzerManage', }, { - path: '/list/table-list', + path: '/search/nlp', name: 'nlp', - component: './List/TableList', + component: './SearchManage/NLPManage', }, ] }, diff --git a/web/docker/entrypoint-build.sh b/web/docker/entrypoint-build.sh old mode 100644 new mode 100755 diff --git a/web/docker/entrypoint-dev.sh b/web/docker/entrypoint-dev.sh old mode 100644 new mode 100755 diff --git a/web/docker/entrypoint.sh b/web/docker/entrypoint.sh old mode 100644 new mode 100755 diff --git a/web/src/pages/SearchManage/AliasManage.js b/web/src/pages/SearchManage/AliasManage.js new file mode 100644 index 00000000..3367d590 --- /dev/null +++ b/web/src/pages/SearchManage/AliasManage.js @@ -0,0 +1,624 @@ +import React, { PureComponent, Fragment } from 'react'; +import { connect } from 'dva'; +import moment from 'moment'; +import { + Row, + Col, + Card, + Form, + Input, + Select, + Icon, + Button, + Dropdown, + Menu, + InputNumber, + DatePicker, + Modal, + message, + Badge, + Divider, + Steps, + Radio, +} from 'antd'; +import StandardTable from '@/components/StandardTable'; +import PageHeaderWrapper from '@/components/PageHeaderWrapper'; + +import styles from './AliasManage.less'; + +const FormItem = Form.Item; +const { Step } = Steps; +const { TextArea } = Input; +const { Option } = Select; +const RadioGroup = Radio.Group; +const getValue = obj => + Object.keys(obj) + .map(key => obj[key]) + .join(','); +const statusMap = ['default', 'processing', 'success', 'error']; +const status = ['关闭', '运行中', '已上线', '异常']; + +class UpdateForm extends PureComponent { + constructor(props) { + super(props); + + this.state = { + formVals: { + name: props.values.name, + desc: props.values.desc, + key: props.values.key, + target: '0', + template: '0', + type: '1', + time: '', + frequency: 'month', + }, + currentStep: 0, + }; + + this.formLayout = { + labelCol: { span: 7 }, + wrapperCol: { span: 13 }, + }; + } + + handleNext = currentStep => { + const { form, handleUpdate } = this.props; + const { formVals: oldValue } = this.state; + form.validateFields((err, fieldsValue) => { + if (err) return; + const formVals = { ...oldValue, ...fieldsValue }; + this.setState( + { + formVals, + }, + () => { + if (currentStep < 2) { + this.forward(); + } else { + handleUpdate(formVals); + } + } + ); + }); + }; + + backward = () => { + const { currentStep } = this.state; + this.setState({ + currentStep: currentStep - 1, + }); + }; + + forward = () => { + const { currentStep } = this.state; + this.setState({ + currentStep: currentStep + 1, + }); + }; + + renderContent = (currentStep, formVals) => { + const { form } = this.props; + if (currentStep === 1) { + return [ + + {form.getFieldDecorator('target', { + initialValue: formVals.target, + })( + + )} + , + + {form.getFieldDecorator('template', { + initialValue: formVals.template, + })( + + )} + , + + {form.getFieldDecorator('type', { + initialValue: formVals.type, + })( + + + + + )} + , + ]; + } + if (currentStep === 2) { + return [ + + {form.getFieldDecorator('time', { + rules: [{ required: true, message: '请选择开始时间!' }], + })( + + )} + , + + {form.getFieldDecorator('frequency', { + initialValue: formVals.frequency, + })( + + )} + , + ]; + } + return [ + + {form.getFieldDecorator('name', { + rules: [{ required: true, message: '请输入索引名称!' }], + initialValue: formVals.name, + })()} + , + + {form.getFieldDecorator('desc', { + rules: [{ required: true, message: '请输入至少五个字符的索引描述!', min: 5 }], + initialValue: formVals.desc, + })(