diff --git a/ui/src/app/api/time.service.js b/ui/src/app/api/time.service.js
index 6d6fe8b730..878d43eed8 100644
--- a/ui/src/app/api/time.service.js
+++ b/ui/src/app/api/time.service.js
@@ -234,7 +234,10 @@ function TimeService($translate, $http, $q, types) {
var currentTime = (new Date).getTime();
var timewindow = {
displayValue: "",
- selectedTab: 0,
+ selectedTab: 0,
+ hideInterval: false,
+ hideAggregation: false,
+ hideAggInterval: false,
realtime: {
interval: SECOND,
timewindowMs: MINUTE // 1 min by default
@@ -381,4 +384,4 @@ function TimeService($translate, $http, $q, types) {
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/components/dashboard.tpl.html b/ui/src/app/components/dashboard.tpl.html
index e136851fce..03e4c75947 100644
--- a/ui/src/app/components/dashboard.tpl.html
+++ b/ui/src/app/components/dashboard.tpl.html
@@ -56,7 +56,8 @@
-
+
diff --git a/ui/src/app/components/timeinterval.directive.js b/ui/src/app/components/timeinterval.directive.js
index 812ed3944f..882c58a762 100644
--- a/ui/src/app/components/timeinterval.directive.js
+++ b/ui/src/app/components/timeinterval.directive.js
@@ -231,7 +231,9 @@ function Timeinterval($compile, $templateCache, timeService) {
required: '=ngRequired',
min: '=?',
max: '=?',
- predefinedName: '=?'
+ predefinedName: '=?',
+ hideFlag: '=?',
+ isEdit: '=?'
},
link: linker
};
diff --git a/ui/src/app/components/timeinterval.tpl.html b/ui/src/app/components/timeinterval.tpl.html
index ff378f3257..02bb61fc7c 100644
--- a/ui/src/app/components/timeinterval.tpl.html
+++ b/ui/src/app/components/timeinterval.tpl.html
@@ -16,7 +16,12 @@
-->
-
+
+
-
+
-
+
{{interval.name}}
-
+
-
+
diff --git a/ui/src/app/components/timewindow-panel.controller.js b/ui/src/app/components/timewindow-panel.controller.js
index aa61a09200..092d2a9b4e 100644
--- a/ui/src/app/components/timewindow-panel.controller.js
+++ b/ui/src/app/components/timewindow-panel.controller.js
@@ -14,7 +14,7 @@
* limitations under the License.
*/
/*@ngInject*/
-export default function TimewindowPanelController(mdPanelRef, $scope, timeService, types, timewindow, historyOnly, aggregation, onTimewindowUpdate) {
+export default function TimewindowPanelController(mdPanelRef, $scope, timeService, types, timewindow, historyOnly, aggregation, isEdit, onTimewindowUpdate) {
var vm = this;
@@ -33,6 +33,7 @@ export default function TimewindowPanelController(mdPanelRef, $scope, timeServic
vm.maxHistoryAggInterval = maxHistoryAggInterval;
vm.minDatapointsLimit = minDatapointsLimit;
vm.maxDatapointsLimit = maxDatapointsLimit;
+ vm.isEdit = isEdit;
if (vm.historyOnly) {
vm.timewindow.selectedTab = 1;
diff --git a/ui/src/app/components/timewindow-panel.tpl.html b/ui/src/app/components/timewindow-panel.tpl.html
index 8416a1bf86..98608c994a 100644
--- a/ui/src/app/components/timewindow-panel.tpl.html
+++ b/ui/src/app/components/timewindow-panel.tpl.html
@@ -22,62 +22,92 @@
-
-
-
-
-
-
-
-
- timewindow.time-period
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ timewindow.time-period
+
+
+
+
+
+
+
-
-
-
-
- {{type.name | translate}}
-
-
-
-
- aggregation.limit
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{type.name | translate}}
+
+
+
+
+
+
+
-
+
@@ -93,4 +123,4 @@
-
\ No newline at end of file
+
diff --git a/ui/src/app/components/timewindow.directive.js b/ui/src/app/components/timewindow.directive.js
index 67b23a65a5..70342abd11 100644
--- a/ui/src/app/components/timewindow.directive.js
+++ b/ui/src/app/components/timewindow.directive.js
@@ -42,7 +42,10 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
var linker = function (scope, element, attrs, ngModelCtrl) {
/* tbTimewindow (ng-model)
- * {
+ * {
+ * hideInterval: false,
+ * hideAggregation: false,
+ * hideAggInterval: false,
* realtime: {
* interval: 0,
* timewindowMs: 0
@@ -64,6 +67,8 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
scope.historyOnly = angular.isDefined(attrs.historyOnly);
+ scope.isEdit = attrs.isEdit === 'true';
+
scope.aggregation = scope.$eval(attrs.aggregation);
scope.isToolbar = angular.isDefined(attrs.isToolbar);
@@ -135,7 +140,8 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
locals: {
'timewindow': angular.copy(scope.model),
'historyOnly': scope.historyOnly,
- 'aggregation': scope.aggregation,
+ 'aggregation': scope.aggregation,
+ 'isEdit': scope.isEdit,
'onTimewindowUpdate': function (timewindow) {
scope.model = timewindow;
scope.updateView();
@@ -176,7 +182,10 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
value.aggregation = {
type: model.aggregation.type,
limit: model.aggregation.limit
- };
+ };
+ value.hideInterval = model.hideInterval;
+ value.hideAggregation = model.hideAggregation;
+ value.hideAggInterval = model.hideAggInterval;
ngModelCtrl.$setViewValue(value);
scope.updateDisplayValue();
}
@@ -230,6 +239,9 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
}
model.aggregation.limit = value.aggregation.limit || Math.floor(timeService.getMaxDatapointsLimit() / 2);
}
+ model.hideInterval = value.hideInterval;
+ model.hideAggregation = value.hideAggregation;
+ model.hideAggInterval = value.hideAggInterval;
}
scope.updateDisplayValue();
};
@@ -242,7 +254,9 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
require: "^ngModel",
scope: {
asButton: '=asButton',
- disabled:'=ngDisabled'
+ disabled:'=ngDisabled',
+ isEdit: '=?'
+
},
link: linker
};
@@ -279,4 +293,4 @@ function MillisecondsToTimeString($translate) {
return timeString;
}
}
-/* eslint-enable angular/angularelement */
\ No newline at end of file
+/* eslint-enable angular/angularelement */
diff --git a/ui/src/app/components/widget/widget-config.tpl.html b/ui/src/app/components/widget/widget-config.tpl.html
index 239853087a..e5ac7b62b2 100644
--- a/ui/src/app/components/widget/widget-config.tpl.html
+++ b/ui/src/app/components/widget/widget-config.tpl.html
@@ -34,7 +34,7 @@
widget-config.timewindow
+ is-edit="true" flex ng-model="timewindow">
file_download
diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json
index af49a7b0b3..3a9ef7ed09 100644
--- a/ui/src/app/locale/locale.constant-en_US.json
+++ b/ui/src/app/locale/locale.constant-en_US.json
@@ -1412,7 +1412,8 @@
"edit": "Edit timewindow",
"date-range": "Date range",
"last": "Last",
- "time-period": "Time period"
+ "time-period": "Time period",
+ "hide": "Hide"
},
"user": {
"user": "User",
diff --git a/ui/src/app/locale/locale.constant-es_ES.json b/ui/src/app/locale/locale.constant-es_ES.json
index fbda6661af..5e296fb3f4 100644
--- a/ui/src/app/locale/locale.constant-es_ES.json
+++ b/ui/src/app/locale/locale.constant-es_ES.json
@@ -1411,7 +1411,8 @@
"edit": "Editar ventana de tiempo",
"date-range": "Rango de fecha",
"last": "Último(s)",
- "time-period": "Período de tiempo"
+ "time-period": "Período de tiempo",
+ "hide": "Ocultar"
},
"user": {
"user": "Usuario",
diff --git a/ui/src/app/locale/locale.constant-fr_FR.json b/ui/src/app/locale/locale.constant-fr_FR.json
index 9713de7626..0a073519f5 100644
--- a/ui/src/app/locale/locale.constant-fr_FR.json
+++ b/ui/src/app/locale/locale.constant-fr_FR.json
@@ -1263,7 +1263,8 @@
"period": "de {{startTime}} à {{endTime}}",
"realtime": "Temps réel",
"seconds": "{seconds, plural, 0 {second} 1 {1 second} other {# seconds}}",
- "time-period": "Période"
+ "time-period": "Période",
+ "hide": "Masquer"
},
"user": {
"activation-email-sent-message": "L'e-mail d'activation a été envoyé avec succès!",
diff --git a/ui/src/app/locale/locale.constant-it_IT.json b/ui/src/app/locale/locale.constant-it_IT.json
index f2f04c47a9..5cde58a83c 100644
--- a/ui/src/app/locale/locale.constant-it_IT.json
+++ b/ui/src/app/locale/locale.constant-it_IT.json
@@ -1353,7 +1353,8 @@
"edit": "Modifica intervallo temporale",
"date-range": "Intervallo date",
"last": "Ultimo",
- "time-period": "Intervallo temporale"
+ "time-period": "Intervallo temporale",
+ "hide": "Nascondi"
},
"user": {
"user": "Utente",