This commit is contained in:
Anders Betnér 2006-04-06 21:20:33 +00:00
parent 47db1632a3
commit 3b5e89708f
2 changed files with 5 additions and 2 deletions

View File

@ -49,6 +49,6 @@
<div class="navilink"><a class="@ispage aspl-license.html:naviselected:navi@" href="aspl-license.html">ASPL license</a></div>
</div>
<div class="ministatus">@session-count@ Connected Users</div>
<div id="session_count" class="ministatus">@session-count@ Connected Users</div>
</td><td class="main">

View File

@ -1,6 +1,6 @@
Event.observe(window,'load',initStatus);
var UPDATE_FREQUENCY = 5; // number of seconds between updates
var UPDATE_FREQUENCY = 5; // default number of seconds between updates if no cookie set
function initStatus(e) {
Event.observe('update','keyup',Updater.keyUp);
@ -59,12 +59,15 @@ function rsStats(request) {
var thread = $A(request.responseXML.getElementsByTagName('thread'));
var threadTable = new Table('thread');
threadTable.removeTBodyRows();
var users = 0;
thread.each(function (element) {
users++;
row = [];
row.push(element.childNodes[1].firstChild.nodeValue);
row.push(element.childNodes[2].firstChild.nodeValue);
threadTable.addTbodyRow(row);
});
$('session_count').replaceChild(document.createTextNode(users + ' Connected Users'),$('session_count').firstChild);
Updater.update();
}