зеркало из https://github.com/mozilla/gecko-dev.git
Bug 135937 - clean up connection status (limit decimal points)
r=rginda a=asa
This commit is contained in:
Родитель
0b894d3964
Коммит
31c63254be
|
@ -1370,7 +1370,7 @@ function serv_pong (e)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.lastPingSent)
|
if (this.lastPingSent)
|
||||||
this.lag = roundTo ((new Date() - this.lastPingSent) / 1000, 1);
|
this.lag = roundTo ((new Date() - this.lastPingSent) / 1000, 2);
|
||||||
|
|
||||||
delete this.lastPingSent;
|
delete this.lastPingSent;
|
||||||
|
|
||||||
|
|
|
@ -380,8 +380,7 @@ function stringTrim (s)
|
||||||
/* the offset should be in seconds, it will be rounded to 2 decimal places */
|
/* the offset should be in seconds, it will be rounded to 2 decimal places */
|
||||||
function formatDateOffset (offset, format)
|
function formatDateOffset (offset, format)
|
||||||
{
|
{
|
||||||
offset = roundTo(offset, 2);
|
var seconds = roundTo(offset % 60, 2);
|
||||||
var seconds = offset % 60;
|
|
||||||
var minutes = parseInt(offset / 60);
|
var minutes = parseInt(offset / 60);
|
||||||
var hours = parseInt(minutes / 60);
|
var hours = parseInt(minutes / 60);
|
||||||
minutes = minutes % 60;
|
minutes = minutes % 60;
|
||||||
|
|
|
@ -1182,10 +1182,11 @@ function cli_istatus (e)
|
||||||
s.connection.port, serverType]),
|
s.connection.port, serverType]),
|
||||||
"STATUS");
|
"STATUS");
|
||||||
|
|
||||||
var connectTime = formatDateOffset ((new Date() -
|
var connectTime = formatDateOffset (Math.floor((new Date() -
|
||||||
s.connection.connectDate) / 1000);
|
s.connection.connectDate) / 1000));
|
||||||
var pingTime = (s.lastPing) ?
|
var pingTime = ("lastPing" in s) ?
|
||||||
formatDateOffset ((new Date() - s.lastPing) / 1000) : getMsg("na");
|
formatDateOffset (Math.floor((new Date() - s.lastPing) / 1000)) :
|
||||||
|
getMsg("na");
|
||||||
var lag = (s.lag >= 0) ? s.lag : getMsg("na");
|
var lag = (s.lag >= 0) ? s.lag : getMsg("na");
|
||||||
|
|
||||||
client.currentObject.display(getMsg("cli_istatusServerDetail",
|
client.currentObject.display(getMsg("cli_istatusServerDetail",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче