From: Hannu Nyman Date: Sat, 5 Oct 2019 15:59:08 +0000 (+0300) Subject: luci-app-statistics: fix memory plugin config X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=95ea1e67fe29a1778d161dce15ea57205b07c85d;p=oweals%2Fluci.git luci-app-statistics: fix memory plugin config Fix d064cbcf9 by actually enabling ValuesAbsolute in the config file and also prevent removing that option by LuCI. Signed-off-by: Hannu Nyman --- diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua index e5f3360c0..2e09ea9a7 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua @@ -11,17 +11,19 @@ enable = s:option( Flag, "enable", translate("Enable this plugin") ) enable.default = 0 -- collectd_memory.valuesabsolute (ValuesAbsolute) -valuespercentage = s:option( Flag, "ValuesAbsolute", +valuesabsolute = s:option( Flag, "ValuesAbsolute", translate("Absolute values"), translate("When set to true, we request absolute values")) -valuespercentage.default = 1 -valuespercentage:depends( "enable", 1 ) +valuesabsolute.default = 1 +valuesabsolute.optional = false +valuesabsolute:depends( "enable", 1 ) -- collectd_memory.valuespercentage (ValuesPercentage) valuespercentage = s:option( Flag, "ValuesPercentage", translate("Percent values"), translate("When set to true, we request percentage values")) valuespercentage.default = 0 +valuespercentage.optional = false valuespercentage:depends( "enable", 1 ) return m diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics index f84f67d1f..d97087d19 100644 --- a/applications/luci-app-statistics/root/etc/config/luci_statistics +++ b/applications/luci-app-statistics/root/etc/config/luci_statistics @@ -128,6 +128,8 @@ config statistics 'collectd_load' config statistics 'collectd_memory' option enable '1' + option ValuesAbsolute '1' + option ValuesPercentage '0' config statistics 'collectd_netlink' option enable '0'