|
|
@ -342,7 +342,12 @@ define([
|
|
|
|
'class': LAG_ELEM_CLS,
|
|
|
|
'class': LAG_ELEM_CLS,
|
|
|
|
id: uid(),
|
|
|
|
id: uid(),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return $lag[0];
|
|
|
|
var $a = $('<span>', {id: 'newLag'});
|
|
|
|
|
|
|
|
$s1 = $('<span>', {'class': 'bar1'}).appendTo($a);
|
|
|
|
|
|
|
|
$s2 = $('<span>', {'class': 'bar2'}).appendTo($a);
|
|
|
|
|
|
|
|
$s3 = $('<span>', {'class': 'bar3'}).appendTo($a);
|
|
|
|
|
|
|
|
$s4 = $('<span>', {'class': 'bar4'}).appendTo($a);
|
|
|
|
|
|
|
|
return $a[0];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var checkLag = function (getLag, lagElement) {
|
|
|
|
var checkLag = function (getLag, lagElement) {
|
|
|
@ -354,29 +359,35 @@ define([
|
|
|
|
'class': 'lag'
|
|
|
|
'class': 'lag'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var title;
|
|
|
|
var title;
|
|
|
|
|
|
|
|
var $lag = $(lagElement);
|
|
|
|
|
|
|
|
$lag.attr('class', '');
|
|
|
|
if (lag) {
|
|
|
|
if (lag) {
|
|
|
|
lagErrors = 0;
|
|
|
|
|
|
|
|
firstConnection = false;
|
|
|
|
firstConnection = false;
|
|
|
|
title = Messages.lag + ' : ' + lag + ' ms\n';
|
|
|
|
title = Messages.lag + ' : ' + lag + ' ms\n';
|
|
|
|
if (lag && lag.waiting || lag > 1000) {
|
|
|
|
if (lag > 30000) {
|
|
|
|
lagLight.addClass('lag-orange');
|
|
|
|
$lag.addClass('lag0');
|
|
|
|
|
|
|
|
title = Messages.redLight;
|
|
|
|
|
|
|
|
} else if (lag > 5000) {
|
|
|
|
|
|
|
|
$lag.addClass('lag1');
|
|
|
|
|
|
|
|
title += Messages.orangeLight;
|
|
|
|
|
|
|
|
} else if (lag > 1000) {
|
|
|
|
|
|
|
|
$lag.addClass('lag2');
|
|
|
|
title += Messages.orangeLight;
|
|
|
|
title += Messages.orangeLight;
|
|
|
|
|
|
|
|
} else if (lag > 300) {
|
|
|
|
|
|
|
|
$lag.addClass('lag3');
|
|
|
|
|
|
|
|
title += Messages.greenLight;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
lagLight.addClass('lag-green');
|
|
|
|
$lag.addClass('lag4');
|
|
|
|
title += Messages.greenLight;
|
|
|
|
title += Messages.greenLight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!firstConnection) {
|
|
|
|
else if (!firstConnection) {
|
|
|
|
// Display the red light at the 2nd failed attemp to get the lag
|
|
|
|
// Display the red light at the 2nd failed attemp to get the lag
|
|
|
|
//if (lagErrors > 1) {
|
|
|
|
lagLight.addClass('lag-red');
|
|
|
|
lagLight.addClass('lag-red');
|
|
|
|
title = Messages.redLight;
|
|
|
|
title = Messages.redLight;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (title) {
|
|
|
|
if (title) {
|
|
|
|
lagLight.attr('title', title);
|
|
|
|
$lag.attr('title', title);
|
|
|
|
$(lagElement).html('');
|
|
|
|
|
|
|
|
$(lagElement).append(lagLight);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|