Skip to content

Commit

Permalink
Updated inspector template
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Jul 30, 2013
1 parent f574374 commit 2e85fbe
Show file tree
Hide file tree
Showing 19 changed files with 4,808 additions and 46 deletions.
4,742 changes: 4,741 additions & 1 deletion common/css/bootstrap.light.min.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions common/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
top:0px;
}

.navbar .brand {
color: #eee;
}

.navbar-inner {
border-width: 0 0 0px;
padding-left: 0px;
Expand Down
6 changes: 6 additions & 0 deletions js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ angular.module('kibana.filters', [])
return arr.slice(start, end);
}
};
}).filter('stringify', function() {
return function(arr, start, end) {
if(!_.isUndefined(arr)) {
return arr.toString();
}
};
});
2 changes: 1 addition & 1 deletion js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ angular.module('kibana.services', [])
index: {
interval: 'none',
pattern: '_all',
default: '_all'
default: 'INDEX_MISSING'
},
};

Expand Down
2 changes: 1 addition & 1 deletion panels/bettermap/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link rel="stylesheet" href="panels/bettermap/lib/plugins.css" />

<span ng-show="panel.spyable" style="position:absolute;right:0px;top:0px" class='panelextra pointer'>
<i bs-modal="'partials/modal.html'" class="icon-eye-open"></i>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>
<!-- This solution might work well for other panels that have trouble with heights -->
<div style="padding-right:10px;padding-top:10px;height:{{panel.height|| row.height}};overflow:hidden">
Expand Down
9 changes: 1 addition & 8 deletions panels/bettermap/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,8 @@ angular.module('kibana.bettermap', [])
});
};

// I really don't like this function, too much dom manip. Break out into directive?
$scope.populate_modal = function(request) {
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
};
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
};

})
Expand Down
2 changes: 1 addition & 1 deletion panels/derivequeries/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
</style>
<span ng-show='panel.spyable' style="position:absolute;right:0px;top:0px" class='panelextra pointer'>
<i bs-modal="'partials/modal.html'" class="icon-eye-open"></i>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>

<label class="small">Create new queries from
Expand Down
8 changes: 1 addition & 7 deletions panels/derivequeries/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,7 @@ angular.module('kibana.derivequeries', [])
};

$scope.populate_modal = function(request) {
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
};
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
};

var update_history = function(query) {
Expand Down
2 changes: 1 addition & 1 deletion panels/histogram/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
</style>
<span ng-show="panel.spyable" class='spy panelextra pointer'>
<i bs-modal="'partials/modal.html'" class="icon-eye-open"></i>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>
<div>
<span ng-show='panel.zoomlinks && data'>
Expand Down
8 changes: 1 addition & 7 deletions panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,7 @@ angular.module('kibana.histogram', [])

// I really don't like this function, too much dom manip. Break out into directive?
$scope.populate_modal = function(request) {
$scope.modal = {
title: "Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
};
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
};

$scope.set_refresh = function (state) {
Expand Down
11 changes: 11 additions & 0 deletions panels/hits/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,15 @@
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
<label class="small">Spyable</label><input type="checkbox" ng-model="panel.spyable" ng-checked="panel.spyable">
</div>
<div class="span9 small">
The panel spy shows 'behind the scenes' information about a panel. It can
be accessed by clicking the <i class='icon-eye-open'></i> in the top right
of the panel.
</div>
</div>
</div>
4 changes: 3 additions & 1 deletion panels/hits/module.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<kibana-panel ng-controller='hits' ng-init="init()">

<span ng-show="panel.spyable" class='spy panelextra pointer'>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>
<div ng-show="panel.counter_pos == 'above' && (panel.chart == 'bar' || panel.chart == 'pie')" id='{{$id}}-legend'>
<!-- vertical legend -->
<table class="small" ng-show="panel.arrangement == 'vertical'">
Expand Down
7 changes: 4 additions & 3 deletions panels/hits/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ angular.module('kibana.hits', [])
counter_pos : 'above',
donut : false,
tilt : false,
labels : true
labels : true,
spyable : true
};
_.defaults($scope.panel,_d);

Expand Down Expand Up @@ -77,8 +78,8 @@ angular.module('kibana.hits', [])
).size(0);
});

// TODO: Spy for hits panel
//$scope.populate_modal(request);
// Populate the inspector panel
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);

// Then run it
var results = request.doSearch();
Expand Down
2 changes: 1 addition & 1 deletion panels/table/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</style>

<span ng-show="panel.spyable" style="position:absolute;right:0px;top:0px" class='panelextra pointer'>
<i bs-modal="'partials/modal.html'" class="icon-eye-open"></i>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>

<div class="row-fluid">
Expand Down
8 changes: 1 addition & 7 deletions panels/table/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,7 @@ angular.module('kibana.table', [])
};

$scope.populate_modal = function(request) {
$scope.modal = {
title: "Table Inspector",
body : "<h5>Last Elasticsearch Query</h5><pre>"+
'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
angular.toJson(JSON.parse(request.toString()),true)+
"'</pre>",
};
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
};

$scope.without_kibana = function (row) {
Expand Down
11 changes: 11 additions & 0 deletions panels/terms/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,15 @@
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
<label class="small">Spyable</label><input type="checkbox" ng-model="panel.spyable" ng-checked="panel.spyable">
</div>
<div class="span9 small">
The panel spy shows 'behind the scenes' information about a panel. It can
be accessed by clicking the <i class='icon-eye-open'></i> in the top right
of the panel.
</div>
</div>
</div>
4 changes: 3 additions & 1 deletion panels/terms/module.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<kibana-panel ng-controller='terms' ng-init="init()">

<span ng-show="panel.spyable" class='spy panelextra pointer'>
<i bs-modal="'partials/inspector.html'" class="icon-eye-open"></i>
</span>
<!-- START Pie or bar chart -->
<div ng-show="panel.counter_pos == 'above' && (panel.chart == 'bar' || panel.chart == 'pie')" id='{{$id}}-legend'>
<!-- vertical legend above -->
Expand Down
6 changes: 4 additions & 2 deletions panels/terms/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ angular.module('kibana.terms', [])
labels : true,
arrangement : 'horizontal',
chart : 'bar',
counter_pos : 'above'
counter_pos : 'above',
spyable : true
};
_.defaults($scope.panel,_d);

Expand Down Expand Up @@ -92,7 +93,8 @@ angular.module('kibana.terms', [])
filterSrv.getBoolFilter(filterSrv.ids)
)))).size(0);

//$scope.populate_modal(request);
// Populate the inspector panel
$scope.inspector = angular.toJson(JSON.parse(request.toString()),true);

results = request.doSearch();

Expand Down
16 changes: 16 additions & 0 deletions partials/inspector.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Inspector</h3>
</div>
<div class="modal-body">

<div>
<h5>Last Elasticsearch Query</h5>
<pre>curl -XGET '{{config.elasticsearch}}/{{dashboard.indices|stringify}}/_search?pretty' -d '{{inspector}}'
</pre>"
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" ng-click="dismiss()">Close</button>
</div>

0 comments on commit 2e85fbe

Please sign in to comment.