mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into alerting_influxdb
This commit is contained in:
commit
b841e649ab
@ -43,7 +43,7 @@ function (_, $, coreModule) {
|
|||||||
var selected = _.find($scope.altSegments, {value: value});
|
var selected = _.find($scope.altSegments, {value: value});
|
||||||
if (selected) {
|
if (selected) {
|
||||||
segment.value = selected.value;
|
segment.value = selected.value;
|
||||||
segment.html = selected.html;
|
segment.html = selected.html || selected.value;
|
||||||
segment.fake = false;
|
segment.fake = false;
|
||||||
segment.expandable = selected.expandable;
|
segment.expandable = selected.expandable;
|
||||||
}
|
}
|
||||||
@ -186,27 +186,26 @@ function (_, $, coreModule) {
|
|||||||
|
|
||||||
$scope.getOptionsInternal = function() {
|
$scope.getOptionsInternal = function() {
|
||||||
if ($scope.options) {
|
if ($scope.options) {
|
||||||
cachedOptions = _.map($scope.options, function(option) {
|
cachedOptions = $scope.options;
|
||||||
return uiSegmentSrv.newSegment({value: option.text});
|
return $q.when(_.map($scope.options, function(option) {
|
||||||
});
|
return {value: option.text};
|
||||||
return $q.when(cachedOptions);
|
}));
|
||||||
} else {
|
} else {
|
||||||
return $scope.getOptions().then(function(options) {
|
return $scope.getOptions().then(function(options) {
|
||||||
cachedOptions =_.map(options, function(option) {
|
cachedOptions = options;
|
||||||
|
return _.map(options, function(option) {
|
||||||
if (option.html) {
|
if (option.html) {
|
||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
return uiSegmentSrv.newSegment({value: option.text});
|
return {value: option.text};
|
||||||
});
|
});
|
||||||
return cachedOptions;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.onSegmentChange = function() {
|
$scope.onSegmentChange = function() {
|
||||||
|
|
||||||
if (cachedOptions) {
|
if (cachedOptions) {
|
||||||
var option = _.find(cachedOptions, {value: $scope.segment.value});
|
var option = _.find(cachedOptions, {text: $scope.segment.value});
|
||||||
if (option && option.value !== $scope.property) {
|
if (option && option.value !== $scope.property) {
|
||||||
$scope.property = option.value;
|
$scope.property = option.value;
|
||||||
} else if (attrs.custom !== 'false') {
|
} else if (attrs.custom !== 'false') {
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span ng-if="dash.imported" bs-tooltip='"Imported revision:" + dash.importedRevision'>
|
<span>
|
||||||
Revision: {{dash.revision}}
|
Revision: {{dash.revision}}
|
||||||
|
<span ng-if="dash.imported" class="small">(Imported: {{dash.importedRevision}})</span>
|
||||||
<span>
|
<span>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: right">
|
<td style="text-align: right">
|
||||||
@ -23,7 +24,8 @@
|
|||||||
Import
|
Import
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-secondary btn-small" ng-click="ctrl.import(dash, true)" ng-show="dash.imported">
|
<button class="btn btn-secondary btn-small" ng-click="ctrl.import(dash, true)" ng-show="dash.imported">
|
||||||
Update
|
<span ng-if="dash.revision !== dash.importedRevision">Update</span>
|
||||||
|
<span ng-if="dash.revision === dash.importedRevision">Re-import</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger btn-small" ng-click="ctrl.remove(dash)" ng-show="dash.imported">
|
<button class="btn btn-danger btn-small" ng-click="ctrl.remove(dash)" ng-show="dash.imported">
|
||||||
<i class="fa fa-trash"></i>
|
<i class="fa fa-trash"></i>
|
||||||
|
@ -22,7 +22,7 @@ function (_) {
|
|||||||
bucketAggTypes: [
|
bucketAggTypes: [
|
||||||
{text: "Terms", value: 'terms', requiresField: true},
|
{text: "Terms", value: 'terms', requiresField: true},
|
||||||
{text: "Filters", value: 'filters' },
|
{text: "Filters", value: 'filters' },
|
||||||
{text: "Geo Hash Grid", value: 'geohash_grid', requiresField: true},
|
{text: "Geo Hash Grid", value: 'geohash_grid', requiresField: true},
|
||||||
{text: "Date Histogram", value: 'date_histogram', requiresField: true},
|
{text: "Date Histogram", value: 'date_histogram', requiresField: true},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user