feat(web): add TFM settings page
Only setting TFM database name by now
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user