2017-02-08 21:19:24 +00:00
|
|
|
return function(form, uci)
|
2018-02-23 05:26:10 +00:00
|
|
|
local pkg_i18n = i18n 'gluon-config-mode-hostname'
|
|
|
|
|
2017-02-08 21:19:24 +00:00
|
|
|
local pretty_hostname = require "pretty_hostname"
|
2014-07-27 17:31:45 +00:00
|
|
|
|
2016-08-30 11:40:06 +00:00
|
|
|
form:section(Section, nil, pkg_i18n.translate(
|
|
|
|
"The node name is used solely for identification of your node, e.g. on a "
|
|
|
|
.. "nodemap. It has no influence on the name (SSID) of the broadcasted WLAN."
|
|
|
|
))
|
|
|
|
|
2017-02-08 21:19:24 +00:00
|
|
|
local s = form:section(Section)
|
2018-02-23 05:26:10 +00:00
|
|
|
local o = s:option(Value, "hostname", pkg_i18n.translate("Node name"))
|
2017-02-08 21:19:24 +00:00
|
|
|
o.default = pretty_hostname.get(uci)
|
2014-07-27 17:31:45 +00:00
|
|
|
|
2017-02-08 21:19:24 +00:00
|
|
|
function o:write(data)
|
|
|
|
pretty_hostname.set(uci, data)
|
|
|
|
end
|
2014-07-27 17:31:45 +00:00
|
|
|
|
2017-02-08 21:19:24 +00:00
|
|
|
return {'system'}
|
2014-07-27 17:31:45 +00:00
|
|
|
end
|