refactor es util file
This commit is contained in:
parent
8d66f9f22b
commit
e43ef558ce
|
@ -8,7 +8,7 @@ import Editor, {monaco} from '@monaco-editor/react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {createDependencyProposals} from './autocomplete';
|
import {createDependencyProposals} from './autocomplete';
|
||||||
import InputSelect from '@/components/infini/InputSelect';
|
import InputSelect from '@/components/infini/InputSelect';
|
||||||
import {getFields,getESAPI} from '@/utils/elasticsearch';
|
import {getFields,getESAPI} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
function findParentIdentifier(textUntilPosition){
|
function findParentIdentifier(textUntilPosition){
|
||||||
let chars = textUntilPosition;
|
let chars = textUntilPosition;
|
||||||
|
@ -561,11 +561,14 @@ class Doucment extends React.Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return newItem;
|
return newItem;
|
||||||
|
});
|
||||||
|
this.indexSelEl && this.indexSelEl.setState({
|
||||||
|
value: [indices[0].value]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{(indices) ? (<Cascader ref={el=>{this.indexSelEl=el}} options={indices} style={{width: 200, marginRight:5}} placeholder="please select a index">
|
{(indices && indices.length>0) ? (<Cascader ref={el=>{this.indexSelEl=el}} defaultValue={[indices[0].value]} options={indices} style={{width: 200, marginRight:5}} placeholder="please select a index">
|
||||||
</Cascader>) : ''}
|
</Cascader>) : ''}
|
||||||
{/*{(indices) ? (<Select ref={el=>{this.indexSelEl=el}} style={{width: 200, marginRight:5}} placeholder="please select a index">*/}
|
{/*{(indices) ? (<Select ref={el=>{this.indexSelEl=el}} style={{width: 200, marginRight:5}} placeholder="please select a index">*/}
|
||||||
{/* {indices.map(item=>{*/}
|
{/* {indices.map(item=>{*/}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class JSONWrapper extends PureComponent {
|
||||||
return elemTop;
|
return elemTop;
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log(getElementTop(this.refs.jsonw));
|
// console.log(getElementTop(this.refs.jsonw));
|
||||||
this.setState({height: window.innerHeight - getElementTop(this.refs.jsonw) -50});
|
this.setState({height: window.innerHeight - getElementTop(this.refs.jsonw) -50});
|
||||||
}
|
}
|
||||||
render(){
|
render(){
|
||||||
|
@ -292,7 +292,11 @@ class Index extends PureComponent {
|
||||||
};
|
};
|
||||||
let newSettings = {};
|
let newSettings = {};
|
||||||
if(settings && settings[editingIndex.index]){
|
if(settings && settings[editingIndex.index]){
|
||||||
newSettings = transformSettingsForApi(settings[editingIndex.index], editingIndex.status === 'open')
|
if(settings[editingIndex.index].settings) {
|
||||||
|
newSettings = transformSettingsForApi(settings[editingIndex.index], editingIndex.status === 'open')
|
||||||
|
}else{
|
||||||
|
newSettings = settings[editingIndex.index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const {form: { getFieldDecorator }} = this.props;
|
const {form: { getFieldDecorator }} = this.props;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { connect } from 'dva';
|
||||||
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
|
||||||
import {Steps, Card, Form, Select, Input,Button, Divider,message, InputNumber} from 'antd';
|
import {Steps, Card, Form, Select, Input,Button, Divider,message, InputNumber} from 'antd';
|
||||||
import InputSelect from '@/components/infini/InputSelect';
|
import InputSelect from '@/components/infini/InputSelect';
|
||||||
import {getFields} from '@/utils/elasticsearch';
|
import {getFields} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
const {Step} = Steps;
|
const {Step} = Steps;
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {getDocList, saveDoc, deleteDoc, addDoc} from '@/services/doc';
|
import {getDocList, saveDoc, deleteDoc, addDoc} from '@/services/doc';
|
||||||
import {getMappings, getIndices} from '@/services/indices';
|
import {getMappings, getIndices} from '@/services/indices';
|
||||||
import {formatESSearchResult} from '@/utils/elasticsearch';
|
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
|
|
||||||
function encodeObjectField(doc){
|
function encodeObjectField(doc){
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {getRebuildList,reindex, deleteRebuild} from '@/services/rebuild';
|
import {getRebuildList,reindex, deleteRebuild} from '@/services/rebuild';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import {formatESSearchResult} from '@/utils/elasticsearch';
|
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
|
|
||||||
const delay = (ms) => new Promise((resolve) => {
|
const delay = (ms) => new Promise((resolve) => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { getDictList, addDict, deleteDict,updateDict } from '@/services/search';
|
import { getDictList, addDict, deleteDict,updateDict } from '@/services/search';
|
||||||
import {formatESSearchResult} from '@/utils/elasticsearch';
|
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
const utf8 = {
|
const utf8 = {
|
||||||
encode: function (string) {
|
encode: function (string) {
|
||||||
|
|
Loading…
Reference in New Issue