changeset 573:c9955858dc7e

mod_adhoc_web: Redesign adhoc command pane
author Florian Zeitz <florob@babelmonkeys.de>
date Wed, 18 Jan 2012 01:24:41 +0100
parents f22a569fcf86
children 950e23318bbc
files mod_admin_web/admin_web/get_deps.sh mod_admin_web/admin_web/www_files/css/style.css mod_admin_web/admin_web/www_files/index.html mod_admin_web/admin_web/www_files/js/main.js
diffstat 4 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_admin_web/admin_web/get_deps.sh	Tue Jan 17 16:07:21 2012 +0000
+++ b/mod_admin_web/admin_web/get_deps.sh	Wed Jan 18 01:24:41 2012 +0100
@@ -4,7 +4,7 @@
 BOOTSTRAP_VERSION="1.4.0"
 cd www_files/js
 test -e jquery-$JQUERY_VERSION.min.js || wget http://code.jquery.com/jquery-$JQUERY_VERSION.min.js
-test -e adhoc.js || wget -O adhoc.js "http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js?id=e55b23864a9911c15d930b43ed9afe1df5943bf7"
+test -e adhoc.js || wget -O adhoc.js "http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js?id=5a45869a032410c17d02374b8de20e496c114de3"
 test -e strophe.min.js || (wget https://github.com/downloads/metajack/strophejs/strophejs-$STROPHE_VERSION.tar.gz && tar xzf strophejs-$STROPHE_VERSION.tar.gz strophejs-$STROPHE_VERSION/strophe.min.js --strip-components=1 && rm strophejs-$STROPHE_VERSION.tar.gz)
 cd ../css
 test -e bootstrap-$BOOTSTRAP_VERSION.min.css || wget http://twitter.github.com/bootstrap/$BOOTSTRAP_VERSION/bootstrap.min.css -O bootstrap-$BOOTSTRAP_VERSION.min.css
--- a/mod_admin_web/admin_web/www_files/css/style.css	Tue Jan 17 16:07:21 2012 +0000
+++ b/mod_admin_web/admin_web/www_files/css/style.css	Wed Jan 18 01:24:41 2012 +0100
@@ -24,6 +24,14 @@
   display: none
 }
 
+#adhocCommands {
+  border-right: solid 1px
+}
+
+#adhocCommands li {
+  list-style: inside
+}
+
 #login {
   float: left;
   margin-left: 1em;
--- a/mod_admin_web/admin_web/www_files/index.html	Tue Jan 17 16:07:21 2012 +0000
+++ b/mod_admin_web/admin_web/www_files/index.html	Wed Jan 18 01:24:41 2012 +0100
@@ -44,7 +44,12 @@
 </div>
 
 <div id='main'>
-  <div id="adhoc"></div>
+  <div id="adhoc">
+    <div class="row">
+      <div id="adhocCommands" class="span4"></div>
+      <div id="adhocDisplay" class="span12"></div>
+    </div>
+  </div>
   <div id="s2sList" class="container">
    <div class="row">
     <div class="span8">
--- a/mod_admin_web/admin_web/www_files/js/main.js	Tue Jan 17 16:07:21 2012 +0000
+++ b/mod_admin_web/admin_web/www_files/js/main.js	Wed Jan 18 01:24:41 2012 +0100
@@ -10,6 +10,7 @@
 var connection   = null;
 
 var adminsubHost = null;
+var adhocControl = new Adhoc('#adhocDisplay', function() {});
 
 function log(msg) {
     var entry = $('<div></div>').append(document.createTextNode(msg));
@@ -123,7 +124,9 @@
                 }
                 showDisconnect();
                 adminsubHost = $(items[0]).text();
-                Adhoc.checkFeatures('#adhoc', adminsubHost);
+		adhocControl.checkFeatures(adminsubHost,
+		    function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').append(result); }) },
+		    function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); });
                 connection.addHandler(_cbAdminSub, Strophe.NS.ADMINSUB + '#event', 'message');
                 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
                     .c('subscribe', {node: Strophe.NS.C2SSTREAM}));
@@ -198,7 +201,9 @@
         connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
             .c('unsubscribe', {node: Strophe.NS.S2SSTREAM}));
         adminsubHost = $(this).val();
-        Adhoc.checkFeatures('#adhoc', adminsubHost);
+	adhocControl.checkFeatures(adminsubHost,
+	    function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').append(result); }) },
+	    function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); });
         $('#s2sin').empty();
         $('#s2sout').empty();
         $('#c2s').empty();