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, + })(