Author: jfthomps
Date: Thu Apr 26 17:26:32 2012
New Revision: 1330981

URL: http://svn.apache.org/viewvc?rev=1330981&view=rev
Log:
VCL-489         
allow dhcp and hosts info to be downloaded about computers any time instead of 
just when adding

computers.php: modified computerUtilities - changed text of dropdown for 
dhcpd.conf to just 'dhcpd'; moved loading div to under management node IP 
input; moved clearing utilcontent and hiding management node IP input to 
javascript that runs when clicking the Generate Data button

computers.js:
-modified generateCompData - always hide utilerror and clear utilcontent; hide 
management node IP input when generating /etc/hosts data
-modified generateDHCPDdata - always unhide loading div and hide utilcontent; 
set mouse cursor to wait icon
-modified generateHostsData - set mouse cursor to wait icon
-modified generateCompDataCB - set mouse cursor to normal icon

Modified:
    incubator/vcl/trunk/web/.ht-inc/computers.php
    incubator/vcl/trunk/web/js/computers.js

Modified: incubator/vcl/trunk/web/.ht-inc/computers.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/computers.php?rev=1330981&r1=1330980&r2=1330981&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/computers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/computers.php Thu Apr 26 17:26:32 2012
@@ -2876,9 +2876,9 @@ function computerUtilities() {
        print "  <TR>\n";
        print "    <TD>For selected computers, generate computer data 
for:</TD>";
        print "    <TD>\n";
-       $tmp = array('dhcpd' => 'dhcpd.conf', 'hosts' => '/etc/hosts');
+       $tmp = array('dhcpd' => 'dhcpd', 'hosts' => '/etc/hosts');
        printSelectInput('generatetype', $tmp, -1, 0, 0, 'generatetype');
-       print "    <INPUT type=button onclick=generateCompData(); 
value=\"Generate Data\">";
+       print "    <INPUT type=button onclick=\"generateCompData();\" 
value=\"Generate Data\">";
        print "    </TD>\n";
        print "  </TR>\n";
        print "</TABLE>\n";
@@ -2892,9 +2892,6 @@ function computerUtilities() {
        print "      title=\"Generate Data\"\n";
        print "      duration=250\n";
        print "      draggable=true>\n";
-       print "   <div id=\"utilloading\" style=\"text-align: center\" 
class=\"hidden\">";
-       print "<img src=\"themes/$skin/css/dojo/images/loading.gif\" ";
-       print "style=\"vertical-align: middle;\"> Loading...</div>\n";
        print "   <div id=\"utilerror\" style=\"text-align: center\" ";
        print "class=\"hidden rederrormsg\"></div>\n";
        print "   <div class=\"hidden\" id=\"mgmtipdiv\">\n";
@@ -2907,6 +2904,9 @@ function computerUtilities() {
        print "     </script>\n";
        print "     </button>\n";
        print "   </div>\n";
+       print "   <div id=\"utilloading\" style=\"text-align: center\" 
class=\"hidden\">";
+       print "<img src=\"themes/$skin/css/dojo/images/loading.gif\" ";
+       print "style=\"vertical-align: middle;\"> Loading...</div>\n";
        print "   <div id=\"utilcontent\"></div>\n";
        $cdata = array('dispcompids' => $dispcompids);
        $cont = addContinuationsEntry('AJgenerateUtilData', $cdata, SECINDAY);
@@ -2916,8 +2916,6 @@ function computerUtilities() {
        print "     Close\n";
        print "    <script type=\"dojo/method\" event=\"onClick\">\n";
        print "       dijit.byId('utildialog').hide();\n";
-       print "       dojo.byId('utilcontent').innerHTML = '';\n";
-       print "       dojo.addClass('mgmtipdiv', 'hidden');\n";
        print "     </script>\n";
        print "   </button>\n";
        print "   </div>\n";

Modified: incubator/vcl/trunk/web/js/computers.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/computers.js?rev=1330981&r1=1330980&r2=1330981&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/computers.js (original)
+++ incubator/vcl/trunk/web/js/computers.js Thu Apr 26 17:26:32 2012
@@ -318,13 +318,15 @@ function generateCompData() {
                alert('You must select some computers first.');
                return;
        }
+       dojo.addClass('utilerror', 'hidden');
+       dojo.byId('utilcontent').innerHTML = '';
        if(dojo.byId('generatetype').value == 'dhcpd') {
                dojo.removeClass('mgmtipdiv', 'hidden');
-               dojo.addClass('utilerror', 'hidden');
                dijit.byId('utildialog').show();
        }
        else {
                dojo.removeClass('utilloading', 'hidden');
+               dojo.addClass('mgmtipdiv', 'hidden');
                dojo.addClass('utilcontent', 'hidden');
                generateHostsData(compids);
        }
@@ -335,6 +337,8 @@ function generateDHCPDdata() {
                alert('You must fill in an IP address first.');
                return;
        }
+       dojo.removeClass('utilloading', 'hidden');
+       dojo.addClass('utilcontent', 'hidden');
        var count = 0;
        var obj;
        var compids = new Array();
@@ -344,6 +348,7 @@ function generateDHCPDdata() {
                count++;
        }
        var allcompids = compids.join(',');
+       document.body.style.cursor = 'wait';
        var data = {continuation: dojo.byId('utilcont').value,
                    mnip: dojo.byId('mnip').value,
                    compids: allcompids};
@@ -356,10 +361,12 @@ function generateHostsData(compids) {
        var allcompids = compids.join(',');
        var data = {continuation: dojo.byId('utilcont').value,
                    compids: allcompids};
+       document.body.style.cursor = 'wait';
        RPCwrapper(data, generateCompDataCB, 1);
 }
 
 function generateCompDataCB(data, ioArgs) {
+       document.body.style.cursor = 'default';
        dojo.addClass('utilloading', 'hidden');
        if(data.items.status == 'success') {
                dojo.removeClass('utilcontent', 'hidden');


Reply via email to