small fix

This commit is contained in:
2026-04-21 20:29:43 +03:00
parent a6af694482
commit c9da46a530

View File

@@ -11,9 +11,14 @@ window.renderLog = function(cmds) {
const rows = cmds.map(cmd => { const rows = cmds.map(cmd => {
const p = typeof cmd.payload === 'string' ? JSON.parse(cmd.payload) : cmd.payload; const p = typeof cmd.payload === 'string' ? JSON.parse(cmd.payload) : cmd.payload;
const desc = cmd.type === 'build' let desc = '';
? `Build: ${p.building_id}` if (cmd.type === 'build') {
: `Recruit: ${p.amount}x ${p.unit_id}`; desc = `Build: ${p.building_id}`;
} else if (cmd.type === 'recruit') {
desc = `Recruit: ${p.amount}x ${p.unit_id}`;
} else if (cmd.type === 'market_offer') {
desc = `Market: ${p.offer} ${p.offer_type}${p.demand} ${p.demand_type}`;
}
const statusClass = `status-${cmd.status}`; const statusClass = `status-${cmd.status}`;
const cancelBtn = `<button class="btn btn-danger btn-sm" onclick="cancelCommand(${cmd.id})">✕</button>`; const cancelBtn = `<button class="btn btn-danger btn-sm" onclick="cancelCommand(${cmd.id})">✕</button>`;