diff --git a/src/web/html/colorBright.css b/src/web/html/colorBright.css
index aedd05d4..ebf4f12a 100644
--- a/src/web/html/colorBright.css
+++ b/src/web/html/colorBright.css
@@ -12,6 +12,7 @@
--nav-bg: #333;
--primary: #006ec0;
+ --primary-disabled: #ccc;
--primary-hover: #044e86;
--secondary: #0072c8;
--nav-active: #555;
diff --git a/src/web/html/colorDark.css b/src/web/html/colorDark.css
index b5b1a72b..23e7a2cf 100644
--- a/src/web/html/colorDark.css
+++ b/src/web/html/colorDark.css
@@ -12,6 +12,7 @@
--nav-bg: #333;
--primary: #004d87;
+ --primary-disabled: #ccc;
--primary-hover: #023155;
--secondary: #0072c8;
--nav-active: #555;
diff --git a/src/web/html/setup.html b/src/web/html/setup.html
index e0c1693a..a7e4d983 100644
--- a/src/web/html/setup.html
+++ b/src/web/html/setup.html
@@ -321,8 +321,8 @@
@@ -612,6 +612,26 @@
var obj = {cmd: "discovery_cfg", token: "*"}
getAjax("/api/setup", apiCbMqtt, "POST", JSON.stringify(obj));
}
+ // Wait for the DOM to be fully loaded
+ document.addEventListener('DOMContentLoaded', () => {
+ // Get references to the file input and button elements
+ const fileInput = document.querySelector('#importFileInput');
+ const button = document.querySelector('#importButton');
+ // Initially disable the button
+ button.disabled = true;
+ button.title = "Please select a file first";
+ // Listen for changes on the file input
+ fileInput.addEventListener('change', () => {
+ // Enable or disable the button based on whether a file is selected
+ if (fileInput.value) {
+ button.disabled = false;
+ button.title = ""; // Clear the tooltip when a file is selected
+ } else {
+ button.disabled = true;
+ button.title = "Please select a file first"; // Show the tooltip when no file is selected
+ }
+ });
+ });
function hide() {
document.getElementById("form").submit();
diff --git a/src/web/html/style.css b/src/web/html/style.css
index 60805e19..2866dda1 100644
--- a/src/web/html/style.css
+++ b/src/web/html/style.css
@@ -563,7 +563,13 @@ input.btn {
cursor: pointer;
}
-input.btn:hover {
+input.btn:disabled {
+ background-color: var(--primary-disabled);
+ color: #888;
+ cursor: not-allowed;
+}
+
+input.btn:not(:disabled):hover {
background-color: #044e86;
}
diff --git a/src/web/html/update.html b/src/web/html/update.html
index ebdbb7ab..a72c6536 100644
--- a/src/web/html/update.html
+++ b/src/web/html/update.html
@@ -12,8 +12,8 @@
{#INSTALLED_VERSION}:
@@ -23,6 +23,27 @@
{#HTML_FOOTER}