|
@@ -2963,8 +2963,9 @@ function openDescription() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
openDescription();
|
|
openDescription();
|
|
|
-LoadConfigNeu().catch(function (error) {
|
|
|
|
|
|
|
+window.CONFIG_LOAD_PROMISE = LoadConfigNeu().catch(function (error) {
|
|
|
console.error('Could not initialize configuration editor:', error);
|
|
console.error('Could not initialize configuration editor:', error);
|
|
|
|
|
+ throw error;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -3132,7 +3133,13 @@ window.GPIO_AVAILABLE_PINS = [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
unavailable("Loading the active board profile…");
|
|
unavailable("Loading the active board profile…");
|
|
|
- fetch("/GPIO?capabilities=1", { method: "GET", cache: "no-store" })
|
|
|
|
|
|
|
+ window.CONFIG_LOAD_PROMISE
|
|
|
|
|
+ .then(function () {
|
|
|
|
|
+ if (!param || !category) {
|
|
|
|
|
+ throw new Error("Configuration is not available");
|
|
|
|
|
+ }
|
|
|
|
|
+ return fetch("/GPIO?capabilities=1", { method: "GET", cache: "no-store" });
|
|
|
|
|
+ })
|
|
|
.then(function (response) {
|
|
.then(function (response) {
|
|
|
if (!response.ok) throw new Error("HTTP " + response.status);
|
|
if (!response.ok) throw new Error("HTTP " + response.status);
|
|
|
return response.json();
|
|
return response.json();
|
|
@@ -3194,8 +3201,8 @@ window.GPIO_AVAILABLE_PINS = [];
|
|
|
setVisible("GPIO_item", !!category.GPIO.enabled);
|
|
setVisible("GPIO_item", !!category.GPIO.enabled);
|
|
|
})
|
|
})
|
|
|
.catch(function (error) {
|
|
.catch(function (error) {
|
|
|
- unavailable("Could not read the firmware board profile (" + error.message +
|
|
|
|
|
- "). GPIO stays locked for safety.");
|
|
|
|
|
|
|
+ unavailable("Could not initialize the configuration or read the firmware board profile (" +
|
|
|
|
|
+ error.message + "). GPIO stays locked for safety.");
|
|
|
});
|
|
});
|
|
|
})();;
|
|
})();;
|
|
|
|
|
|