Changeset

306:c152ab024d1a

mod_admin_web: Show whether connection is encrypted/compressed
author Florian Zeitz <florob@babelmonkeys.de>
date Mon, 27 Dec 2010 21:34:41 +0100
parents 305:4c3abf1a9b5a
children 307:eeef1fa57f88
files mod_admin_web/admin_web/www_files/images/compressed.png mod_admin_web/admin_web/www_files/images/encrypted.png mod_admin_web/admin_web/www_files/js/main.js
diffstat 3 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
Binary file mod_admin_web/admin_web/www_files/images/compressed.png has changed
Binary file mod_admin_web/admin_web/www_files/images/encrypted.png has changed
--- a/mod_admin_web/admin_web/www_files/js/main.js	Mon Dec 27 20:15:21 2010 +0500
+++ b/mod_admin_web/admin_web/www_files/js/main.js	Mon Dec 27 21:34:41 2010 +0100
@@ -25,15 +25,24 @@
 }
 
 function _cbNewS2S(e) {
-    var items, retract, id, jid;
+    var items, entry, retract, id, jid;
     items = e.getElementsByTagName('item');
     for (i = 0; i < items.length; i++) {
         id = items[i].attributes['id'].value;
         jid = items[i].getElementsByTagName('session')[0].attributes['jid'].value;
+
+        entry = $('<li id="' + id + '">' + jid + '</li>');
+        if (e.getElementsByTagName('encrypted')[0]) {
+            entry.append('<img src="images/encrypted.png" title="encrypted" alt=" (encrypted)" />');
+        }
+        if (e.getElementsByTagName('compressed')[0]) {
+            entry.append('<img src="images/compressed.png" title="compressed" alt=" (compressed)" />');
+        }
+
         if (items[i].getElementsByTagName('out')[0]) {
-            $('#s2sout').append('<li id="' + id + '">' + jid + '</li>');
+            entry.appendTo('#s2sout');
         } else {
-            $('#s2sin').append('<li id="' + id + '">' + jid + '</li>');
+            entry.appendTo('#s2sin');
         }
     }
     retract = e.getElementsByTagName('retract')[0];
@@ -45,12 +54,19 @@
 }
 
 function _cbNewC2S(e) {
-    var items, retract, id, jid;
+    var items, entry, retract, id, jid;
     items = e.getElementsByTagName('item');
     for (i = 0; i < items.length; i++) {
         id = items[i].attributes['id'].value;
         jid = items[i].getElementsByTagName('session')[0].attributes['jid'].value;
-        $('#c2s').append('<li id="' + id + '">' + jid + '</li>');
+        entry = $('<li id="' + id + '">' + jid + '</li>');
+        if (e.getElementsByTagName('encrypted')[0]) {
+            entry.append('<img src="images/encrypted.png" title="encrypted" alt=" (encrypted)" />');
+        }
+        if (e.getElementsByTagName('compressed')[0]) {
+            entry.append('<img src="images/compressed.png" title="compressed" alt=" (compressed)" />');
+        }
+        entry.appendTo('#c2s');
     }
     retract = e.getElementsByTagName('retract')[0];
     if (retract) {