Add: Interact with users when config file restored in config.html
This commit is contained in:
@ -103,8 +103,14 @@
|
|||||||
function restoreJson() {
|
function restoreJson() {
|
||||||
fetch("{{ url_for('get_file') }}")
|
fetch("{{ url_for('get_file') }}")
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(json => editor.set(json))
|
.then(json => {
|
||||||
.catch(error => console.error("Error loading JSON:", error));
|
editor.set(json);
|
||||||
|
Swal.fire('Success!', 'Your JSON has been loaded.', 'success');
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
Swal.fire('Error!', 'There was an error loading your JSON.', 'error');
|
||||||
|
console.error("Error loading JSON:", error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreJson(); // Initial JSON load
|
restoreJson(); // Initial JSON load
|
||||||
|
|||||||
Reference in New Issue
Block a user