diff --git a/ui/src/app/widget/lib/multiple-input-widget.js b/ui/src/app/widget/lib/multiple-input-widget.js index 54f163dc92..ad8972ff7d 100644 --- a/ui/src/app/widget/lib/multiple-input-widget.js +++ b/ui/src/app/widget/lib/multiple-input-widget.js @@ -56,6 +56,7 @@ function MultipleInputWidgetController($q, $scope, attributeService, toast, type vm.datasources = null; vm.cellStyle = cellStyle; + vm.textColor = textColor; vm.discardAll = discardAll; vm.inputChanged = inputChanged; vm.postData = postData; @@ -82,7 +83,7 @@ function MultipleInputWidgetController($q, $scope, attributeService, toast, type return {}; } - function cellStyle(key) { + function cellStyle(key, rowIndex, firstKey, lastKey) { var style = {}; if (key) { var styleInfo = vm.stylesInfo[key.label]; @@ -97,6 +98,33 @@ function MultipleInputWidgetController($q, $scope, attributeService, toast, type style = defaultStyle(); } } + if (vm.settings.rowMargin) { + if (angular.isUndefined(style.marginTop) && rowIndex != 0) { + style.marginTop = (vm.settings.rowMargin / 2) + 'px'; + } + if (angular.isUndefined(style.marginBottom)) { + style.marginBottom = (vm.settings.rowMargin / 2) + 'px'; + } + } + if (vm.settings.columnMargin) { + if (angular.isUndefined(style.marginLeft) && !firstKey) { + style.marginLeft = (vm.settings.columnMargin / 2) + 'px'; + } + if (angular.isUndefined(style.marginRight) && !lastKey) { + style.marginRight = (vm.settings.columnMargin / 2) + 'px'; + } + } + return style; + } + + function textColor(key) { + var style = {}; + if (key) { + var styleInfo = vm.stylesInfo[key.label]; + if (styleInfo.color) { + style = { color: styleInfo.color }; + } + } return style; } @@ -232,7 +260,8 @@ function MultipleInputWidgetController($q, $scope, attributeService, toast, type vm.stylesInfo[dataKey.label] = { useCellStyleFunction: useCellStyleFunction, - cellStyleFunction: cellStyleFunction + cellStyleFunction: cellStyleFunction, + color: keySettings.color }; row.data.push(dataKey); diff --git a/ui/src/app/widget/lib/multiple-input-widget.scss b/ui/src/app/widget/lib/multiple-input-widget.scss index ed8ae1c907..7e16b3f967 100644 --- a/ui/src/app/widget/lib/multiple-input-widget.scss +++ b/ui/src/app/widget/lib/multiple-input-widget.scss @@ -46,10 +46,3 @@ md-toast { font-size: 14px !important; } } - -.footer { - position: absolute; - bottom: 0; - left: 0; - width: 100%; -} diff --git a/ui/src/app/widget/lib/multiple-input-widget.tpl.html b/ui/src/app/widget/lib/multiple-input-widget.tpl.html index 6fb935bea8..1263919825 100644 --- a/ui/src/app/widget/lib/multiple-input-widget.tpl.html +++ b/ui/src/app/widget/lib/multiple-input-widget.tpl.html @@ -15,22 +15,34 @@ limitations under the License. --> -
+
-
-
- - - +
+
+ + + + + + {{key.settings.icon}} - +
+
Value must be greater than {{key.settings.min}}
+
Value must be lower than {{key.settings.max}}
+
This field is required
+
@@ -44,12 +56,12 @@ Timeseries parameter cannot be used in this widget
-