luci-base: correctness fixes: partial revert
authorPaul Donald <redacted>
Wed, 27 May 2026 22:32:16 +0000 (01:32 +0300)
committerPaul Donald <redacted>
Wed, 27 May 2026 22:32:16 +0000 (01:32 +0300)
This reverts problematic parts of commit
a818ac89bb0e376b7ac4c9f1a8a35f657bbd64c9.

Signed-off-by: Paul Donald <redacted>
modules/luci-base/htdocs/luci-static/resources/form.js
modules/luci-base/htdocs/luci-static/resources/luci.js

index d8e13802480e79faef634a699af69e21ab94e0e0..2a19280aae31bb2190a76a334b72e599a6e1a074 100644 (file)
@@ -752,18 +752,15 @@ const CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
         * @param {Event} ev
         * @param {number} n
         */
-       checkDepends(ev, n, cache) {
-               if (cache == null)
-                       cache = Object.create(null);
-
+       checkDepends(ev, n) {
                let changed = false;
 
                for (let i = 0, s = this.children[0]; (s = this.children[i]) != null; i++)
-                       if (s.checkDepends(ev, n, cache))
+                       if (s.checkDepends(ev, n))
                                changed = true;
 
                if (changed && (n ?? 0) < 10)
-                       this.checkDepends(ev, (n ?? 0) + 1, cache);
+                       this.checkDepends(ev, (n ?? 10) + 1);
 
                ui.tabs.updateTabs(ev, this.root);
        },
@@ -775,12 +772,9 @@ const CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
         * @param {string} section_id
         * @returns {boolean}
         */
-       isDependencySatisfied(depends, config_name, section_id, cache) {
+       isDependencySatisfied(depends, config_name, section_id) {
                let def = false;
 
-               if (cache == null)
-                       cache = Object.create(null);
-
                if (!Array.isArray(depends) || !depends.length)
                        return true;
 
@@ -798,17 +792,8 @@ const CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
                                        istat = false;
                                }
                                else {
-                                       const key = `${config_name}::${section_id}::${dep}`;
-                                       let val;
-
-                                       if (key in cache) {
-                                               val = cache[key];
-                                       }
-                                       else {
-                                               const res = this.lookupOption(dep, section_id, config_name);
-                                               val = (res && res[0].isActive(res[1])) ? res[0].formvalue(res[1]) : null;
-                                               cache[key] = val;
-                                       }
+                                       const res = this.lookupOption(dep, section_id, config_name);
+                                       const val = (res && res[0].isActive(res[1])) ? res[0].formvalue(res[1]) : null;
 
                                        const equal = contains
                                                ? isContained(val, depends[i][dep])
@@ -1797,9 +1782,9 @@ const CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.Abstract
         * @param {string} section_id
         * @returns {boolean}
         */
-       checkDepends(section_id, cache) {
+       checkDepends(section_id) {
                const config_name = this.uciconfig ?? this.section.uciconfig ?? this.map.config;
-               const active = this.map.isDependencySatisfied(this.deps, config_name, section_id, cache);
+               const active = this.map.isDependencySatisfied(this.deps, config_name, section_id);
 
                if (active)
                        this.updateDefaultValue(section_id);
@@ -5173,7 +5158,6 @@ const CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.Flag.prototype */ {
                else if (!this.retain) {
                        return Promise.resolve(this.remove(section_id));
                }
-               return Promise.resolve();
        },
 });
 
@@ -6111,9 +6095,9 @@ const CBISectionValue = CBIValue.extend(/** @lends LuCI.form.SectionValue.protot
         * @param {string} section_id
         * @returns {null}
         */
-       checkDepends(section_id, cache) {
-               this.subsection.checkDepends(section_id, cache);
-               return CBIValue.prototype.checkDepends.apply(this, [ section_id, cache ]);
+       checkDepends(section_id) {
+               this.subsection.checkDepends(section_id);
+               return CBIValue.prototype.checkDepends.apply(this, [ section_id ]);
        },
 
        /**
index 61eb0c1c45f78f33115202c23bb85f7d715bed11..5ad6974a5a735c7153659de6f1b5ff45b9c4ffcc 100644 (file)
                }
 
                requestQueue.length = 0;
-               const requestBaseURL = Request.expandURL(classes.rpc.getBaseURL());
 
-               Request.request(requestBaseURL, reqopt).then(reply => {
+               Request.request(rpcBaseURL, reqopt).then(reply => {
                        let json = null, req = null;
 
                        try { json = reply.json() }
                 * @returns {string}
                 * Return the joined URL path.
                 */
-               path(prefix = '', ...parts) {
+               path(prefix = '', parts) {
                        const url = [ prefix ];
 
                        for (let i = 0; i < parts.length; i++){                         
git clone https://git.99rst.org/PROJECT