This commit is contained in:
Mateusz Gruszczyński
2026-09-01 13:05:44 +02:00
parent e496f911da
commit 7e0160834d
32 changed files with 486 additions and 67 deletions
+25
View File
@@ -107,6 +107,31 @@ async function sendZoneControl(id, patch) {
}
async function cancelCompressorTask(id) {
try {
const result = await api(`/api/zones/${encodeURIComponent(id)}/compressor-queue/cancel`, {method:'POST'});
if (result.zone) {
const index = app.zones.findIndex(item => item.id === result.zone.id);
if (index >= 0) app.zones[index] = result.zone; else app.zones.push(result.zone);
}
renderAll(); scheduleControlPlanLoad();
toast(tr(result.cancelled ? 'zones.queuedCancelled' : 'zones.noQueuedTask'));
} catch (error) { toast(error.message, true); }
}
async function cancelAllCompressorTasks() {
try {
const result = await api('/api/compressor-queue/cancel-all', {method:'POST'});
(result.zones || []).forEach(zone => {
const index = app.zones.findIndex(item => item.id === zone.id);
if (index >= 0) app.zones[index] = zone; else app.zones.push(zone);
});
renderAll(); scheduleControlPlanLoad();
toast(tr('zones.queuedCancelledAll', {count:Number(result.cancelled || 0)}));
} catch (error) { toast(error.message, true); }
}
function queueZoneTemperature(zone, value, {snapToHalf=true}={}) {
const clamped = clamp(value, 8, 30);
const next = snapToHalf ? Math.round(clamped * 2) / 2 : Math.round(clamped * 10) / 10;