diff options
author | Aleksey Kolosov <softovick@gmail.com> | 2024-11-15 10:42:55 +0300 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-11-28 21:18:33 +0100 |
commit | 0a6a2f1fc5cbea81531e2c24ded46b4ecba27647 (patch) | |
tree | 12918e1a6ec82d9ae0f5610559e47ed44b15199e /applications | |
parent | bbc4a909255c34630f7710aff636c519a12318bd (diff) |
luci-app-statistics: fix prepare values from list vlaues
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 <softovick@gmail.com>
Diffstat (limited to 'applications')
-rwxr-xr-x | applications/luci-app-statistics/root/usr/libexec/stat-genconfig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/applications/luci-app-statistics/root/usr/libexec/stat-genconfig b/applications/luci-app-statistics/root/usr/libexec/stat-genconfig index 130f8f3876..0d6bd6704f 100755 --- a/applications/luci-app-statistics/root/usr/libexec/stat-genconfig +++ b/applications/luci-app-statistics/root/usr/libexec/stat-genconfig @@ -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)); } }; |