luci-app-statistics: fix APC UPS host configuration
authorJo-Philipp Wich <jo@mein.io>
Mon, 26 Apr 2021 15:38:48 +0000 (17:38 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 26 Apr 2021 15:40:23 +0000 (17:40 +0200)
Ensure that list of hosts is stored as space separated list, like it was
done in the previous Lua implementation.

Fixes: #5010
Fixes: e7d22dce5 ("luci-app-statistics: convert collectd configuration to client side views")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js

index 89b861a84bc3a641d455099f8996c8da7c8ed677..17ec51be5379ec7742070a7f3a964220c4ebaec7 100644 (file)
@@ -15,6 +15,9 @@ return baseclass.extend({
                o.default = 'localhost';
                o.datatype = 'host';
                o.depends('enable', '1');
+               o.write = function(section_id, value) {
+                       return form.Value.prototype.write.call(this, section_id, L.toArray(value).join(' '));
+               };
 
                o = s.option(form.Value, 'Port', _('Port for apcupsd communication'));
                o.default = '3551';