Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ytzlax committed Feb 4, 2019
1 parent 3730435 commit 8338e46
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,10 +1,10 @@
{
"name": "kibana_api",
"version": "0.6.1",
"version": "0.6.2",
"description": "This plugin allow you to crete visualization dynamiclly",
"main": "index.js",
"kibana": {
"version": "6.5.1"
"version": "6.5.2"
},
"repository": {
"type": "git",
Expand Down
35 changes: 23 additions & 12 deletions public/hack.js
Expand Up @@ -6,11 +6,14 @@ import packageJson from '../package.json';
import { timefilter } from 'ui/timefilter';
import { DashboardStateManager } from 'plugins/kibana/dashboard/dashboard_state_manager';
import { store } from 'plugins/kibana/store';
import { updateFilters } from 'plugins/kibana/dashboard/actions/view';
import { updateFilters } from 'plugins/kibana/dashboard/actions/view';

let kibanaVersion = packageJson.kibana.version;

uiModules.get('app/dashboard').run(function ($rootScope, $http, $location, kbnUrl, getAppState,globalState,AppState) {
let visStructure;
let loaded = false;

callServer('get', '../api/visStructure').then(function (response) {
visStructure = response.data;
});
Expand Down Expand Up @@ -138,9 +141,6 @@ uiModules.get('app/dashboard').run(function ($rootScope, $http, $location, kbnUr


let eventMessageHandler = function (e) {
let appState= new AppState();


switch (e.data.actionType) {
case "setVisualization":
let partialVisArr = [], fullVisArr = [], titelsArr = [];
Expand Down Expand Up @@ -176,19 +176,24 @@ uiModules.get('app/dashboard').run(function ($rootScope, $http, $location, kbnUr
}

})

return;

case "addSearchChip":

getIndexPatternIdByTitle(e.data.index).then((indexId)=> {
const dashboardFilters= getAppState().filters.push(KibanaApiService.handleTextFilter(e.data.text,indexId));
store.dispatch(updateFilters(dashboardFilters));
getIndexPatternIdByTitle(e.data.index).then((indexId)=> {
const dashboardFilters= getAppState().filters.push(KibanaApiService.handleTextFilter(e.data.text,indexId));
store.dispatch(updateFilters(getAppState().filters));
});

return;
});

case "flushSearchChip":
appState.filters=[]
appState.save();

const appState = getAppState();
appState.filters = [];
store.dispatch(updateFilters(appState.filters));

return;

case "createIndexPattern":
Expand All @@ -209,13 +214,19 @@ uiModules.get('app/dashboard').run(function ($rootScope, $http, $location, kbnUr
isIndexPatternExist(e.data.indexPattern).then(function (res) {
postResToApp("isIndexPatternExist", res);
});

return;

case "setDashboardTime":
case "setDashboardTime":

timefilter.setTime({ from:e.data.time.from, to:e.data.time.to, mode :e.data.time.mode});

return;
case "setRefreshInterval":

case "setRefreshInterval":

timefilter.setRefreshInterval({ pause:e.data.refresh.pause, value:e.data.refresh.value});

return;

}
Expand Down

0 comments on commit 8338e46

Please sign in to comment.