added global dashboard wide hideControls option
This commit is contained in:
1 parent
63358ede5b
commit
a5d39cd51d
14 files changed
+34
-74
No files matched your search
@@ -53,8 +53,8 @@ require.config({
|
||||
},
|
||||
|
||||
rq: {
|
||||
deps: ['setImmediate'],
|
||||
exports: 'RQ'
|
||||
deps: ['setImmediate'],
|
||||
exports: 'RQ'
|
||||
},
|
||||
|
||||
angular: {
|
||||
|
||||
@@ -12,8 +12,8 @@ function (_) {
|
||||
var defaults = {
|
||||
elasticsearch : "http://"+window.location.hostname+":9200",
|
||||
panel_names : [],
|
||||
kibana_index : 'kibana-int',
|
||||
graphiteUrl : null,
|
||||
kibana_index : 'kibana-int',
|
||||
graphiteUrl : null,
|
||||
default_route : '/dashboard/file/default.json'
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
define([
|
||||
'angular',
|
||||
'app',
|
||||
'underscore'
|
||||
'underscore',
|
||||
'moment',
|
||||
],
|
||||
function (angular, app, _) {
|
||||
function (angular, app, _, moment) {
|
||||
'use strict';
|
||||
|
||||
var module = angular.module('kibana.controllers');
|
||||
@@ -30,6 +31,7 @@ function (angular, app, _) {
|
||||
if(factor > 1) {
|
||||
filterSrv.removeByType('time');
|
||||
}
|
||||
|
||||
filterSrv.set({
|
||||
type:'time',
|
||||
from:moment.utc(_from).toDate(),
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
"spyable": true,
|
||||
"targets": [
|
||||
{
|
||||
"target": "summarize(sum(prod.apps.tradera_site.*.counters.global.request_status.code_404.count), '30s')"
|
||||
"target": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ function ($, RQ, config) {
|
||||
until: $.plot.formatDate(options.range.to, '%H%:%M_%Y%m%d'),
|
||||
targets: options.targets,
|
||||
maxDataPoints: options.maxDataPoints
|
||||
}
|
||||
};
|
||||
|
||||
var graphiteParameters = build_graphite_options(graphOptions, true);
|
||||
getGraphiteData(graphiteParameters)
|
||||
@@ -76,7 +76,7 @@ function ($, RQ, config) {
|
||||
.fail(function() {
|
||||
requestion(null, 'Error in ajax call to graphite');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getGraphiteData(parameters) {
|
||||
|
||||
@@ -56,10 +56,6 @@
|
||||
<i ng-show="!options" class="icon-caret-right"></i><i ng-show="options" class="icon-caret-down"></i> View
|
||||
</a> | 
|
||||
</span>
|
||||
<span ng-show='panel.zoomlinks && data'>
|
||||
<!--<a class='small' ng-click='zoom(0.5)'><i class='icon-zoom-in'></i> Zoom In</a>-->
|
||||
<a class='small' ng-click='zoom(2)'><i class='icon-zoom-out'></i> Zoom Out</a>
|
||||
</span>
|
||||
</div>
|
||||
<form class="form-inline bordered histogram-options" ng-show="options">
|
||||
<span>
|
||||
|
||||
@@ -20,6 +20,7 @@ define([
|
||||
'moment',
|
||||
'./timeSeries',
|
||||
'./graphiteSrv',
|
||||
'rq',
|
||||
'jquery.flot',
|
||||
'jquery.flot.events',
|
||||
'jquery.flot.selection',
|
||||
@@ -28,7 +29,7 @@ define([
|
||||
'jquery.flot.stack',
|
||||
'jquery.flot.stackpercent'
|
||||
],
|
||||
function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv, RQ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -323,7 +324,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
$scope.legend = [];
|
||||
var data = [];
|
||||
|
||||
if(results.length == 0 ) {
|
||||
if(results.length === 0 ) {
|
||||
requestion('no data in response from graphite');
|
||||
}
|
||||
|
||||
@@ -369,34 +370,6 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
$scope.panel.targets.push({target: ''});
|
||||
};
|
||||
|
||||
// function $scope.zoom
|
||||
// factor :: Zoom factor, so 0.5 = cuts timespan in half, 2 doubles timespan
|
||||
$scope.zoom = function(factor) {
|
||||
var _range = filterSrv.timeRange('last');
|
||||
var _timespan = (_range.to.valueOf() - _range.from.valueOf());
|
||||
var _center = _range.to.valueOf() - _timespan/2;
|
||||
|
||||
var _to = (_center + (_timespan*factor)/2);
|
||||
var _from = (_center - (_timespan*factor)/2);
|
||||
|
||||
// If we're not already looking into the future, don't.
|
||||
if(_to > Date.now() && _range.to < Date.now()) {
|
||||
var _offset = _to - Date.now();
|
||||
_from = _from - _offset;
|
||||
_to = Date.now();
|
||||
}
|
||||
|
||||
if(factor > 1) {
|
||||
filterSrv.removeByType('time');
|
||||
}
|
||||
filterSrv.set({
|
||||
type:'time',
|
||||
from:moment.utc(_from).toDate(),
|
||||
to:moment.utc(_to).toDate(),
|
||||
field:$scope.panel.time_field
|
||||
});
|
||||
};
|
||||
|
||||
$scope.openConfigureModal = function($event) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
@@ -408,7 +381,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$scope.$emit('render');
|
||||
$scope.$emit('render');
|
||||
}, 200);
|
||||
});
|
||||
|
||||
@@ -460,30 +433,6 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
render_panel(data);
|
||||
});
|
||||
|
||||
var scale = function(series,factor) {
|
||||
return _.map(series,function(p) {
|
||||
return [p[0],p[1]*factor];
|
||||
});
|
||||
};
|
||||
|
||||
var scaleSeconds = function(series,interval) {
|
||||
return _.map(series,function(p) {
|
||||
return [p[0],p[1]/kbn.interval_to_seconds(interval)];
|
||||
});
|
||||
};
|
||||
|
||||
var derivative = function(series) {
|
||||
return _.map(series, function(p,i) {
|
||||
var _v;
|
||||
if(i === 0 || p[1] === null) {
|
||||
_v = [p[0],null];
|
||||
} else {
|
||||
_v = series[i-1][1] === null ? [p[0],null] : [p[0],p[1]-(series[i-1][1])];
|
||||
}
|
||||
return _v;
|
||||
});
|
||||
};
|
||||
|
||||
// Function for rendering panel
|
||||
function render_panel(data) {
|
||||
// IE doesn't work without this
|
||||
@@ -622,7 +571,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
if(_int >= 2628000) {
|
||||
return "%Y-%m";
|
||||
}
|
||||
if(_int >= 86400) {
|
||||
if(_int >= 10000) {
|
||||
return "%Y-%m-%d";
|
||||
}
|
||||
if(_int >= 60) {
|
||||
@@ -633,6 +582,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
||||
}
|
||||
|
||||
var $tooltip = $('<div>');
|
||||
|
||||
elem.bind("plothover", function (event, pos, item) {
|
||||
var group, value, timestamp;
|
||||
if (item) {
|
||||
|
||||
@@ -121,7 +121,7 @@ function (_, Interval) {
|
||||
ts.ZeroFilled.prototype._getFlotPairsConnect = function (result, time, i, times) {
|
||||
result.push([times[i], this._data[times[i]] || 0 ]);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ** called as a reduce stragegy in getFlotPairs() **
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
</div>
|
||||
</nil>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="container-fluid main" ng-class="{'grafana-dashboard-hide-controls': dashboard.current.hideControls}">
|
||||
<div class="row-fluid">
|
||||
<div class="row-fluid container" style="margin-top:10px; width:98%">
|
||||
<div ng-show="fullEditMode" class="modal-backdrop fade in"></div>
|
||||
<!-- Rows -->
|
||||
<div class="row-fluid kibana-row" ng-controller="RowCtrl" ng-repeat="(row_name, row) in dashboard.current.rows" ng-style="row_style(row)">
|
||||
<div class="row-control">
|
||||
<div class="row-fluid" style="padding:0px;margin:0px;position:relative;">
|
||||
<div class="row-fluid grafana-row" style="padding:0px;margin:0px;position:relative;">
|
||||
|
||||
<div class="row-close span12" ng-show="row.collapse" data-placement="bottom" >
|
||||
<span class="row-button" bs-modal="'app/partials/roweditor.html'" class="pointer">
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
<div class="span1">
|
||||
<label class="small"> Hints <tip>Show 'Add panel' hints in empty spaces</tip></label><input type="checkbox" ng-model="dashboard.current.panel_hints" ng-checked="dashboard.current.panel_hints" />
|
||||
</div>
|
||||
<div class="span2">
|
||||
<label class="small">Hide controls</label>
|
||||
<input type="checkbox" ng-model="dashboard.current.hideControls" ng-checked="dashboard.current.hideControls">
|
||||
</div>
|
||||
<div class="span3">
|
||||
<label class="small">Style</label><select class="input-small" ng-model="dashboard.current.style" ng-options="f for f in ['dark','light']"></select>
|
||||
</div>
|
||||
|
||||
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
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>Grafana</title>
|
||||
<link rel="stylesheet" href="css/bootstrap.light.min.css" title="Light">
|
||||
<link rel="stylesheet" href="css/bootstrap.dark.min.css" title="Light">
|
||||
<link rel="stylesheet" href="css/timepicker.css">
|
||||
<link rel="stylesheet" href="css/animate.min.css">
|
||||
<link rel="stylesheet" href="css/normalize.min.css">
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
@import "bootswatch.dark.less";
|
||||
@import "overrides.less";
|
||||
@import "variables.dark.less";
|
||||
@import "grafana.less";
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
.grafana-dashboard-hide-controls {
|
||||
padding: 0;
|
||||
.extra, .grafana-row {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user