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("");
$.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("");
+
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