mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
In index webpage, reset value graph if no paste received
This commit is contained in:
parent
943016d6ca
commit
507c83e06d
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,15 @@
|
|||
var time_since_last_pastes_num;
|
||||
|
||||
//If we do not received info from global, set pastes_num to 0
|
||||
function checkIfReceivedData(){
|
||||
console.log(new Date().getTime() - time_since_last_pastes_num);
|
||||
if ((new Date().getTime() - time_since_last_pastes_num) > 45*1000)
|
||||
window.paste_num_tabvar = 0;
|
||||
setTimeout(checkIfReceivedData, 45*1000);
|
||||
}
|
||||
|
||||
setTimeout(checkIfReceivedData, 45*1000);
|
||||
|
||||
function initfunc( csvay, scroot) {
|
||||
window.csv = csvay;
|
||||
window.scroot = scroot;
|
||||
|
@ -102,9 +114,11 @@ function create_log_table(obj_json) {
|
|||
var chansplit = obj_json.channel.split('.');
|
||||
var parsedmess = obj_json.data.split(';');
|
||||
|
||||
|
||||
if (parsedmess[0] == "Global"){
|
||||
var paste_processed = parsedmess[4].split(" ")[2];
|
||||
window.paste_num_tabvar = paste_processed;
|
||||
time_since_last_pastes_num = new Date().getTime();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue