Automation Restart & Deactive Button add

This commit is contained in:
JonatanRek
2019-10-11 17:16:24 +02:00
parent 2e81a86ed0
commit 001e74bc6d
4 changed files with 47 additions and 1 deletions

View File

@@ -52,7 +52,9 @@
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('subDevices',$SUBDEVICES);
$partial->render();
}
}?>
<script src="./app/templates/js/automation.js"></script>
<?php
$partial = new Partial('footer');
$partial->render();
?>

View File

@@ -0,0 +1,35 @@
function restartAutomation(automationId){
console.log("restartingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
"action": 'restart'
},
success: function(data){
console.log(data);
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}
function toggleAutomation(automationId){
console.log("togglingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
"action": 'deactive'
},
success: function(data){
console.log(data);
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}