worked on dashboard search and keyboard nav, improved duplicate panel
This commit is contained in:
1 parent
5472e5f940
commit
2be31e5779
7 files changed
+68
-15
No files matched your search
@@ -73,6 +73,23 @@ function (angular, config, _) {
|
||||
});
|
||||
};
|
||||
|
||||
$scope.countWatchers = function (scopeStart) {
|
||||
var q = [scopeStart || $rootScope], watchers = 0, scope;
|
||||
while (q.length > 0) {
|
||||
scope = q.pop();
|
||||
if (scope.$$watchers) {
|
||||
watchers += scope.$$watchers.length;
|
||||
}
|
||||
if (scope.$$childHead) {
|
||||
q.push(scope.$$childHead);
|
||||
}
|
||||
if (scope.$$nextSibling) {
|
||||
q.push(scope.$$nextSibling);
|
||||
}
|
||||
}
|
||||
window.console.log(watchers);
|
||||
};
|
||||
|
||||
$scope.isPanel = function(obj) {
|
||||
if(!_.isNull(obj) && !_.isUndefined(obj) && !_.isUndefined(obj.type)) {
|
||||
return true;
|
||||
|
||||
@@ -71,6 +71,10 @@ function (angular, _) {
|
||||
};
|
||||
|
||||
$scope.elasticsearch_delete = function(id) {
|
||||
if (!confirm('Are you sure you want to delete dashboard?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
dashboard.elasticsearch_delete(id).then(
|
||||
function(result) {
|
||||
if(!_.isUndefined(result)) {
|
||||
|
||||
@@ -9,12 +9,12 @@ function (angular, _, config, $) {
|
||||
|
||||
var module = angular.module('kibana.controllers');
|
||||
|
||||
module.controller('SearchCtrl', function($scope, dashboard, keyboardManager, $element) {
|
||||
module.controller('SearchCtrl', function($scope, dashboard, keyboardManager, $element, $location) {
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.elasticsearch = $scope.elasticsearch || {};
|
||||
$scope.giveSearchFocus = 0;
|
||||
$scope.selectedIndex = null;
|
||||
$scope.selectedIndex = -1;
|
||||
|
||||
/*keyboardManager.bind('shift+s', function() {
|
||||
$element.find('.dropdown').addClass('open');
|
||||
@@ -28,7 +28,19 @@ function (angular, _, config, $) {
|
||||
|
||||
$scope.keyDown = function (evt) {
|
||||
if (evt.keyCode === 40) {
|
||||
$scope.selectedIndex = ($scope.selectedIndex || 0) + 1;
|
||||
$scope.selectedIndex++;
|
||||
}
|
||||
if (evt.keyCode === 38) {
|
||||
$scope.selectedIndex--;
|
||||
}
|
||||
if (evt.keyCode === 13) {
|
||||
var selectedDash = $scope.search_results.dashboards[$scope.selectedIndex];
|
||||
if (selectedDash) {
|
||||
$location.path("/dashboard/elasticsearch/" + encodeURIComponent(selectedDash._id));
|
||||
setTimeout(function(){
|
||||
$('body').click(); // hack to force dropdown to close;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,6 +63,7 @@ function (angular, _, config, $) {
|
||||
|
||||
$scope.elasticsearch_dblist = function(queryStr) {
|
||||
$scope.showImport = false;
|
||||
$scope.selectedIndex = -1;
|
||||
|
||||
queryStr = queryStr.toLowerCase();
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
||||
|
||||
|
||||
$scope.init = function() {
|
||||
//$scope.openConfigureModal();
|
||||
|
||||
$scope.panelMenuItems = [
|
||||
{ text: 'View fullscreen', action: $scope.toggleFullscreen },
|
||||
{ text: 'Edit', action: $scope.openConfigureModal },
|
||||
@@ -446,17 +446,23 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
||||
$scope.render();
|
||||
};
|
||||
|
||||
$scope.duplicate = function() {
|
||||
var panelCopy = angular.copy($scope.panel);
|
||||
|
||||
var currentRowSpan = $scope.rowSpan($scope.row);
|
||||
$scope.duplicate = function(addToRow) {
|
||||
addToRow = addToRow || $scope.row;
|
||||
var currentRowSpan = $scope.rowSpan(addToRow);
|
||||
if (currentRowSpan <= 8) {
|
||||
$scope.row.panels.push(panelCopy);
|
||||
addToRow.panels.push(angular.copy($scope.panel));
|
||||
}
|
||||
else {
|
||||
var rowCopy = angular.copy($scope.row);
|
||||
rowCopy.panels = [panelCopy];
|
||||
$scope.dashboard.current.rows.push(rowCopy);
|
||||
var rowsList = $scope.dashboard.current.rows;
|
||||
var rowIndex = _.indexOf(rowsList, addToRow);
|
||||
if (rowIndex === rowsList.length - 1) {
|
||||
var newRow = angular.copy($scope.row);
|
||||
newRow.panels = [];
|
||||
$scope.duplicate(newRow);
|
||||
}
|
||||
else {
|
||||
$scope.duplicate(rowsList[rowIndex+1]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
ng-change="elasticsearch_dblist(elasticsearch.query)" />
|
||||
<h6 ng-hide="search_results.dashboards.length || search_results.metrics.length">No dashboards or metrics matching your query found</h6>
|
||||
<table class="table table-condensed table-striped">
|
||||
<tr bindonce ng-repeat="row in search_results.metrics" class="grafana-search-metric-result">
|
||||
<tr bindonce ng-repeat="row in search_results.metrics"
|
||||
class="grafana-search-metric-result"
|
||||
ng-class="{'selected': $index === selectedIndex }">
|
||||
<td><span class="label label-info">metric</span></td>
|
||||
<td class="grafana-search-metric-name">
|
||||
{{row._id}}
|
||||
@@ -39,7 +41,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bindonce ng-repeat="row in search_results.dashboards | orderBy:['_id']">
|
||||
<tr bindonce
|
||||
ng-repeat="row in search_results.dashboards"
|
||||
ng-class="{'selected': $index === selectedIndex }">
|
||||
<td><a ng-click="elasticsearch_delete(row._id)"><i class="icon-remove"></i></a></td>
|
||||
<td style="width:100%"><a href="#/dashboard/elasticsearch/{{row._id}}" bo-text="row._id"></a></td>
|
||||
<td><a><i class="icon-share" ng-click="share = dashboard.share_link(row._id,'elasticsearch',row._id)" bs-modal="'app/panels/dashcontrol/share.html'"></i></a></td>
|
||||
|
||||
Vendored
+1
-1
@@ -6,4 +6,4 @@
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Designed and built with all the love in the world by @mdo and @fat.
|
||||
*/.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:31px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:21px;color:#c8c8c8;background-color:#272b30}a{color:#fff;text-decoration:none}a:hover,a:focus{color:#fff;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-10px;*zoom:1}.row:before,.row:after{display:table;content:"";line-height:0}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:10px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:830px}.span12{width:830px}.span11{width:760px}.span10{width:690px}.span9{width:620px}.span8{width:550px}.span7{width:480px}.span6{width:410px}.span5{width:340px}.span4{width:270px}.span3{width:200px}.span2{width:130px}.span1{width:60px}.offset12{margin-left:850px}.offset11{margin-left:780px}.offset10{margin-left:710px}.offset9{margin-left:640px}.offset8{margin-left:570px}.offset7{margin-left:500px}.offset6{margin-left:430px}.offset5{margin-left:360px}.offset4{margin-left:290px}.offset3{margin-left:220px}.offset2{margin-left:150px}.offset1{margin-left:80px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;width:100%;min-height:31px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:1.2048192771084338%;*margin-left:1.144578313253012%}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:1.2048192771084338%}.row-fluid .span12{width:100%;*width:99.93975903614458%}.row-fluid .span11{width:91.56626506024097%;*width:91.50602409638554%}.row-fluid .span10{width:83.13253012048192%;*width:83.0722891566265%}.row-fluid .span9{width:74.6987951807229%;*width:74.63855421686748%}.row-fluid .span8{width:66.26506024096385%;*width:66.20481927710843%}.row-fluid .span7{width:57.831325301204814%;*width:57.77108433734939%}.row-fluid .span6{width:49.39759036144578%;*width:49.33734939759036%}.row-fluid .span5{width:40.963855421686745%;*width:40.903614457831324%}.row-fluid .span4{width:32.53012048192771%;*width:32.46987951807229%}.row-fluid .span3{width:24.096385542168676%;*width:24.036144578313255%}.row-fluid .span2{width:15.662650602409638%;*width:15.60240Line truncated
|
||||
*/.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:31px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:21px;color:#c8c8c8;background-color:#272b30}a{color:#fff;text-decoration:none}a:hover,a:focus{color:#fff;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-10px;*zoom:1}.row:before,.row:after{display:table;content:"";line-height:0}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:10px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:830px}.span12{width:830px}.span11{width:760px}.span10{width:690px}.span9{width:620px}.span8{width:550px}.span7{width:480px}.span6{width:410px}.span5{width:340px}.span4{width:270px}.span3{width:200px}.span2{width:130px}.span1{width:60px}.offset12{margin-left:850px}.offset11{margin-left:780px}.offset10{margin-left:710px}.offset9{margin-left:640px}.offset8{margin-left:570px}.offset7{margin-left:500px}.offset6{margin-left:430px}.offset5{margin-left:360px}.offset4{margin-left:290px}.offset3{margin-left:220px}.offset2{margin-left:150px}.offset1{margin-left:80px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;width:100%;min-height:31px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:1.2048192771084338%;*margin-left:1.144578313253012%}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:1.2048192771084338%}.row-fluid .span12{width:100%;*width:99.93975903614458%}.row-fluid .span11{width:91.56626506024097%;*width:91.50602409638554%}.row-fluid .span10{width:83.13253012048192%;*width:83.0722891566265%}.row-fluid .span9{width:74.6987951807229%;*width:74.63855421686748%}.row-fluid .span8{width:66.26506024096385%;*width:66.20481927710843%}.row-fluid .span7{width:57.831325301204814%;*width:57.77108433734939%}.row-fluid .span6{width:49.39759036144578%;*width:49.33734939759036%}.row-fluid .span5{width:40.963855421686745%;*width:40.903614457831324%}.row-fluid .span4{width:32.53012048192771%;*width:32.46987951807229%}.row-fluid .span3{width:24.096385542168676%;*width:24.036144578313255%}.row-fluid .span2{width:15.662650602409638%;*width:15.60240Line truncated
|
||||
+9
@@ -12,6 +12,15 @@
|
||||
.box-sizing(border-box);
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.selected td, tr.selected:nth-child(odd)>td {
|
||||
background: darken(@blue, 20%);
|
||||
color: white;
|
||||
text-shadow: -1px -1px 1px rgba(0,0,0,0.3);
|
||||
a {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panelCont {
|
||||
|
||||
Reference in new issue
Block a user