summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2018-12-26 19:19:09 +0200
committerGitHub <noreply@github.com>2018-12-26 19:19:09 +0200
commit30ab3afc3ea47a3d4ae6a5bfabaa14c92ae4db61 (patch)
treedb26e6ca3b1d1a2d89b826320d78483ac569893e
parentd463de368683774cc52f3d66baff337c07733fb6 (diff)
parentf1db40df10d7f8e66740ea11b2b73f254f0b328e (diff)
Merge pull request #2390 from cshoredaniel/pr-nut-updates
luci-app-nut: Update nut-server settings to match packages master
-rw-r--r--applications/luci-app-nut/luasrc/model/cbi/nut_server.lua127
1 files changed, 92 insertions, 35 deletions
diff --git a/applications/luci-app-nut/luasrc/model/cbi/nut_server.lua b/applications/luci-app-nut/luasrc/model/cbi/nut_server.lua
index dea793239..6aaf1d2c2 100644
--- a/applications/luci-app-nut/luasrc/model/cbi/nut_server.lua
+++ b/applications/luci-app-nut/luasrc/model/cbi/nut_server.lua
@@ -48,7 +48,7 @@ o.optional = true
o.datatype = "port"
o.placeholder = "3493"
-s = m:section(NamedSection, "upsd", "upsd", translate("Global Settings"))
+s = m:section(NamedSection, "upsd", "upsd", translate("UPS Server Global Settings"))
s.addremove = true
o = s:option(Value, "maxage", translate("Maximum Age of Data"), translate("Period after which data is considered stale"))
@@ -74,6 +74,43 @@ if luci.util.checklib("/usr/sbin/upsd", "libssl.so") then
o.optional = true
end
+s = m:section(NamedSection, "driver_global", "driver_global", translate("Driver Global Settings"))
+s.addremove = true
+
+o = s:option(Value, "chroot", translate("chroot"), translate("Run drivers in a chroot(2) environment"))
+o.optional = true
+
+o = s:option(Value, "driverpath", translate("Driver Path"), translate("Path to drivers (instead of default)"))
+o.optional = true
+o.placeholder = "/lib/lnut"
+
+o = s:option(Value, "maxstartdelay", translate("Maximum Start Delay"), translate("Default for UPSes without this field."))
+o.optional = true
+o.datatype = "uinteger"
+
+o = s:option(Value, "maxretry", translate("Maxium Retries"), translate("Maximum number of times to try starting a driver."))
+o.optional = true
+o.placeholder = 1
+o.datatype = "uinteger"
+
+o = s:option(Value, "retrydelay", translate("Retry Delay"), translate("Time in seconds between driver start retry attempts."))
+o.optional = true
+o.placeholder = 5
+o.datatype = "uinteger"
+
+o = s:option(Value, "pollinterval", translate("Poll Interval"), translate("Maximum time in seconds between refresh of UPS status"))
+o.optional = true
+o.placeholder = 2
+o.datatype = "uinteger"
+
+o = s:option(Flag, "synchronous", translate("Synchronous Communication"), translate("Driver waits for data to be consumed by upsd before publishing more."))
+o.optional = true
+o.default = false
+
+o = s:option(Value, "user", translate("RunAs User"), translate("User as which to execute driver; requires device file accessed by driver to be read-write for that user."))
+o.optional = true
+o.placeholder = "nut"
+
s = m:section(TypedSection, "driver", translate("Driver Configuration"),
translate("The name of this section will be used as UPS name elsewhere"))
s.addremove = true
@@ -81,15 +118,47 @@ s.anonymous = false
driverlist = nixio.fs.dir("/lib/nut")
+o = s:option(Value, "bus", translate("USB Bus(es) (regex)"))
+o.optional = true
+o.datatype = "uinteger"
+
+o = s:option(Value, "community", translate("SNMP Community"))
+o.optional = true
+o.placeholder = "private"
+
+o = s:option(Value, "desc", translate("Description (Display)"))
+o.optional = true
+
o = s:option(ListValue, "driver", translate("Driver"))
for driver in driverlist do
o:value(driver)
end
o.optional = false
-o = s:option(Value, "port", translate("Port"))
-o.optional = false
-o.default = "auto"
+o = s:option(Flag, "enable_usb_serial", translate("Set USB serial port permissions"), translate("Enables a hotplug script that makes all ttyUSB devices (e.g. serial USB) group read-write as user 'nut'"))
+o.optional = true
+o.default = false
+
+o = s:option(Flag, "ignorelb", translate("Ignore Low Battery"))
+o.optional = true
+o.default = false
+
+o = s:option(Flag, "interruptonly", translate("Interrupt Only"))
+o.optional = true
+o.default = false
+
+o = s:option(Value, "interruptsize", translate("Interrupt Size"), translate("Bytes to read from interrupt pipe"))
+o.optional = true
+o.datatype = "uinteger"
+
+o = s:option(Value, "maxreport", translate("Max USB HID Length Reported"), translate("Workaround for buggy firmware"))
+o.optional = true
+o.datatype = "uinteger"
+
+o = s:option(Value, "maxstartdelay", translate("Maxium Start Delay"), translate("Time in seconds that upsdrvctl will wait for driver to finish starting"))
+o.optional = true
+o.datatype = "uinteger"
+o.placeholder = 45
o = s:option(Value, "mfr", translate("Manufacturer (Display)"))
o.optional = true
@@ -97,11 +166,13 @@ o.optional = true
o = s:option(Value, "model", translate("Model (Display)"))
o.optional = true
-o = s:option(Value, "serial", translate("Serial Number"))
+o = s:option(Flag, "nolock", translate("No Lock"), translate("Don't lock port when starting driver"))
o.optional = true
+o.default = false
-o = s:option(Value, "sdtime", translate("Additional Shutdown Time(s)"))
+o = s:option(Flag, "notransferoids", translate("No low/high voltage transfer OIDs"))
o.optional = true
+o.default = false
o = s:option(Value, "offdelay", translate("Off Delay(s)"), translate("Delay for kill power command"))
o.optional = true
@@ -128,42 +199,33 @@ o.optional = true
o.datatype = "integer"
o.placeholder = 30
-o = s:option(Value, "vendor", translate("Vendor (regex)"))
-o.optional = true
+o = s:option(Value, "port", translate("Port"))
+o.optional = false
+o.default = "auto"
o = s:option(Value, "product", translate("Product (regex)"))
o.optional = true
-o = s:option(Value, "bus", translate("USB Bus(es) (regex)"))
-o.optional = true
-o.datatype = "uinteger"
-
-o = s:option(Flag, "interruptonly", translate("Interrupt Only"))
-o.optional = true
-o.default = false
-
-o = s:option(Value, "interruptsize", translate("Interrupt Size"), translate("Bytes to read from interrupt pipe"))
+o = s:option(Value, "productid", translate("USB Product Id"))
o.optional = true
-o.datatype = "integer"
-o = s:option(Value, "maxreport", translate("Max USB HID Length Reported"), translate("Workaround for buggy firmware"))
+o = s:option(Value, "sdorder", translate("Driver Shutdown Order"))
o.optional = true
-o.datatype = "integer"
-o.default = nil
+o.datatype = "uinteger"
-o = s:option(Value, "vendorid", translate("USB Vendor Id"))
+o = s:option(Value, "sdtime", translate("Additional Shutdown Time(s)"))
o.optional = true
-o = s:option(Value, "productid", translate("USB Product Id"))
+o = s:option(Value, "serial", translate("Serial Number"))
o.optional = true
-o = s:option(Value, "runas", translate("RunAs User"), translate("User as which to execute driver; requires device file accessed by driver be read-write for that user."))
+o = s:option(Value, "snmp_retries", translate("SNMP retries"))
o.optional = true
-o.placeholder = "nut"
+o.datatype = "uinteger"
-o = s:option(Value, "community", translate("SNMP Community"))
+o = s:option(Value, "snmp_timeout", translate("SNMP timeout(s)"))
o.optional = true
-o.placeholder = "private"
+o.datatype = "uinteger"
o = s:option(ListValue, "snmp_version", translate("SNMP version"))
o.optional = true
@@ -173,19 +235,14 @@ o:value("v3", translate("SNMPv3"))
o:value("", "")
o.default = ""
-o = s:option(Value, "snmp_retries", translate("SNMP retries"))
+o = s:option(Value, "vendor", translate("Vendor (regex)"))
o.optional = true
-o.datatype = "uinteger"
-o = s:option(Value, "snmp_timeout", translate("SNMP timeout(s)"))
+o = s:option(Value, "vendorid", translate("USB Vendor Id"))
o.optional = true
-o.datatype = "uinteger"
-o = s:option(Flag, "notransferoids", translate("No low/high voltage transfer OIDs"))
+o = s:option(Flag, "synchronous", translate("Synchronous Communication"), translate("Driver waits for data to be consumed by upsd before publishing more."))
o.optional = true
o.default = false
-o = s:option(Value, "other", translate("Additional Parameters"))
-o.optional = true
-
return m