diff --git a/static/js/api.js b/static/js/api.js index 58cab4b..74749d5 100644 --- a/static/js/api.js +++ b/static/js/api.js @@ -92,10 +92,14 @@ window.sendCommand = async function() { if (!town) return alert('Select a town first.'); const type = document.getElementById('cmd-type').value; + if (!type) return alert('Παρακαλώ επιλέξτε Ενέργεια (Command Type) πρώτα.'); + let payload = {}; if (type === 'build') { const building_id = document.getElementById('building-select').value; + if (!building_id) return alert('Παρακαλώ επιλέξτε Κατασκευή πρώτα.'); + const bData = town.build_data?.[building_id]; // UI Validation logic @@ -123,6 +127,8 @@ window.sendCommand = async function() { payload = { building_id }; } else if (type === 'recruit') { const unit_id = document.getElementById('unit-select').value; + if (!unit_id) return alert('Παρακαλώ επιλέξτε Μονάδα προς εκπαίδευση.'); + const amount = parseInt(document.getElementById('recruit-amount').value) || 1; const uData = town.unit_data?.[unit_id]; diff --git a/static/js/components/commandForm.js b/static/js/components/commandForm.js index 079460a..2d48d35 100644 --- a/static/js/components/commandForm.js +++ b/static/js/components/commandForm.js @@ -18,7 +18,7 @@ window.renderBuildingDropdown = function() { const bData = town.build_data || {}; const currentVal = bSelect.value; - bSelect.innerHTML = ''; + bSelect.innerHTML = ''; for (const [key, nameGr] of Object.entries(window.BUILDING_NAMES_GR)) { const level = bLevels[key] !== undefined ? bLevels[key] : "?"; @@ -82,7 +82,7 @@ window.renderUnitDropdown = function() { const uData = town.unit_data || {}; const currentVal = uSelect.value; - uSelect.innerHTML = ''; + uSelect.innerHTML = ''; for (const [key, nameGr] of Object.entries(window.UNIT_NAMES_GR)) { if (key === 'militia') continue; diff --git a/templates/dashboard.html b/templates/dashboard.html index 6920c05..505c6f9 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -9,7 +9,7 @@
-

⚔️ Grepolis Remote

+

⬅️ ⚔️ Grepolis Remote

Server…
Client…
@@ -88,6 +88,7 @@