From: Eric Fahlgren Date: Wed, 12 Nov 2025 19:11:57 +0000 (-0800) Subject: luci-base: improve docs for uci.get_bool X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=9717162fd030ba8a3b0adad0af330648ef9fe3e1;p=project%2Fluci.git luci-base: improve docs for uci.get_bool The get_bool function documentation was missing an option value, so add it. Provide a link into the developer's guide on how it's used in scripts, for better background. Signed-off-by: Eric Fahlgren --- diff --git a/modules/luci-base/htdocs/luci-static/resources/uci.js b/modules/luci-base/htdocs/luci-static/resources/uci.js index ecd5063e4e..c0b5e97be0 100644 --- a/modules/luci-base/htdocs/luci-static/resources/uci.js +++ b/modules/luci-base/htdocs/luci-static/resources/uci.js @@ -711,8 +711,9 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { * Many configuration files contain boolean settings, such as * `enabled` or `advanced_mode`, where there is no consistent * definition for the values. This function allows users to - * enter any of the values `"yes"`, `"on"`, `"true"` or `1` in - * their config files and we return the expected boolean result. + * enter any of the values `"yes"`, `"on"`, `"true"`, `"enabled"` + * or `1` in their config files and we return the expected boolean + * result. * * Character case is not significant, so for example, any of * "YES", "Yes" or "yes" will be interpreted as a `true` value. @@ -730,6 +731,10 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { * @returns {boolean} * - Returns boolean `true` if the configuration value is defined * and looks like a true value, otherwise returns `false`. + * + * See the + * {@link https://openwrt.org/docs/guide-developer/config-scripting#reading_booleans|Developers Guide} + * for more. */ get_bool(conf, type, opt) { let value = this.get(conf, type, opt);