mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-12 02:04:34 +00:00
Includes (js, css to public)
This commit is contained in:
1 parent
d51820b198
commit
e76d2bc5e5
25 files changed
No files matched your search
@@ -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){
|
||||
$('#automation-'+automationId).toggleClass("is-inactive");
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
console.log("ERROR ", request, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user