summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-08-21 10:53:39 +0300
committerMarin Ivanov <[email protected]>2024-08-21 10:53:39 +0300
commit3f2637916505a1e09a0d997017a5dc41596e66da (patch)
tree235b953111a8fe85c7a2f257775f7b03a54ebe24
parenta9ba463ba6d32d45ff01ccc0adc4122414e64a60 (diff)
add reset configuration
-rw-r--r--app.js6
-rw-r--r--style.css1
2 files changed, 7 insertions, 0 deletions
diff --git a/app.js b/app.js
index 3579ca6..bdc4867 100644
--- a/app.js
+++ b/app.js
@@ -60,6 +60,11 @@
}, ok?10000:0);
})
};
+ let setdefaults = (data) => {
+ setLoading(1);
+ cmd("defaults\nsave\n")
+ .finally(() => {setLoading(0);})
+ };
function CErr(text) {
let el = div(
@@ -140,6 +145,7 @@
h1("Controls"),
p(
button("Reboot").$click(reboot),
+ button("Reset Configuration").$click(setdefaults),
).$cls("center"),
),
...fromEntries(entries(config.sections).map(([id, _]) => [`/${id}`, () => CSettings(id)])),
diff --git a/style.css b/style.css
index 39b60fd..394143b 100644
--- a/style.css
+++ b/style.css
@@ -82,6 +82,7 @@ input[type=submit], button {
height: 40px;
border:0;
color:#fff;
+ margin: 10px;
}
input[type=submit]:active, button:active {