|
|
@@ -28,6 +28,8 @@ function (angular, _, InfluxQueryBuilder, InfluxQuery, queryPart) {
|
|
|
{text: 'Table', value: 'table'},
|
|
|
];
|
|
|
|
|
|
+ $scope.policySegment = uiSegmentSrv.newSegment($scope.target.policy);
|
|
|
+
|
|
|
if (!$scope.target.measurement) {
|
|
|
$scope.measurementSegment = uiSegmentSrv.newSelectMeasurement();
|
|
|
} else {
|
|
|
@@ -131,6 +133,18 @@ function (angular, _, InfluxQueryBuilder, InfluxQuery, queryPart) {
|
|
|
$scope.get_data();
|
|
|
};
|
|
|
|
|
|
+ $scope.getPolicySegments = function() {
|
|
|
+ var policiesQuery = $scope.queryBuilder.buildExploreQuery('RETENTION POLICIES');
|
|
|
+ return $scope.datasource.metricFindQuery(policiesQuery)
|
|
|
+ .then($scope.transformToSegments(false))
|
|
|
+ .then(null, $scope.handleQueryError);
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.policyChanged = function() {
|
|
|
+ $scope.target.policy = $scope.policySegment.value;
|
|
|
+ $scope.get_data();
|
|
|
+ };
|
|
|
+
|
|
|
$scope.toggleQueryMode = function () {
|
|
|
$scope.target.rawQuery = !$scope.target.rawQuery;
|
|
|
};
|