summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua')
-rw-r--r--applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua28
1 files changed, 18 insertions, 10 deletions
diff --git a/applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua b/applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua
index 2496259bad..b1bb1b850f 100644
--- a/applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua
+++ b/applications/luci-app-nut/luasrc/model/cbi/nut_monitor.lua
@@ -78,9 +78,9 @@ o.optional = true
validatenotify = function(self, value)
val = StaticList.validate(self, value)
if val then
- for k, v in pairs(val) do
- if (v == 'IGNORE') then
- return nil, "Ignore must the only option selected, when selected"
+ for i, v in ipairs(val) do
+ if (i > 1) and (v == 'IGNORE') then
+ return nil, "If selected, Ignore must be the only option."
end
end
end
@@ -112,7 +112,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "nowbattnotify", translate("Notify when low battery"))
+o = s:option(StaticList, "lowbattnotify", translate("Notify when low battery"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -120,7 +120,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "nowbattnotify", translate("Notify when low battery"))
+o = s:option(StaticList, "fsdnotify", translate("Notify when force shutdown"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -128,7 +128,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "fsdnotify", translate("Notify when force shutdown"))
+o = s:option(StaticList, "comoknotify", translate("Notify when communications restored"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -136,7 +136,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "comoknotify", translate("Notify when communications restored"))
+o = s:option(StaticList, "combadnotify", translate("Notify when communications lost"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -144,7 +144,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "combadnotify", translate("Notify when communications lost"))
+o = s:option(StaticList, "shutdownotify", translate("Notify when shutting down"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -152,7 +152,7 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "shutdownotify", translate("Notify when shutting down"))
+o = s:option(StaticList, "replbattnotify", translate("Notify when battery needs replacing"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))
@@ -160,7 +160,15 @@ o:value("SYSLOG", translate("Write to syslog"))
o:value("IGNORE", translate("Ignore"))
o.validate = validatenotify
-o = s:option(StaticList, "replbattnotify", translate("Notify when battery needs replacing"))
+o = s:option(StaticList, "nocommnotify", translate("Notify when no communications"))
+o.optional = true
+o.widget = "select"
+o:value("EXEC", translate("Execute notify command"))
+o:value("SYSLOG", translate("Write to syslog"))
+o:value("IGNORE", translate("Ignore"))
+o.validate = validatenotify
+
+o = s:option(StaticList, "noparentnotify", translate("Notify when no parent process"))
o.optional = true
o.widget = "select"
o:value("EXEC", translate("Execute notify command"))