0100-hostname.lua 362 B

123456789101112131415
  1. return function(form, uci)
  2. local pkg_i18n = i18n 'gluon-config-mode-hostname'
  3. local pretty_hostname = require "pretty_hostname"
  4. local s = form:section(Section)
  5. local o = s:option(Value, "hostname", pkg_i18n.translate("Node name"))
  6. o.default = pretty_hostname.get(uci)
  7. function o:write(data)
  8. pretty_hostname.set(uci, data)
  9. end
  10. return {'system'}
  11. end