feat(web): add TFM settings page

Only setting TFM database name by now
This commit is contained in:
2023-02-09 00:45:54 +03:00
parent 9c07702409
commit 243621f3b2
9 changed files with 211 additions and 22 deletions
+7 -2
View File
@@ -1,6 +1,11 @@
var db_name = localStorage["tfm_db_name"];
if (db_name == null) {
location.href = "/tfm/settings";
}
$(document).on("click", "#btn-save", function (e) {
e.preventDefault();
let resp = tdb_query("$TFM", 4, "");
let resp = tdb_query(db_name, 4, "");
if (resp.status) {
alert("Successfully saved!");
} else {
@@ -13,7 +18,7 @@ $(document).on("click", "#btn-discard", function (e) {
if (!confirm("All unsaved changes will be lost permanently. Are you sure?")) {
return;
}
let resp = tdb_query("$TFM", 2, "");
let resp = tdb_query(db_name, 2, "");
if (resp.status) {
alert("Successfully reloaded database!");
} else {