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 makeRowIP(rclass, rtitle, ip, dl, ul, total)
31 return '<tr class="' + rclass + '">' +
32 '<td class="rtitle">' + rtitle + '</td>' +
33 '<td class="ip">' + ip + '</td>' +
34 '<td class="dl">' + dl + '</td>' +
35 '<td class="ul">' + ul + '</td>' +
36 '<td class="total">' + total + '</td>' +
40 function cmpHist(a, b)
42 a = parseInt(a[0], 0);
43 b = parseInt(b[0], 0);
49 function checkRstats()
51 if (nvram.rstats_enable != '1') {
52 W('<div class="note-disabled">Bandwidth monitoring disabled.</b><br><br><a href="admin-bwm.asp">Enable »</a></div>');
53 E('rstats').style.display = 'none';
55 else if (rstats_busy) {
56 W('<div class="note-warning">The rstats program is not responding or is busy. Try reloading after a few seconds.</div>');
60 function checkCstats()
62 if (nvram.cstats_enable != '1') {
63 W('<div class="note-disabled">IP Traffic monitoring disabled.</b><br><br><a href="admin-iptraffic.asp">Enable »</a></div>');
64 E('cstats').style.display = 'none';
66 else if (cstats_busy) {
67 W('<div class="note-warning">The cstats program is not responding or is busy. Try reloading after a few seconds.</div>');
82 function ymText(yr, mo)
86 return (mo + 1).pad(2) + '-' + yr;
88 return months[mo] + ' ' + yr;
90 return (mo + 1).pad(2) + '.' + yr;
92 return yr + '-' + (mo + 1).pad(2);
95 function ymdText(yr, mo, da)
99 return (mo + 1) + '-' + da.pad(2) + '-' + yr;
101 return months[mo] + ' ' + da + ', ' + yr;
103 return da.pad(2) + '.' + (mo + 1).pad(2) + '.' + yr;
105 return yr + '-' + (mo + 1).pad(2) + '-' + da.pad(2);
108 function ymText(yr, mo)
110 switch (dateFormat) {
112 return (mo + 1).pad(2) + '-' + yr;
114 return months[mo] + ', ' + yr;
116 return (mo + 1).pad(2) + '.' + yr;
118 return yr + '-' + (mo + 1).pad(2);
121 function changeDate(e, c)
123 dateFormat = e.value * 1;
124 cookie.set(c, e.value, 31);
130 dateFormat = fixInt(cookie.get(c), 0, 3, 0)
131 E('dafm').value = dateFormat;