admin order line

This commit is contained in:
2026-05-01 01:13:18 +03:00
parent f250fbd5b6
commit 76ad37c1db
9 changed files with 337 additions and 22 deletions

View File

@@ -19,6 +19,10 @@ window.fetchTowns = async function() {
window.renderBuildingDropdown();
window.renderUnitDropdown();
window.renderTownDetails();
// Refresh the build queue panel if in queue mode
if (window._logPanelMode === 'queue') {
window.fetchBuildQueue(window.selectedTownId);
}
}
} catch (e) {
window.updateServerStatus(false);
@@ -51,7 +55,9 @@ window.fetchLog = async function() {
const res = await fetch('/dashboard/commands?player_id=' + window.PLAYER_ID);
const cmds = await res.json();
window.cmds = cmds; // Save globally so viewer can see reserved resources
window.renderLog(cmds);
if (window._logPanelMode === 'log') {
window.renderLog(cmds);
}
if (window.selectedTownId) window.renderTownDetails();
} catch (e) {}
};
@@ -192,7 +198,12 @@ window.sendCommand = async function() {
});
const data = await res.json();
if (data.ok) {
window.fetchLog();
// Refresh whichever panel is active
if (type === 'build' && window._logPanelMode === 'queue') {
window.fetchBuildQueue(town.town_id);
} else {
window.fetchLog();
}
} else if (data.error === 'client_offline') {
alert(data.message || 'Το script είναι offline.');
} else {