allow widget timewindow hiding
This commit is contained in:
parent
12280f817a
commit
7383eee2ed
@ -979,7 +979,7 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $
|
||||
function hasTimewindow(widget) {
|
||||
if (widget.type === types.widgetType.timeseries.value || widget.type === types.widgetType.alarm.value) {
|
||||
return angular.isDefined(widget.config.useDashboardTimewindow) ?
|
||||
!widget.config.useDashboardTimewindow : false;
|
||||
(!widget.config.useDashboardTimewindow && (angular.isUndefined(widget.config.displayTimewindow) || widget.config.displayTimewindow)) : false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -124,6 +124,8 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
|
||||
scope.decimals = config.decimals;
|
||||
scope.useDashboardTimewindow = angular.isDefined(config.useDashboardTimewindow) ?
|
||||
config.useDashboardTimewindow : true;
|
||||
scope.displayTimewindow = angular.isDefined(config.displayTimewindow) ?
|
||||
config.displayTimewindow : true;
|
||||
scope.timewindow = config.timewindow;
|
||||
scope.showLegend = angular.isDefined(config.showLegend) ?
|
||||
config.showLegend : scope.widgetType === types.widgetType.timeseries.value;
|
||||
@ -230,7 +232,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
|
||||
};
|
||||
|
||||
scope.$watch('title + showTitle + dropShadow + enableFullscreen + backgroundColor + color + ' +
|
||||
'padding + margin + widgetStyle + titleStyle + mobileOrder + mobileHeight + units + decimals + useDashboardTimewindow + ' +
|
||||
'padding + margin + widgetStyle + titleStyle + mobileOrder + mobileHeight + units + decimals + useDashboardTimewindow + displayTimewindow + ' +
|
||||
'alarmSearchStatus + alarmsPollingInterval + showLegend', function () {
|
||||
if (ngModelCtrl.$viewValue) {
|
||||
var value = ngModelCtrl.$viewValue;
|
||||
@ -257,6 +259,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
|
||||
config.units = scope.units;
|
||||
config.decimals = scope.decimals;
|
||||
config.useDashboardTimewindow = scope.useDashboardTimewindow;
|
||||
config.displayTimewindow = scope.displayTimewindow;
|
||||
config.alarmSearchStatus = scope.alarmSearchStatus;
|
||||
config.alarmsPollingInterval = scope.alarmsPollingInterval;
|
||||
config.showLegend = scope.showLegend;
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
<md-checkbox flex aria-label="{{ 'widget-config.use-dashboard-timewindow' | translate }}"
|
||||
ng-model="useDashboardTimewindow">{{ 'widget-config.use-dashboard-timewindow' | translate }}
|
||||
</md-checkbox>
|
||||
<md-checkbox ng-disabled="useDashboardTimewindow" flex aria-label="{{ 'widget-config.display-timewindow' | translate }}"
|
||||
ng-model="displayTimewindow">{{ 'widget-config.display-timewindow' | translate }}
|
||||
</md-checkbox>
|
||||
<section flex layout="row" layout-align="start center" style="margin-bottom: 16px;">
|
||||
<span ng-class="{'tb-disabled-label': useDashboardTimewindow}" translate style="padding-right: 8px;">widget-config.timewindow</span>
|
||||
<tb-timewindow ng-disabled="useDashboardTimewindow" as-button="true" aggregation="{{ widgetType === types.widgetType.timeseries.value }}"
|
||||
|
||||
@ -287,6 +287,9 @@ export default function WidgetController($scope, $state, $timeout, $window, $ele
|
||||
options.useDashboardTimewindow = angular.isDefined(widget.config.useDashboardTimewindow)
|
||||
? widget.config.useDashboardTimewindow : true;
|
||||
|
||||
options.displayTimewindow = angular.isDefined(widget.config.displayTimewindow)
|
||||
? widget.config.displayTimewindow : !options.useDashboardTimewindow;
|
||||
|
||||
options.timeWindowConfig = options.useDashboardTimewindow ? vm.dashboardTimewindow : widget.config.timewindow;
|
||||
options.legendConfig = null;
|
||||
|
||||
|
||||
@ -1515,6 +1515,7 @@
|
||||
"decimals": "Anzahl der Stellen nach dem Fließkomma",
|
||||
"timewindow": "Zeitfenster",
|
||||
"use-dashboard-timewindow": "Dashboard-Zeitfenster verwenden",
|
||||
"display-timewindow": "Zeitfenster anzeigen",
|
||||
"display-legend": "Legende anzeigen",
|
||||
"datasources": "Datenquellen",
|
||||
"maximum-datasources": "Maximal { count, plural, 1 {1 Datenquelle ist erlaubt} other {# Datenquellen sind erlaubt} }.",
|
||||
|
||||
@ -1526,6 +1526,7 @@
|
||||
"decimals": "Number of digits after floating point",
|
||||
"timewindow": "Timewindow",
|
||||
"use-dashboard-timewindow": "Use dashboard timewindow",
|
||||
"display-timewindow": "Display timewindow",
|
||||
"display-legend": "Display legend",
|
||||
"datasources": "Datasources",
|
||||
"maximum-datasources": "Maximum { count, plural, 1 {1 datasource is allowed.} other {# datasources are allowed} }",
|
||||
|
||||
@ -1515,6 +1515,7 @@
|
||||
"decimals": "Número de dígitos después del punto flotante",
|
||||
"timewindow": "Ventana de tiempo",
|
||||
"use-dashboard-timewindow": "Utilizar ventana de tiempo del panel",
|
||||
"display-timewindow": "Mostrar ventana de tiempo",
|
||||
"display-legend": "Mostrar leyenda",
|
||||
"datasources": "Orígenes de datos",
|
||||
"maximum-datasources": "Máximo { count, plural, 1 {1 origen de datos permitido.} other {# origenes de datos permitidos} }",
|
||||
|
||||
@ -1405,6 +1405,7 @@
|
||||
"delete-action": "Supprimer l'action",
|
||||
"delete-action-text": "Etes-vous sûr de vouloir supprimer l'action du widget nommé '{{actionName}}'?",
|
||||
"delete-action-title": "Supprimer l'action du widget",
|
||||
"display-timewindow": "Afficher fenêtre de temps",
|
||||
"display-legend": "Afficher la légende",
|
||||
"display-title": "Afficher le titre",
|
||||
"drop-shadow": "Ombre portée",
|
||||
|
||||
@ -1520,6 +1520,7 @@
|
||||
"decimals": "Numero di cifre decimali",
|
||||
"timewindow": "Intervallo temporale",
|
||||
"use-dashboard-timewindow": "Usa intervallo temporale dashboard",
|
||||
"display-timewindow": "Mostra intervallo temporale",
|
||||
"display-legend": "Mostra legenda",
|
||||
"datasources": "Sorgenti dei dati",
|
||||
"maximum-datasources": "Massimo { count, plural, 1 {1 sorgente dati consentita.} other {# sorgenti dati consentite} }",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user