ntpcmini.lua 928 B

12345678910111213141516171819202122232425262728
  1. -- Copyright 2008 Steven Barth <steven@midlink.org>
  2. -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  3. -- Licensed to the public under the Apache License 2.0.
  4. require("luci.tools.webadmin")
  5. m = Map("ntpclient", translate("Time Synchronisation"), translate("Synchronizes the system time"))
  6. s = m:section(TypedSection, "ntpclient", translate("General"))
  7. s.anonymous = true
  8. s.addremove = false
  9. s:option(DummyValue, "_time", translate("Current system time")).value = os.date("%c")
  10. interval = s:option(Value, "interval", translate("Update interval (in seconds)"))
  11. interval.datatype = "and(uinteger,min(1))"
  12. interval.rmempty = true
  13. s3 = m:section(TypedSection, "ntpserver", translate("Time Server"))
  14. s3.anonymous = true
  15. s3.addremove = true
  16. s3.template = "cbi/tblsection"
  17. s3:option(Value, "hostname", translate("Hostname"))
  18. port = s3:option(Value, "port", translate("Port"))
  19. port.datatype = "port"
  20. port.rmempty = true
  21. return m