mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
History Clean Up
This commit is contained in:
commit
8cf912993d
112 files changed
+11395
No files matched your search
@@ -0,0 +1,54 @@
|
||||
function ajaxPost(path, params, self, reload = false) {
|
||||
navigator.vibrate([200]);
|
||||
$.ajax({
|
||||
url: path,
|
||||
type: 'POST',
|
||||
data: params,
|
||||
success: function(msg){
|
||||
if (msg != '' && msg != 1){
|
||||
$(self).find('.content').addClass( "loader" );
|
||||
$(self).find('.row').hide();
|
||||
waitForExecution(params, self, msg);
|
||||
} else {
|
||||
|
||||
}
|
||||
console.log(msg);
|
||||
if (reload){
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
console.log('0');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function waitForExecution(params, elements, msg_state){
|
||||
console.log('Waiting FOR Executed');
|
||||
var interval = setInterval(
|
||||
function(){
|
||||
$.ajax({
|
||||
url: 'ajax',
|
||||
type: 'POST',
|
||||
data: {
|
||||
lastRecord:'',
|
||||
subDevice_id : params['subDevice_id']
|
||||
},
|
||||
success: function(msg){
|
||||
if (msg == 1){
|
||||
$(elements).find('.text-right').text(msg_state);
|
||||
$(elements).find('.content').removeClass( "loader" );
|
||||
$(elements).find('.row').show();
|
||||
console.log('Executed');
|
||||
clearInterval(interval);
|
||||
}
|
||||
console.log('Waiting FOR Executed');
|
||||
console.log(msg);
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
console.log('0');
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
Reference in new issue
Block a user