Browse Source

Allow saving config with valid empty GPIO whitelist

SybexXx 3 ngày trước cách đây
mục cha
commit
bbc57d414c

+ 15 - 2
sd-card/html/edit_config_template.html

@@ -3192,8 +3192,21 @@ window.GPIO_AVAILABLE_PINS = [];
 
 
             if (notice) notice.style.display = pins.length ? "none" : "";
             if (notice) notice.style.display = pins.length ? "none" : "";
             if (!pins.length) {
             if (!pins.length) {
-                unavailable("The active board profile (" + profile.profile +
-                    ") does not whitelist any user GPIO pins. Board-owned pins remain reserved.");
+                // The profile was fetched and validated successfully; an empty whitelist
+                // is a valid, safe board configuration, not a transport/profile error.
+                if (categoryCheckbox) categoryCheckbox.disabled = true;
+                if (notice) {
+                    notice.style.display = "";
+                    notice.cells[0].textContent = "";
+                    var strong = document.createElement("b");
+                    strong.textContent = "No user-configurable GPIO pins on this board.";
+                    notice.cells[0].appendChild(strong);
+                    notice.cells[0].appendChild(document.createElement("br"));
+                    notice.cells[0].appendChild(document.createTextNode(
+                        "The active board profile (" + profile.profile +
+                        ") does not whitelist any user GPIO pins. Board-owned pins remain reserved."));
+                }
+                setVisible("GPIO_item", false);
                 return;
                 return;
             }
             }