From b33edfebcc066ae23314676faa01d23419acb9eb Mon Sep 17 00:00:00 2001 From: xq2005 Date: Thu, 22 Jul 2010 06:16:29 +0000 Subject: [PATCH] modified by xu qing for dispaly git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6825 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/configure/update.js | 57 ++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js index f83381130..077b550a1 100644 --- a/xCAT-UI/js/configure/update.js +++ b/xCAT-UI/js/configure/update.js @@ -4,16 +4,21 @@ * @return Nothing */ function loadUpdatePage() { - - repositoryDiv = $('
'); - rpmDiv = $('
'); - updateDiv = $('
'); - + + var repositoryDiv = $('
'); + var rpmDiv = $('
'); + var statusDiv = createStatusBar("update"); + statusDiv.hide(); + $('#updateTab').append(repositoryDiv); $('#updateTab').append(rpmDiv); - $('#updateTab').append(updateDiv); + $('#updateTab').append(statusDiv); + + var infoBar = createInfoBar('Select the Rpm and Repository, then press Update'); + repositoryDiv.append(infoBar); + - repositoryDiv.append("

Repository

"); + repositoryDiv.append("
Repository
"); $.ajax( { url : 'lib/systemcmd.php', @@ -25,7 +30,7 @@ success : showRepository }); - rpmDiv.append("

xCAT Update Info

"); + rpmDiv.append("
"); $.ajax({ url: 'lib/systemcmd.php', @@ -70,7 +75,7 @@ function showRepository(data) { Show = Show + "name='reporadio' value='" + DevelRepository + "'>"; Show = Show + DevelRepository + "(Devel)
"; - $('#repository').append(Show); + $('#repository fieldset').append(Show); //dispaly the Stable Repository, remember user's last selection Show = ""; Show = Show + StableRepository + "(Stable)
"; - $('#repository').append(Show); + $('#repository fieldset').append(Show); //dispaly the Input Repository, remember user's last selection if (($.cookie('xcatrepository')) @@ -98,7 +103,7 @@ function showRepository(data) { Show += ""; } - $('#repository').append(Show); + $('#repository fieldset').append(Show); } function showRpmInfo(data) @@ -109,7 +114,7 @@ function showRpmInfo(data) var temp = 0; if(null == data.rsp) { - $('#rpm').append("Get Rpm Info Error!"); + $('#rpm fieldset').append("Get Rpm Info Error!"); return; } @@ -117,10 +122,14 @@ function showRpmInfo(data) //no rpm installed, return if (1 > Rpms.length) { - $('#rpm').append("No Rpm installed!"); + $('#rpm fieldset').append("No Rpm installed!"); return; } + //clear the old data + $('#rpm fieldset').children().remove(); + $('#rpm fieldset').append("xCAT Rpm Info"); + Show = ""; Show += ""; Show += ""; @@ -148,12 +157,12 @@ function showRpmInfo(data) Show += ""; } Show += "
"; - Show += "" - $('#rpm').append(Show); + Show += ""; + $('#rpm fieldset').append(Show); //add the update button var updateButton = createButton('Update'); - $('#rpm').append(updateButton); + $('#rpm fieldset').append(updateButton); updateButton.bind('click', function(){ updateRpm(); }); @@ -216,6 +225,7 @@ function updateRpm() rpms = rpms.slice(0, -1); } + $('#update').show(); if ("" == rpms) { $('#update').empty(); @@ -236,6 +246,7 @@ function updateRpm() $('#update').empty(); $('#update').append("

update " + rpms + " from " + rpmPath + "

"); $('#update').append(""); + $('#rpm button').attr('disabled', 'true'); // send the update command to server $.ajax( { @@ -261,4 +272,18 @@ function ShowUpdateResult(data) { $('#update').append(data.rsp[temp] + ""); } + + //update the rpm info + $.ajax({ + url: 'lib/systemcmd.php', + dataType : 'json', + data : { + cmd : 'rpm -q xCAT-client perl-xCAT xCAT-server xCAT xCAT-rmc xCAT-UI' + }, + + success : showRpmInfo + }); + + $('#rpm button').attr('disabled', ''); + } \ No newline at end of file