Skip to content

Commit

Permalink
luci-app-statistics: fix prepare values from list vlaues
Browse files Browse the repository at this point in the history
If UCI store values as a list instead of an option, conversation for the
collectd configuration is not work correctly. This is due to the use of
a DynamicList type element in the UI (for example, for the RRATimespans
field). For this function argument val receives as array instead of a
string, so no additional conversion is required.

Signed-off-by: Aleksey Kolosov <[email protected]>
  • Loading branch information
Softovick authored and systemcrash committed Nov 28, 2024
1 parent bbc4a90 commit 0a6a2f1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function parse_units(ustr) {

const preprocess = {
RRATimespans: function(val) {
return join(' ', map(split(val, /\s+/), parse_units));
return join(' ', map(type(val) == 'array' ? val : split(val, /\s+/), parse_units));
}
};

Expand Down

0 comments on commit 0a6a2f1

Please sign in to comment.