From 8d9fda0c096291f8cb0fb1bc1aea00048ca85540 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Thu, 1 May 2025 23:34:29 +0330 Subject: [PATCH] Remove Tree Mode --- core/scripts/webpanel/templates/config.html | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/core/scripts/webpanel/templates/config.html b/core/scripts/webpanel/templates/config.html index d2b053c..26f5b68 100644 --- a/core/scripts/webpanel/templates/config.html +++ b/core/scripts/webpanel/templates/config.html @@ -25,14 +25,12 @@ const editor = new JSONEditor(container, { mode: "code", - modes: ["code", "tree"], onChange: validateJson }); - // Function to validate the JSON and update UI elements function validateJson() { try { - editor.get(); // Validate the JSON + editor.get(); updateSaveButton(true); hideErrorMessage(); } catch (error) { @@ -41,7 +39,6 @@ } } - // Function to update save button based on JSON validity function updateSaveButton(isValid) { saveButton.disabled = !isValid; saveButton.style.cursor = isValid ? "pointer" : "not-allowed"; @@ -51,7 +48,6 @@ //saveButton.style.setProperty('border-color', isValid ? "#28a745" : "#ccc", 'important'); } - // Function to show error message with SweetAlert2 function showErrorMessage(message) { Swal.fire({ title: "Error", @@ -66,12 +62,10 @@ }); } - // Function to hide error message if JSON is fixed function hideErrorMessage() { Swal.close(); } - // Function to ask the user before saving and save the JSON if confirmed function saveJson() { Swal.fire({ title: 'Are you sure?', @@ -99,7 +93,6 @@ }); } - // Function to load JSON from the server function restoreJson() { fetch("{{ url_for('get_file') }}") .then(response => response.json()) @@ -113,6 +106,6 @@ }); } - restoreJson(); // Initial JSON load + restoreJson(); -{% endblock %} \ No newline at end of file +{% endblock %}