2 var months
= ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
3 var snames
= [' KB', ' MB', ' GB'];
8 if ((z
) && (n
== 0)) return '-';
9 return (((z
) && (n
> 0)) ? '+' : '') + comma((n
/ ((scale
== 2) ? 1048576 : ((scale
== 1) ? 1024 : 1))).toFixed(2)) + snames
[scale
];
12 function changeScale(e
)
19 function makeRow(rclass
, rtitle
, dl
, ul
, total
)
21 return '<tr class="' + rclass
+ '">' +
22 '<td class="rtitle">' + rtitle
+ '</td>' +
23 '<td class="dl">' + dl
+ '</td>' +
24 '<td class="ul">' + ul
+ '</td>' +
25 '<td class="total">' + total
+ '</td>' +
29 function cmpHist(a
, b
)
31 a
= parseInt(a
[0], 0);
32 b
= parseInt(b
[0], 0);
38 function checkRstats()
40 if (nvram
.rstats_enable
!= '1') {
41 W('<div class="note-disabled">Bandwidth monitoring disabled.</b><br><br><a href="admin-bwm.asp">Enable »</a></div>');
42 E('rstats').style
.display
= 'none';
44 else if (rstats_busy
) {
45 W('<div class="note-warning">The rstats program is not responding or is busy. Try reloading after a few seconds.</div>');
60 function ymText(yr
, mo
)
64 return (mo
+ 1).pad(2) + '-' + yr
;
66 return months
[mo
] + ' ' + yr
;
68 return (mo
+ 1).pad(2) + '.' + yr
;
70 return yr
+ '-' + (mo
+ 1).pad(2);
73 function ymdText(yr
, mo
, da
)
77 return (mo
+ 1) + '-' + da
.pad(2) + '-' + yr
;
79 return months
[mo
] + ' ' + da
+ ', ' + yr
;
81 return da
.pad(2) + '.' + (mo
+ 1).pad(2) + '.' + yr
;
83 return yr
+ '-' + (mo
+ 1).pad(2) + '-' + da
.pad(2);
86 function changeDate(e
, c
)
88 dateFormat
= e
.value
* 1;
89 cookie
.set(c
, e
.value
, 31);
95 dateFormat
= fixInt(cookie
.get(c
), 0, 3, 0)
96 E('dafm').value
= dateFormat
;