Add temperature assignment clear buttons
This commit is contained in:
@@ -499,6 +499,26 @@ async function assignTemp(id,index){
|
||||
alert("Temp probe assigned to "+id);
|
||||
}
|
||||
|
||||
async function clearTempAssignment(id){
|
||||
if(!confirm("Clear probe assignment for "+id+"?")) return;
|
||||
|
||||
const r=await fetch("/temps/clear",{
|
||||
method:"POST",
|
||||
headers:{"Content-Type":"application/json"},
|
||||
body:JSON.stringify({id:id})
|
||||
});
|
||||
|
||||
if(!r.ok){
|
||||
const msg=await r.text();
|
||||
alert("Failed to clear temp assignment: "+msg);
|
||||
return;
|
||||
}
|
||||
|
||||
await fetch("/config/save",{method:"POST"});
|
||||
await load();
|
||||
alert("Temp probe assignment cleared for "+id);
|
||||
}
|
||||
|
||||
async function restartController(){
|
||||
if(!confirm("Restart the controller now?")) return;
|
||||
await fetch("/system/restart",{method:"POST"});
|
||||
@@ -548,6 +568,7 @@ function renderConfigControls(data){
|
||||
<input id="tempWeather${i}" type="checkbox" ${t.weather?"checked":""}>
|
||||
Weather
|
||||
</label>
|
||||
<button class="off" onclick="clearTempAssignment('${t.id}')">Clear</button>
|
||||
</div>
|
||||
</div>`).join("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user