Working on network online offline detection

This commit is contained in:
Scott Idem
2020-03-04 16:36:49 -05:00
parent 7bb17de8f6
commit e3c297fb98
11 changed files with 495 additions and 174 deletions

View File

@@ -63,5 +63,29 @@ exports.load_config = function () {
} else {
//close();
}
//console.log(config);
return config;
}
exports.currently_online = function() {
//alert('You are currently online');
console.log('Currently online');
app_online = true;
document.getElementById('network_status1').classList.remove('btn-warning');
document.getElementById('network_status1').classList.add('btn-success');
document.getElementById('network_status1').innerHTML = '<span class="fas fa-check"></span> <span class="fas fa-globe"></span> Currently Online';
//document.getElementById('network_status1').innerHTML('Currently Online');
}
exports.currently_offline = function() {
//alert('You are currently offline');
console.log('Currently offline');
app_online = false;
document.getElementById('network_status1').classList.remove('btn-success');
document.getElementById('network_status1').classList.add('btn-warning');
document.getElementById('network_status1').innerHTML = '<span class="fas fa-exclamation"></span> <span class="fas fa-globe"></span> Currently Offline';
//document.getElementById('network_status1').innerHTML('Currently Offline');
}
//window.addEventListener('online', currently_online);
//window.addEventListener('offline', currently_offline);