diff options
author | Derrell Lipman <derrell@samba.org> | 2006-12-31 20:12:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:35:23 -0500 |
commit | d1e09e2e6f9db62bbab84abb53e23ee73764178a (patch) | |
tree | 18e57f756611c9d3e10fb41bf7c09eeb795028dd /swat.obsolete/apps/plug-ins/nbt_stats.js | |
parent | 710dfce70ca9024d2f026518638bb193e914f4a0 (diff) | |
download | samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.gz samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.bz2 samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.zip |
r20446: rename swat directory to swat.obsolete; keeping it around since there is lots of useful info in it.
(This used to be commit 5f9f72a9cfab80561b23284001b67c4ea961757b)
Diffstat (limited to 'swat.obsolete/apps/plug-ins/nbt_stats.js')
-rw-r--r-- | swat.obsolete/apps/plug-ins/nbt_stats.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/swat.obsolete/apps/plug-ins/nbt_stats.js b/swat.obsolete/apps/plug-ins/nbt_stats.js new file mode 100644 index 0000000000..f9de19004f --- /dev/null +++ b/swat.obsolete/apps/plug-ins/nbt_stats.js @@ -0,0 +1,62 @@ + +// This function takes the main pane widget and jams its widget in the right +// sub-pane. + +function _asyncNBTStatsHandler(result, ex, id, paneWidget) { + var statusTextArea = null; + + var listData = []; + listData.push({ + server_status : { text : result.server_status }, + total_received : { text : result.total_received.toString() }, + total_sent : { text : result.total_sent.toString() }, + query_count : { text : result.query_count.toString() }, + release_count : { text : result.release_count.toString() }, + register_count : { text : result.register_count.toString() } + }); + + if (ex == null) { + // We need to remove anything previously drawn in this area. + paneWidget.removeAll(); + + statusTextArea = new + qx.ui.form.TextArea("Server Status: " + + result.server_status.toString() + "\n" + + "Total Received: " + + result.total_received.toString() + "\n" + + "Total Sent: " + + result.total_sent.toString() + "\n" + + "Query Count: " + + result.query_count.toString() + "\n" + + "Release Count: " + + result.release_count.toString() + "\n" + + "Register Count: " + + result.register_count.toString() + "\n"); + statusTextArea.setWrap(true); + statusTextArea.setWidth("100%"); + statusTextArea.setHeight("100%"); + } else { + alert("Async(" + id + ") exception: " + ex); + } + paneWidget.add(statusTextArea); +} + +function _NBTStatsPlugInDisplay(paneWidget) { + var rpc = new qx.io.remote.Rpc(); + rpc.setTimeout(60000); + rpc.setUrl("/services/"); + rpc.setServiceName("samba.adm"); + rpc.setCrossDomain(false); + + mycall = rpc.callAsync( + function(result, ex, id) { + _asyncNBTStatsHandler(result, ex, id, paneWidget); + }, + "NBTPacketStats"); +} + +function NBTStatsPlugIn() { + var o = new Object(); + o.display = _NBTStatsPlugInDisplay; + return o; +} |