From 92673a920051b94000f4b02e5f5f9b5d019c3d86 Mon Sep 17 00:00:00 2001 From: Iam54r1n4 Date: Sun, 9 Feb 2025 10:57:37 +0000 Subject: [PATCH] Add: Interact with users when config file restored in config.html --- core/scripts/webpanel/templates/config.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/scripts/webpanel/templates/config.html b/core/scripts/webpanel/templates/config.html index 5a309b2..d2b053c 100644 --- a/core/scripts/webpanel/templates/config.html +++ b/core/scripts/webpanel/templates/config.html @@ -103,8 +103,14 @@ function restoreJson() { fetch("{{ url_for('get_file') }}") .then(response => response.json()) - .then(json => editor.set(json)) - .catch(error => console.error("Error loading JSON:", error)); + .then(json => { + 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