gluon-config-mode-hostname: add option to use default hostname (#1529)
Before 7827f89
, 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.
This commit is contained in:
parent
71d1c00f89
commit
9de78e27b6
@ -403,6 +403,9 @@ config_mode \: optional
|
|||||||
and the node's primary MAC address is assigned. Manually setting a hostname
|
and the node's primary MAC address is assigned. Manually setting a hostname
|
||||||
can be enforced by setting *hostname.optional* to *false*.
|
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*
|
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
|
package. Set *geo_location.show_altitude* to *true* if you want the altitude
|
||||||
field to be visible.
|
field to be visible.
|
||||||
@ -423,6 +426,7 @@ config_mode \: optional
|
|||||||
config_mode = {
|
config_mode = {
|
||||||
hostname = {
|
hostname = {
|
||||||
optional = false,
|
optional = false,
|
||||||
|
prefill = true,
|
||||||
},
|
},
|
||||||
geo_location = {
|
geo_location = {
|
||||||
show_altitude = true,
|
show_altitude = true,
|
||||||
|
@ -1 +1,2 @@
|
|||||||
need_boolean(in_site({'config_mode', 'hostname', 'optional'}), false)
|
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.optional = true
|
||||||
o.placeholder = default_hostname
|
o.placeholder = default_hostname
|
||||||
end
|
end
|
||||||
if configured then
|
if configured or site.config_mode.hostname.prefill(true) then
|
||||||
o.default = current_hostname
|
o.default = current_hostname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user