Skip to content
Snippets Groups Projects
Commit 9de78e27 authored by David Bauer's avatar David Bauer Committed by Andreas Ziegler
Browse files

gluon-config-mode-hostname: add option to use default hostname (#1529)

Before 7827f896, mandatory hostname field in config mode was
pre-filled with the default hostname.

This commit adds the config_mode.hostname.prefill option for
controlling the default value.
parent 71d1c00f
No related branches found
No related tags found
No related merge requests found
......@@ -403,6 +403,9 @@ config_mode \: optional
and the node's primary MAC address is assigned. Manually setting a hostname
can be enforced by setting *hostname.optional* to *false*.
To not prefill the hostname-field in config-mode with the default hostname,
set *hostname.prefill* to *false*.
By default, no altitude field is shown by the *gluon-config-mode-geo-location*
package. Set *geo_location.show_altitude* to *true* if you want the altitude
field to be visible.
......@@ -423,6 +426,7 @@ config_mode \: optional
config_mode = {
hostname = {
optional = false,
prefill = true,
},
geo_location = {
show_altitude = true,
......
need_boolean(in_site({'config_mode', 'hostname', 'optional'}), false)
need_boolean(in_site({'config_mode', 'hostname', 'prefill'}), true)
......@@ -23,7 +23,7 @@ return function(form, uci)
o.optional = true
o.placeholder = default_hostname
end
if configured then
if configured or site.config_mode.hostname.prefill(true) then
o.default = current_hostname
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment