|
|
@ -137,10 +137,10 @@ function magnitudeTypedKey(magnitude, name) { |
|
|
|
// Utils
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
function notifyError(message, source, lineno, colno, error) { |
|
|
|
function showErrorNotification(message) { |
|
|
|
let container = document.getElementById("error-notification"); |
|
|
|
if (container.childElementCount > 0) { |
|
|
|
return; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
container.style.display = "inherit"; |
|
|
@ -149,15 +149,24 @@ function notifyError(message, source, lineno, colno, error) { |
|
|
|
let notification = document.createElement("div"); |
|
|
|
notification.classList.add("pure-u-1"); |
|
|
|
notification.classList.add("pure-u-lg-1"); |
|
|
|
notification.textContent = message; |
|
|
|
|
|
|
|
container.appendChild(notification); |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
function notifyError(message, source, lineno, colno, error) { |
|
|
|
let text = ""; |
|
|
|
if (error) { |
|
|
|
notification.textContent += error.stack; |
|
|
|
text = error.stack; |
|
|
|
} else { |
|
|
|
notification.textContent += message; |
|
|
|
text = message; |
|
|
|
} |
|
|
|
notification.textContent += "\n\nFor more info see the Developer Tools console."; |
|
|
|
container.appendChild(notification); |
|
|
|
|
|
|
|
return false; |
|
|
|
text += "\n\nFor more info see the Debug Log and / or Developer Tools console."; |
|
|
|
|
|
|
|
return showErrorNotification(text); |
|
|
|
} |
|
|
|
|
|
|
|
window.onerror = notifyError; |
|
|
@ -2556,6 +2565,18 @@ function processData(data) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if ("gpioInfo" === key) { |
|
|
|
let failed = "Could not acquire locks on the following pins, check configuration\n\n"; |
|
|
|
for (const [pin, file, func, line] of value["failed-locks"]) { |
|
|
|
failed += `GPIO${pin} @ ${file}:${func}:${line}\n`; |
|
|
|
} |
|
|
|
|
|
|
|
if (failed.length > 0) { |
|
|
|
showErrorNotification(failed); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Actions
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|