From 71bd26a572df50c6ce58543cfe0adc4ec1627de1 Mon Sep 17 00:00:00 2001 From: --unset Date: Tue, 7 May 2024 19:34:44 -0400 Subject: [PATCH] Change frontend for new manifest --- app/frontend/templates/server/wizard.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/frontend/templates/server/wizard.html b/app/frontend/templates/server/wizard.html index b9ccbf2b..fd079343 100644 --- a/app/frontend/templates/server/wizard.html +++ b/app/frontend/templates/server/wizard.html @@ -71,7 +71,10 @@ onchange="serverJarChange(this)"> {% for s in data['server_types'] %} - + {% if data['server_types'][s].get("enabled", False) %} + {% end %} {% if data['super_user'] %} @@ -1201,7 +1204,7 @@ let cSelect = document.getElementById("server"); let which = {}; try { - versions = Object.keys(serverTypesLists[idx_list[0]][idx_list[1]]["versions"]); + versions = Object.keys(serverTypesLists[idx_list[0]]["types"][idx_list[1]]["versions"]); } catch { while (cSelect.options.length > 0) { cSelect.remove(0); @@ -1247,6 +1250,15 @@ const type_select = document.getElementById('server_jar') const tidx = type_select.selectedIndex; const val = type_select.options[tidx].value; + if (!val) { + $("#server_type option").each(function () { + $(this).remove() + }) + $("#server option").each(function () { + $(this).remove() + }) + return; + } let jcSelect = {}; if (val == 'None') { jcSelect = document.getElementById("server_type"); @@ -1261,7 +1273,7 @@ // get the value of the selected option let jwhich = selectObj.options[jidx].value; // use the selected option value to retrieve the list of items from the serverTypesLists array - let jcList = Object.keys(serverTypesLists[jwhich]); + let jcList = Object.keys(serverTypesLists[jwhich]["types"]); // get the country select element via its known id jcSelect = document.getElementById("server_type"); // remove the current options from the country select