diff --git a/docs/user/site.rst b/docs/user/site.rst index da4e1a81dcc062dc4b0249686f7d3545a474acd7..2d9680dfa40fb4601ab7f592bfafb458156a9a58 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -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, diff --git a/package/gluon-config-mode-hostname/check_site.lua b/package/gluon-config-mode-hostname/check_site.lua index 29b5edd6a6bc562f55492ad803d9d194a3f90edf..a2f8d606702db6d91ef20a37f4afff945d6d63cf 100644 --- a/package/gluon-config-mode-hostname/check_site.lua +++ b/package/gluon-config-mode-hostname/check_site.lua @@ -1 +1,2 @@ need_boolean(in_site({'config_mode', 'hostname', 'optional'}), false) +need_boolean(in_site({'config_mode', 'hostname', 'prefill'}), true) diff --git a/package/gluon-config-mode-hostname/luasrc/lib/gluon/config-mode/wizard/0100-hostname.lua b/package/gluon-config-mode-hostname/luasrc/lib/gluon/config-mode/wizard/0100-hostname.lua index d078b4de8d79a19aa35b6a76f94fbbb7d8d43faf..53d7a1d48b2b01cc60b83ebe6fb35a4ffc48e807 100644 --- a/package/gluon-config-mode-hostname/luasrc/lib/gluon/config-mode/wizard/0100-hostname.lua +++ b/package/gluon-config-mode-hostname/luasrc/lib/gluon/config-mode/wizard/0100-hostname.lua @@ -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