move debug spy to devMode, and move basic spyModes to a plugin
This commit is contained in:
parent
5beb79d8cd
commit
abfe91991a
|
@ -20,7 +20,7 @@ module.exports = function (grunt) {
|
|||
testUtilsDir: __dirname + '/test/utils',
|
||||
bowerComponentsDir: __dirname + '/bower_components',
|
||||
|
||||
devPlugins: 'vis_debug_spy',
|
||||
devPlugins: 'devMode',
|
||||
|
||||
meta: {
|
||||
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +
|
||||
|
|
|
@ -12,12 +12,9 @@ module.exports = function devModePlugin(kibana) {
|
|||
const SRC = fromRoot('src');
|
||||
const UI = fromRoot('src/ui');
|
||||
|
||||
if (!kibana.config.get('env.dev')) return;
|
||||
|
||||
return new kibana.Plugin({
|
||||
initCondition: function (config) {
|
||||
return config.get('env.dev');
|
||||
},
|
||||
|
||||
init: function (server, options) {
|
||||
server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
|
||||
server.ext('onPreHandler', istanbul({ root: UI, displayRoot: SRC, filter: kibanaSrcFilter }));
|
||||
|
@ -40,6 +37,12 @@ module.exports = function devModePlugin(kibana) {
|
|||
}, reply);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
uiExports: {
|
||||
spyModes: [
|
||||
'plugins/devMode/visDebugSpyPanel'
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ define(function (require) {
|
|||
return {
|
||||
name: 'debug',
|
||||
display: 'Debug',
|
||||
template: require('plugins/vis_debug_spy/vis_debug_spy.html'),
|
||||
template: require('plugins/devMode/visDebugSpyPanel.html'),
|
||||
order: 5,
|
||||
link: function ($scope, $el) {
|
||||
$scope.$watch('vis.getState() | json', function (json) {
|
|
@ -2,7 +2,8 @@ module.exports = function (kibana) {
|
|||
return new kibana.Plugin({
|
||||
uiExports: {
|
||||
spyModes: [
|
||||
'plugins/vis_debug_spy/vis_debug_spy'
|
||||
'plugins/spyModes/tableSpyMode',
|
||||
'plugins/spyModes/reqRespStatsSpyMode'
|
||||
]
|
||||
}
|
||||
});
|
4
src/plugins/spyModes/package.json
Normal file
4
src/plugins/spyModes/package.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "spyModes",
|
||||
"version": "1.0.0"
|
||||
}
|
3
src/plugins/spyModes/public/.jshintrc
Normal file
3
src/plugins/spyModes/public/.jshintrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "../../../../.jshintrc.browser"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
define(function (require) {
|
||||
var _ = require('lodash');
|
||||
var reqRespStatsHTML = require('ui/visualize/spy/_req_resp_stats.html');
|
||||
var reqRespStatsHTML = require('plugins/spyModes/reqRespStatsSpyMode.html');
|
||||
|
||||
var linkReqRespStats = function ($scope, config) {
|
||||
$scope.$bind('req', 'searchSource.history[searchSource.history.length - 1]');
|
|
@ -12,7 +12,7 @@ define(function (require) {
|
|||
name: 'table',
|
||||
display: 'Table',
|
||||
order: 1,
|
||||
template: require('ui/visualize/spy/_table.html'),
|
||||
template: require('plugins/spyModes/tableSpyMode.html'),
|
||||
link: function tableLinkFn($scope, $el) {
|
||||
$rootScope.$watchMulti.call($scope, [
|
||||
'vis',
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"name": "vis_debug_spy",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -89,7 +89,7 @@ class OptmzBundles {
|
|||
.settle()
|
||||
.spread(function (readEntry, statBundle) {
|
||||
if (readEntry.isFulfilled() && statBundle.isFulfilled()) {
|
||||
entry.exists = (readEntry.value() !== entry.content);
|
||||
entry.exists = (readEntry.value() === entry.content);
|
||||
} else {
|
||||
entry.exists = false;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ var join = require('path').join;
|
|||
|
||||
module.exports = class PluginApi {
|
||||
constructor(kibana, pluginPath) {
|
||||
this.config = kibana.server.config();
|
||||
this.rootDir = kibana.rootDir;
|
||||
this.package = require(join(pluginPath, 'package.json'));
|
||||
this.autoload = require('../ui/autoload');
|
||||
|
|
|
@ -5,15 +5,12 @@ define(function (require) {
|
|||
var $ = require('jquery');
|
||||
var _ = require('lodash');
|
||||
|
||||
require('ui/visualize/spy/_table');
|
||||
require('ui/visualize/spy/_req_resp_stats');
|
||||
|
||||
var modes = Private(require('registry/spy_modes'));
|
||||
var defaultMode = modes.inOrder[0];
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: require('ui/visualize/spy/_spy.html'),
|
||||
template: require('ui/visualize/spy.html'),
|
||||
link: function ($scope, $el) {
|
||||
var $container = $el.find('.visualize-spy-container');
|
||||
var fullPageSpy = false;
|
|
@ -3,7 +3,7 @@ define(function (require) {
|
|||
.get('kibana/directive')
|
||||
.directive('visualize', function (Notifier, SavedVis, indexPatterns, Private) {
|
||||
|
||||
require('ui/visualize/spy/spy');
|
||||
require('ui/visualize/spy');
|
||||
require('ui/visualize/visualize.less');
|
||||
var $ = require('jquery');
|
||||
var _ = require('lodash');
|
||||
|
|
Loading…
Reference in a new issue