luci-base: FlagValue fix type of enabled and disabled properties
authorSergey Ponomarev <stokito@gmail.com>
Fri, 19 Jan 2024 17:47:58 +0000 (19:47 +0200)
committerSergey Ponomarev <stokito@gmail.com>
Tue, 23 Jan 2024 07:29:12 +0000 (09:29 +0200)
The form.Flag checkbox allows to specify a value for enabled/disabled e.g. for a dropbear:

    o = s.option(form.Flag, 'PasswordAuth');
    o.enabled  = 'on';

So the property type should be a string but not just a number.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
modules/luci-base/htdocs/luci-static/resources/form.js

index 66ba0302087f3692546904223c6ead85c5a0669f..b1e7d2c39358a466cd78f2f60b35e4fee6a50329 100644 (file)
@@ -4007,7 +4007,7 @@ var CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.FlagValue.prototype */ {
         * Sets the input value to use for the checkbox checked state.
         *
         * @name LuCI.form.FlagValue.prototype#enabled
-        * @type number
+        * @type string
         * @default 1
         */
 
@@ -4015,7 +4015,7 @@ var CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.FlagValue.prototype */ {
         * Sets the input value to use for the checkbox unchecked state.
         *
         * @name LuCI.form.FlagValue.prototype#disabled
-        * @type number
+        * @type string
         * @default 0
         */