refactor(feeder): remove start/stop buttons from equipment in platform config
Equipment start/stop operations belong in the ops view only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6b9e396044
commit
01d8418e5c
|
|
@ -159,35 +159,6 @@ export function renderEquipments() {
|
|||
|
||||
actionRow.append(editBtn, deleteBtn);
|
||||
|
||||
if (equipment.kind === "coal_feeder" || equipment.kind === "distributor") {
|
||||
const unitRuntime = equipment.unit_id ? state.runtimes.get(equipment.unit_id) : null;
|
||||
const remLocal = unitRuntime?.rem_local ?? false;
|
||||
|
||||
const startBtn = document.createElement("button");
|
||||
startBtn.className = "secondary";
|
||||
startBtn.textContent = "Start";
|
||||
startBtn.disabled = remLocal;
|
||||
startBtn.title = remLocal ? "设备处于本地模式(REM关)" : "";
|
||||
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.disabled = remLocal;
|
||||
stopBtn.title = remLocal ? "设备处于本地模式(REM关)" : "";
|
||||
stopBtn.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
apiFetch(`/api/control/equipment/${equipment.id}/stop`, { method: "POST" })
|
||||
.catch(() => {});
|
||||
});
|
||||
|
||||
actionRow.append(startBtn, stopBtn);
|
||||
}
|
||||
|
||||
dom.equipmentList.appendChild(box);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue