info = {}; info.count = 0; /** * ServerInfo create(String url, String title, int width, int height) * * Creates a ServerInfo object that can be displayed, showing some information * from the server. * * @param url source URL to pull the server information * @param title title for the server frame. * @param width width of the frame. * @param height height of the frame. * @return new ServerInfo instance */ info.create = function(id, url, title, width, height) { x = {}; // member fields x.index = info.count++; x.id = id; x.url = url; x.title = title; x.width = width; x.height = height; // object methods x.show = info.show; x.update = tajax.createUpdate(url, 'info.update_cb'); // data from server x.data = '<p><i>No data retrieved yet</i></p>'; x.lastUpdate = 'Never'; return x; } /** * void ServerInfo.show() * * Populates the ServerInfo div.id with the data from this instance. */ info.show = function() { tajax.debug("show for this: id = " + this.id + ", number = " + this.number ); var d = document.getElementById(this.id); if (! d) { tajax.failure("Could not find doc id " + this.id); return; } document.getElementById(this.id + '-updated').innerHTML = this.lastUpdate; document.getElementById(this.id + '-data').innerHTML = this.data; } /** * void update_cb(data, si) * * Static callback on server response. */ info.update_cb = function(data, si) { si.lastUpdate = (new Date()).toString(); si.data = data; si.show(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 5925 | Matt Albrecht | Updates to the server status page | ||
#2 | 5816 | Matt Albrecht | Add / update the server status with a much better AJAX model. | ||
#1 | 5810 | Matt Albrecht |
New version of logDaemon that has better bug fixes. Also added server-status web page for a pure client-side AJAX app that pulls together different server-side statistics. |