diff --git a/web/js/equipment.js b/web/js/equipment.js index d301ab6..0f4c58c 100644 --- a/web/js/equipment.js +++ b/web/js/equipment.js @@ -210,6 +210,29 @@ export function renderEquipments() { }); actionRow.append(editBtn, deleteBtn); + + if (equipment.kind === "coal_feeder" || equipment.kind === "distributor") { + const startBtn = document.createElement("button"); + startBtn.className = "secondary"; + startBtn.textContent = "Start"; + startBtn.addEventListener("click", (e) => { + e.stopPropagation(); + apiFetch(`/api/control/equipment/${equipment.id}/start`, { method: "POST" }) + .catch(() => {}); + }); + + const stopBtn = document.createElement("button"); + stopBtn.className = "danger"; + stopBtn.textContent = "Stop"; + stopBtn.addEventListener("click", (e) => { + e.stopPropagation(); + apiFetch(`/api/control/equipment/${equipment.id}/stop`, { method: "POST" }) + .catch(() => {}); + }); + + actionRow.append(startBtn, stopBtn); + } + dom.equipmentList.appendChild(box); }); }