diff --git a/ui/src/app/components/dashboard.directive.js b/ui/src/app/components/dashboard.directive.js index f748d52066..dc550ecd25 100644 --- a/ui/src/app/components/dashboard.directive.js +++ b/ui/src/app/components/dashboard.directive.js @@ -181,12 +181,15 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $ vm.widgetCol = widgetCol; vm.widgetStyle = widgetStyle; vm.showWidgetTitle = showWidgetTitle; + vm.showWidgetTitleIcon = showWidgetTitleIcon; vm.hasWidgetTitleTemplate = hasWidgetTitleTemplate; vm.widgetTitleTemplate = widgetTitleTemplate; vm.showWidgetTitlePanel = showWidgetTitlePanel; vm.showWidgetActions = showWidgetActions; vm.widgetTitleStyle = widgetTitleStyle; vm.widgetTitle = widgetTitle; + vm.widgetTitleIcon = widgetTitleIcon; + vm.widgetTitleIconStyle = widgetTitleIconStyle; vm.customWidgetHeaderActions = customWidgetHeaderActions; vm.widgetActions = widgetActions; vm.dropWidgetShadow = dropWidgetShadow; @@ -880,6 +883,14 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $ } } + function showWidgetTitleIcon(widget) { + if (angular.isDefined(widget.config.showTitleIcon)) { + return widget.config.showTitleIcon; + } else { + return false; + } + } + function hasWidgetTitleTemplate(widget) { var ctx = widgetContext(widget); if (ctx && ctx.widgetTitleTemplate) { @@ -934,6 +945,25 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $ } } + function widgetTitleIcon(widget) { + if (angular.isDefined(widget.config.titleIcon)) { + return widget.config.titleIcon; + } else { + return ''; + } + } + + function widgetTitleIconStyle(widget) { + var style = {}; + if (angular.isDefined(widget.config.iconColor)) { + style.color = widget.config.iconColor; + } + if (angular.isDefined(widget.config.iconSize)) { + style.fontSize = widget.config.iconSize; + } + return style; + } + function customWidgetHeaderActions(widget) { var ctx = widgetContext(widget); if (ctx && ctx.customHeaderActions && ctx.customHeaderActions.length) { diff --git a/ui/src/app/components/dashboard.tpl.html b/ui/src/app/components/dashboard.tpl.html index 6687058216..9e6b81fd71 100644 --- a/ui/src/app/components/dashboard.tpl.html +++ b/ui/src/app/components/dashboard.tpl.html @@ -47,7 +47,12 @@