ntpc.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. m = Map("ntpclient", translate("Time Synchronisation"), translate("Synchronizes the system time"))
  5. s = m:section(TypedSection, "ntpclient", translate("General"))
  6. s.anonymous = true
  7. s.addremove = false
  8. s:option(DummyValue, "_time", translate("Current system time")).value = os.date("%c")
  9. interval = s:option(Value, "interval", translate("Update interval (in seconds)"))
  10. interval.datatype = "and(uinteger,min(1))"
  11. interval.rmempty = true
  12. count = s:option(Value, "count", translate("Count of time measurements"), translate("empty = infinite"))
  13. count.datatype = "and(uinteger,min(1))"
  14. count.rmempty = true
  15. s2 = m:section(TypedSection, "ntpdrift", translate("Clock Adjustment"))
  16. s2.anonymous = true
  17. s2.addremove = false
  18. freq = s2:option(Value, "freq", translate("Offset frequency"))
  19. freq.datatype = "integer"
  20. freq.rmempty = true
  21. s3 = m:section(TypedSection, "ntpserver", translate("Time Servers"))
  22. s3.anonymous = true
  23. s3.addremove = true
  24. s3.template = "cbi/tblsection"
  25. s3:option(Value, "hostname", translate("Hostname"))
  26. port = s3:option(Value, "port", translate("Port"))
  27. port.datatype = "port"
  28. port.rmempty = true
  29. return m