From b410f6b55422762e59765afc2e91e2ede4d07c69 Mon Sep 17 00:00:00 2001
From: Sainan <63328889+Sainan@users.noreply.github.com>
Date: Tue, 8 Jul 2025 20:49:22 -0700
Subject: [PATCH] chore(webui): indicate unsaved changes (#2436)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2436
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
---
 static/webui/index.html | 10 +++++-----
 static/webui/script.js  | 13 +++++++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/static/webui/index.html b/static/webui/index.html
index 63d4d936..c155cc05 100644
--- a/static/webui/index.html
+++ b/static/webui/index.html
@@ -803,21 +803,21 @@
                                         
                                         
                                             
-                                            
+                                            
                                         
                                     
                                     
                                     
                                 
@@ -942,14 +942,14 @@
                                     
                                     
                                         
-                                        
+                                        
                                     
                                 
                                 
                             
diff --git a/static/webui/script.js b/static/webui/script.js
index 9649019e..22a3203e 100644
--- a/static/webui/script.js
+++ b/static/webui/script.js
@@ -1954,6 +1954,19 @@ for (const id of uiConfigs) {
     }
 }
 
+document.querySelectorAll(".config-form .input-group").forEach(grp => {
+    const input = grp.querySelector("input");
+    const btn = grp.querySelector("button");
+    input.oninput = input.onchange = function () {
+        btn.classList.remove("btn-secondary");
+        btn.classList.add("btn-primary");
+    };
+    btn.onclick = function () {
+        btn.classList.remove("btn-primary");
+        btn.classList.add("btn-secondary");
+    };
+});
+
 function doSaveConfigInt(id) {
     $.post({
         url: "/custom/setConfig?" + window.authz + "&wsid=" + wsid,