mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' of github.com:torkelo/grafana-private
This commit is contained in:
commit
71ab8d6afc
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
**New features**
|
**New features**
|
||||||
- [Issue #1331](https://github.com/grafana/grafana/issues/1331). Graph & Singlestat: New axis/unit format selector and more units (kbytes, Joule, Watt, eV), and new design for graph axis & grid tab and single stat options tab views
|
- [Issue #1331](https://github.com/grafana/grafana/issues/1331). Graph & Singlestat: New axis/unit format selector and more units (kbytes, Joule, Watt, eV), and new design for graph axis & grid tab and single stat options tab views
|
||||||
|
- [Issue #1241](https://github.com/grafana/grafana/issues/1242). Timepicker: New option in timepicker (under dashboard settings), to change ``now`` to be for example ``now-1m``, usefull when you want to ignore last minute because it contains incomplete data
|
||||||
|
- [Issue #171](https://github.com/grafana/grafana/issues/171). Panel: Different time periods, panels can override dashboard relative time and/or add a time shift
|
||||||
|
|
||||||
**Enhancements**
|
**Enhancements**
|
||||||
- [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
|
- [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
|
||||||
@ -13,6 +15,9 @@
|
|||||||
- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
|
- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
|
||||||
- [Issue #1309](https://github.com/grafana/grafana/issues/1309). Graph: Fixed issue when using zero as a grid threshold
|
- [Issue #1309](https://github.com/grafana/grafana/issues/1309). Graph: Fixed issue when using zero as a grid threshold
|
||||||
- [Issue #1345](https://github.com/grafana/grafana/issues/1345). UI: Fixed position of confirm modal when scrolled down
|
- [Issue #1345](https://github.com/grafana/grafana/issues/1345). UI: Fixed position of confirm modal when scrolled down
|
||||||
|
- [Issue #1372](https://github.com/grafana/grafana/issues/1372). Graphite: Fix for nested complex queries, where a query references a query that references another query (ie the #[A-Z] syntax)
|
||||||
|
- [Issue #1363](https://github.com/grafana/grafana/issues/1363). Templating: Fix to allow custom template variables to contain white space, now only splits on ','
|
||||||
|
- [Issue #1359](https://github.com/grafana/grafana/issues/1359). Graph: Fix for all series tooltip showing series with all null values when ``Hide Empty`` option is enabled
|
||||||
|
|
||||||
**Tech**
|
**Tech**
|
||||||
- [Issue #1311](https://github.com/grafana/grafana/issues/1311). Tech: Updated Font-Awesome from 3.2 to 4.2
|
- [Issue #1311](https://github.com/grafana/grafana/issues/1311). Tech: Updated Font-Awesome from 3.2 to 4.2
|
||||||
|
43
src/app/features/dashboard/partials/panelTime.html
Normal file
43
src/app/features/dashboard/partials/panelTime.html
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<div class="editor-row">
|
||||||
|
<div class="section" style="margin-bottom: 20px">
|
||||||
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item tight-form-item-icon">
|
||||||
|
<i class="fa fa-clock-o"></i>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item" style="width: 148px">
|
||||||
|
<strong>Override relative time</strong>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item" style="width: 50px">
|
||||||
|
Last
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" class="input-small tight-form-input" placeholder="1h"
|
||||||
|
empty-to-null ng-model="panel.timeFrom"
|
||||||
|
ng-change="get_data()" ng-model-onblur>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item tight-form-item-icon">
|
||||||
|
<i class="fa fa-clock-o"></i>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item" style="width: 148px">
|
||||||
|
<strong>Add time shift</strong>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item" style="width: 50px">
|
||||||
|
Amount
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" class="input-small tight-form-input" placeholder="1h"
|
||||||
|
empty-to-null ng-model="panel.timeShift"
|
||||||
|
ng-change="get_data()" ng-model-onblur>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -19,12 +19,23 @@ define([
|
|||||||
this.time = dashboard.time;
|
this.time = dashboard.time;
|
||||||
|
|
||||||
this._initTimeFromUrl();
|
this._initTimeFromUrl();
|
||||||
|
this._parseTime();
|
||||||
|
|
||||||
if(this.dashboard.refresh) {
|
if(this.dashboard.refresh) {
|
||||||
this.set_interval(this.dashboard.refresh);
|
this.set_interval(this.dashboard.refresh);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this._parseTime = function() {
|
||||||
|
// when absolute time is saved in json it is turned to a string
|
||||||
|
if (_.isString(this.time.from) && this.time.from.indexOf('Z') >= 0) {
|
||||||
|
this.time.from = new Date(this.time.from);
|
||||||
|
}
|
||||||
|
if (_.isString(this.time.to) && this.time.to.indexOf('Z') >= 0) {
|
||||||
|
this.time.to = new Date(this.time.to);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this._parseUrlParam = function(value) {
|
this._parseUrlParam = function(value) {
|
||||||
if (value.indexOf('now') !== -1) {
|
if (value.indexOf('now') !== -1) {
|
||||||
return value;
|
return value;
|
||||||
@ -109,9 +120,7 @@ define([
|
|||||||
|
|
||||||
this.timeRange = function(parse) {
|
this.timeRange = function(parse) {
|
||||||
var _t = this.time;
|
var _t = this.time;
|
||||||
if(_.isUndefined(_t) || _.isUndefined(_t.from)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(parse === false) {
|
if(parse === false) {
|
||||||
return {
|
return {
|
||||||
from: _t.from,
|
from: _t.from,
|
||||||
|
@ -276,6 +276,7 @@ function (angular, _, $, config, kbn, moment) {
|
|||||||
|
|
||||||
targetValue = targets[this._seriesRefLetters[i]];
|
targetValue = targets[this._seriesRefLetters[i]];
|
||||||
targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);
|
targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);
|
||||||
|
targets[this._seriesRefLetters[i]] = targetValue;
|
||||||
|
|
||||||
clean_options.push("target=" + encodeURIComponent(targetValue));
|
clean_options.push("target=" + encodeURIComponent(targetValue));
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ function (angular, _, config, gfunc, Parser) {
|
|||||||
function MetricSegment(options) {
|
function MetricSegment(options) {
|
||||||
if (options === '*' || options.value === '*') {
|
if (options === '*' || options.value === '*') {
|
||||||
this.value = '*';
|
this.value = '*';
|
||||||
this.html = $sce.trustAsHtml('<i class="icon-asterisk"><i>');
|
this.html = $sce.trustAsHtml('<i class="fa fa-asterisk"><i>');
|
||||||
this.expandable = true;
|
this.expandable = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
var fromIsAbsolute = from[from.length-1] === 's';
|
var fromIsAbsolute = from[from.length-1] === 's';
|
||||||
|
|
||||||
if (until === 'now()' && !fromIsAbsolute) {
|
if (until === 'now()' && !fromIsAbsolute) {
|
||||||
return 'time > now() - ' + from;
|
return 'time > ' + from;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'time > ' + from + ' and time < ' + until;
|
return 'time > ' + from + ' and time < ' + until;
|
||||||
@ -382,14 +382,7 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
|
|
||||||
function getInfluxTime(date) {
|
function getInfluxTime(date) {
|
||||||
if (_.isString(date)) {
|
if (_.isString(date)) {
|
||||||
if (date === 'now') {
|
return date.replace('now', 'now()');
|
||||||
return 'now()';
|
|
||||||
}
|
|
||||||
else if (date.indexOf('now') >= 0) {
|
|
||||||
return date.substring(4);
|
|
||||||
}
|
|
||||||
|
|
||||||
date = kbn.parseDate(date);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return to_utc_epoch_seconds(date);
|
return to_utc_epoch_seconds(date);
|
||||||
|
@ -81,8 +81,8 @@ function (angular, _, kbn) {
|
|||||||
|
|
||||||
this._updateNonQueryVariable = function(variable) {
|
this._updateNonQueryVariable = function(variable) {
|
||||||
// extract options in comma seperated string
|
// extract options in comma seperated string
|
||||||
variable.options = _.map(variable.query.split(/[\s,]+/), function(text) {
|
variable.options = _.map(variable.query.split(/[,]+/), function(text) {
|
||||||
return { text: text, value: text };
|
return { text: text.trim(), value: text.trim() };
|
||||||
});
|
});
|
||||||
|
|
||||||
if (variable.type === 'interval') {
|
if (variable.type === 'interval') {
|
||||||
|
@ -71,7 +71,7 @@ function ($) {
|
|||||||
for (i = 0; i < seriesList.length; i++) {
|
for (i = 0; i < seriesList.length; i++) {
|
||||||
series = seriesList[i];
|
series = seriesList[i];
|
||||||
|
|
||||||
if (!series.data.length) {
|
if (!series.data.length || (scope.panel.legend.hideEmpty && series.allIsNull)) {
|
||||||
results.push({ hidden: true });
|
results.push({ hidden: true });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ function ($) {
|
|||||||
value = series.formatValue(hoverInfo.value);
|
value = series.formatValue(hoverInfo.value);
|
||||||
|
|
||||||
seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
|
seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
|
||||||
seriesHtml += '<i class="icon-minus" style="color:' + series.color +';"></i> ' + series.label + ':</div>';
|
seriesHtml += '<i class="fa fa-minus" style="color:' + series.color +';"></i> ' + series.label + ':</div>';
|
||||||
seriesHtml += '<div class="graph-tooltip-value">' + value + '</div></div>';
|
seriesHtml += '<div class="graph-tooltip-value">' + value + '</div></div>';
|
||||||
plot.highlight(i, hoverInfo.hoverIndex);
|
plot.highlight(i, hoverInfo.hoverIndex);
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ function ($) {
|
|||||||
else if (item) {
|
else if (item) {
|
||||||
series = seriesList[item.seriesIndex];
|
series = seriesList[item.seriesIndex];
|
||||||
group = '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
|
group = '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
|
||||||
group += '<i class="icon-minus" style="color:' + item.series.color +';"></i> ' + series.label + ':</div>';
|
group += '<i class="fa fa-minus" style="color:' + item.series.color +';"></i> ' + series.label + ':</div>';
|
||||||
|
|
||||||
if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') {
|
if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') {
|
||||||
value = item.datapoint[1] - item.datapoint[2];
|
value = item.datapoint[1] - item.datapoint[2];
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': panel.legend.rightSide}">
|
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': panel.legend.rightSide}">
|
||||||
<div class="graph-canvas-wrapper">
|
<div class="graph-canvas-wrapper">
|
||||||
|
|
||||||
|
<span class="graph-time-info" ng-if="panelMeta.timeInfo">
|
||||||
|
<i class="fa fa-clock-o"></i> {{panelMeta.timeInfo}}
|
||||||
|
</span>
|
||||||
|
|
||||||
<div ng-if="datapointsWarning" class="datapoints-warning">
|
<div ng-if="datapointsWarning" class="datapoints-warning">
|
||||||
<span class="small" ng-show="!datapointsCount">
|
<span class="small" ng-show="!datapointsCount">
|
||||||
No datapoints <tip>No datapoints returned from metric query</tip>
|
No datapoints <tip>No datapoints returned from metric query</tip>
|
||||||
|
@ -26,6 +26,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
|
|||||||
|
|
||||||
$scope.panelMeta.addEditorTab('Axes & Grid', 'app/panels/graph/axisEditor.html');
|
$scope.panelMeta.addEditorTab('Axes & Grid', 'app/panels/graph/axisEditor.html');
|
||||||
$scope.panelMeta.addEditorTab('Display Styles', 'app/panels/graph/styleEditor.html');
|
$scope.panelMeta.addEditorTab('Display Styles', 'app/panels/graph/styleEditor.html');
|
||||||
|
$scope.panelMeta.addEditorTab('Time range', 'app/features/dashboard/partials/panelTime.html');
|
||||||
|
|
||||||
$scope.panelMeta.addExtendedMenuItem('Export CSV', '', 'exportCsv()');
|
$scope.panelMeta.addExtendedMenuItem('Export CSV', '', 'exportCsv()');
|
||||||
$scope.panelMeta.addExtendedMenuItem('Toggle legend', '', 'toggleLegend()');
|
$scope.panelMeta.addExtendedMenuItem('Toggle legend', '', 'toggleLegend()');
|
||||||
@ -88,6 +89,9 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
|
|||||||
value_type: 'cumulative',
|
value_type: 'cumulative',
|
||||||
shared: false,
|
shared: false,
|
||||||
},
|
},
|
||||||
|
// time overrides
|
||||||
|
timeFrom: null,
|
||||||
|
timeShift: null,
|
||||||
// metric queries
|
// metric queries
|
||||||
targets: [{}],
|
targets: [{}],
|
||||||
// series color overrides
|
// series color overrides
|
||||||
@ -114,6 +118,26 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
|
|||||||
$scope.updateTimeRange = function () {
|
$scope.updateTimeRange = function () {
|
||||||
$scope.range = timeSrv.timeRange();
|
$scope.range = timeSrv.timeRange();
|
||||||
$scope.rangeUnparsed = timeSrv.timeRange(false);
|
$scope.rangeUnparsed = timeSrv.timeRange(false);
|
||||||
|
|
||||||
|
$scope.panelMeta.timeInfo = "";
|
||||||
|
|
||||||
|
// check panel time overrrides
|
||||||
|
if ($scope.panel.timeFrom) {
|
||||||
|
if (_.isString($scope.rangeUnparsed.from)) {
|
||||||
|
$scope.panelMeta.timeInfo = "last " + $scope.panel.timeFrom;
|
||||||
|
$scope.rangeUnparsed.from = 'now-' + $scope.panel.timeFrom;
|
||||||
|
$scope.range.from = kbn.parseDate($scope.rangeUnparsed.from);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($scope.panel.timeShift) {
|
||||||
|
var timeShift = '-' + $scope.panel.timeShift;
|
||||||
|
$scope.panelMeta.timeInfo += ' timeshift ' + timeShift;
|
||||||
|
$scope.range.from = kbn.parseDateMath(timeShift, $scope.range.from);
|
||||||
|
$scope.range.to = kbn.parseDateMath(timeShift, $scope.range.to);
|
||||||
|
$scope.rangeUnparsed = $scope.range;
|
||||||
|
}
|
||||||
|
|
||||||
if ($scope.panel.maxDataPoints) {
|
if ($scope.panel.maxDataPoints) {
|
||||||
$scope.resolution = $scope.panel.maxDataPoints;
|
$scope.resolution = $scope.panel.maxDataPoints;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,38 @@
|
|||||||
<div class="editor-row">
|
<div class="editor-row">
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="editor-option">
|
<div class="tight-form">
|
||||||
<label class="small">Relative time options <small>comma seperated</small></label>
|
<ul class="tight-form-list">
|
||||||
<input type="text" array-join class="input-xlarge" ng-model="panel.time_options">
|
<li class="tight-form-item" style="width: 148px">
|
||||||
|
<strong>Relative time options</strong></small>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" class="input-xlarge tight-form-input"
|
||||||
|
ng-model="panel.time_options" array-join>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
Until
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
now-
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" class="input-mini tight-form-input last"
|
||||||
|
ng-model="panel.nowDelay" placeholder="0m" bs-tooltip="'Enter 1m to ignore the last minute (because it can contain incomplete metrics)'" data-placement="right">
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="editor-option">
|
<div class="tight-form">
|
||||||
<label class="small">Auto-refresh options <small>comma seperated</small></label>
|
<ul class="tight-form-list">
|
||||||
<input type="text" array-join class="input-xlarge" ng-model="panel.refresh_intervals">
|
<li class="tight-form-item" style="width: 148px">
|
||||||
|
<strong>Auto-refresh options</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" class="input-xlarge tight-form-input"
|
||||||
|
ng-model="panel.refresh_intervals" array-join>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -15,4 +41,4 @@
|
|||||||
For these changes to fully take effect save and reload the dashboard.
|
For these changes to fully take effect save and reload the dashboard.
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,10 +58,14 @@ function (angular, app, _, moment, kbn) {
|
|||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
var time = timeSrv.timeRange(true);
|
var time = timeSrv.timeRange(true);
|
||||||
if(time) {
|
$scope.panel.now = false;
|
||||||
$scope.panel.now = timeSrv.timeRange(false).to === "now" ? true : false;
|
|
||||||
$scope.time = getScopeTimeObj(time.from,time.to);
|
var unparsed = timeSrv.timeRange(false);
|
||||||
|
if (_.isString(unparsed.to) && unparsed.to.indexOf('now') === 0) {
|
||||||
|
$scope.panel.now = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.time = getScopeTimeObj(time.from, time.to);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.customTime = function() {
|
$scope.customTime = function() {
|
||||||
@ -142,6 +146,10 @@ function (angular, app, _, moment, kbn) {
|
|||||||
to: "now"
|
to: "now"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ($scope.panel.nowDelay) {
|
||||||
|
_filter.to = 'now-' + $scope.panel.nowDelay;
|
||||||
|
}
|
||||||
|
|
||||||
timeSrv.setTime(_filter);
|
timeSrv.setTime(_filter);
|
||||||
|
|
||||||
$scope.time = getScopeTimeObj(kbn.parseDate(_filter.from),new Date());
|
$scope.time = getScopeTimeObj(kbn.parseDate(_filter.from),new Date());
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
|
|
||||||
<div ng-show='dashboard.editable' class="row-fluid add-row-panel-hint">
|
<div ng-show='dashboard.editable' class="row-fluid add-row-panel-hint">
|
||||||
<div class="span12" style="text-align:right;">
|
<div class="span12" style="text-align:right;">
|
||||||
<span style="margin-right: 10px;" ng-click="add_row_default()" class="pointer btn btn-info btn-mini">
|
<span style="margin-right: 10px;" ng-click="add_row_default()" class="pointer btn btn-info btn-small">
|
||||||
<span><i class="fa fa-plus"></i> ADD ROW</span>
|
<span><i class="fa fa-plus"></i> ADD ROW</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
<td><i ng-click="_.move(dashboard.rows,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
<td><i ng-click="_.move(dashboard.rows,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||||
<td><i ng-click="_.move(dashboard.rows,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
<td><i ng-click="_.move(dashboard.rows,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||||
<td>
|
<td>
|
||||||
<a ng-click="dashboard.rows = _.without(dashboard.rows,row)" class="btn btn-danger btn-mini">
|
<a ng-click="dashboard.rows = _.without(dashboard.rows,row)" class="btn btn-danger btn-small">
|
||||||
<i class="fa fa-remove"></i>
|
<i class="fa fa-remove"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<td><i ng-click="_.move(row.panels,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
<td><i ng-click="_.move(row.panels,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||||
<td><i ng-click="_.move(row.panels,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
<td><i ng-click="_.move(row.panels,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||||
<td>
|
<td>
|
||||||
<a ng-click="row.panels = _.without(row.panels,panel)" class="btn btn-danger btn-mini">
|
<a ng-click="row.panels = _.without(row.panels,panel)" class="btn btn-danger btn-small">
|
||||||
<i class="fa fa-remove"></i>
|
<i class="fa fa-remove"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
{{variable.query}}
|
{{variable.query}}
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 1%">
|
<td style="width: 1%">
|
||||||
<a ng-click="edit(variable)" class="btn btn-success btn-mini">
|
<a ng-click="edit(variable)" class="btn btn-success btn-small">
|
||||||
<i class="fa fa-edit"></i>
|
<i class="fa fa-edit"></i>
|
||||||
Edit
|
Edit
|
||||||
</a>
|
</a>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||||
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
<td style="width: 1%"><i ng-click="_.move(variables,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||||
<td style="width: 1%">
|
<td style="width: 1%">
|
||||||
<a ng-click="removeVariable(variable)" class="btn btn-danger btn-mini">
|
<a ng-click="removeVariable(variable)" class="btn btn-danger btn-small">
|
||||||
<i class="fa fa-remove"></i>
|
<i class="fa fa-remove"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -141,7 +141,7 @@
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
top: -20px;
|
top: -25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graph-legend {
|
.graph-legend {
|
||||||
@ -260,7 +260,6 @@
|
|||||||
transform-origin: right top;
|
transform-origin: right top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.axisLabel {
|
.axisLabel {
|
||||||
color: @textColor;
|
color: @textColor;
|
||||||
font-size: @fontSizeSmall;
|
font-size: @fontSizeSmall;
|
||||||
@ -269,3 +268,13 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.graph-time-info {
|
||||||
|
font-weight: bold;
|
||||||
|
float: right;
|
||||||
|
margin-right: 15px;
|
||||||
|
color: @blue;
|
||||||
|
font-size: 85%;
|
||||||
|
position: relative;
|
||||||
|
top: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@
|
|||||||
|
|
||||||
.panel-loading {
|
.panel-loading {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top: 0px;
|
top: -3px;
|
||||||
right: 4px;
|
right: 0px;
|
||||||
z-index: 800;
|
z-index: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ define([
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
shared: true
|
shared: true
|
||||||
},
|
},
|
||||||
|
legend: { },
|
||||||
stack: false
|
stack: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,6 +74,13 @@ define([
|
|||||||
expect(results[2]).to.be('target=asPercent(series1%2Cseries2)');
|
expect(results[2]).to.be('target=asPercent(series1%2Cseries2)');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should replace target placeholder when nesting query references', function() {
|
||||||
|
var results = ctx.ds.buildGraphiteParams({
|
||||||
|
targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}]
|
||||||
|
});
|
||||||
|
expect(results[2]).to.be('target=' + encodeURIComponent("asPercent(series1,sumSeries(series1))"));
|
||||||
|
});
|
||||||
|
|
||||||
it('should fix wrong minute interval parameters', function() {
|
it('should fix wrong minute interval parameters', function() {
|
||||||
var results = ctx.ds.buildGraphiteParams({
|
var results = ctx.ds.buildGraphiteParams({
|
||||||
targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }]
|
targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }]
|
||||||
|
@ -17,7 +17,7 @@ define([
|
|||||||
describe('When querying influxdb with one target using query editor target spec', function() {
|
describe('When querying influxdb with one target using query editor target spec', function() {
|
||||||
var results;
|
var results;
|
||||||
var urlExpected = "/series?p=mupp&q=select+mean(value)+from+%22test%22"+
|
var urlExpected = "/series?p=mupp&q=select+mean(value)+from+%22test%22"+
|
||||||
"+where+time+%3E+now()+-+1h+group+by+time(1s)+order+asc";
|
"+where+time+%3E+now()-1h+group+by+time(1s)+order+asc";
|
||||||
var query = {
|
var query = {
|
||||||
range: { from: 'now-1h', to: 'now' },
|
range: { from: 'now-1h', to: 'now' },
|
||||||
targets: [{ series: 'test', column: 'value', function: 'mean' }],
|
targets: [{ series: 'test', column: 'value', function: 'mean' }],
|
||||||
@ -50,7 +50,7 @@ define([
|
|||||||
describe('When querying influxdb with one raw query', function() {
|
describe('When querying influxdb with one raw query', function() {
|
||||||
var results;
|
var results;
|
||||||
var urlExpected = "/series?p=mupp&q=select+value+from+series"+
|
var urlExpected = "/series?p=mupp&q=select+value+from+series"+
|
||||||
"+where+time+%3E+now()+-+1h";
|
"+where+time+%3E+now()-1h";
|
||||||
var query = {
|
var query = {
|
||||||
range: { from: 'now-1h', to: 'now' },
|
range: { from: 'now-1h', to: 'now' },
|
||||||
targets: [{ query: "select value from series where $timeFilter", rawQuery: true }]
|
targets: [{ query: "select value from series where $timeFilter", rawQuery: true }]
|
||||||
@ -73,7 +73,7 @@ define([
|
|||||||
describe('When issuing annotation query', function() {
|
describe('When issuing annotation query', function() {
|
||||||
var results;
|
var results;
|
||||||
var urlExpected = "/series?p=mupp&q=select+title+from+events.backend_01"+
|
var urlExpected = "/series?p=mupp&q=select+title+from+events.backend_01"+
|
||||||
"+where+time+%3E+now()+-+1h";
|
"+where+time+%3E+now()-1h";
|
||||||
|
|
||||||
var range = { from: 'now-1h', to: 'now' };
|
var range = { from: 'now-1h', to: 'now' };
|
||||||
var annotation = { query: 'select title from events.$server where $timeFilter' };
|
var annotation = { query: 'select title from events.$server where $timeFilter' };
|
||||||
|
@ -69,4 +69,15 @@ define([
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('relative time to date parsing', function() {
|
||||||
|
it('should handle negative time', function() {
|
||||||
|
var date = kbn.parseDateMath('-2d', new Date(2014,1,5));
|
||||||
|
expect(date.getTime()).to.equal(new Date(2014, 1, 3).getTime());
|
||||||
|
});
|
||||||
|
it('should handle multiple math expressions', function() {
|
||||||
|
var date = kbn.parseDateMath('-2d-6h', new Date(2014, 1, 5));
|
||||||
|
expect(date.toString()).to.equal(new Date(2014, 1, 2, 18).toString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user