diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js index 8f704b919..d79e9406d 100644 --- a/xCAT-UI/js/configure/update.js +++ b/xCAT-UI/js/configure/update.js @@ -246,7 +246,7 @@ function updateRpm() $.cookie('xcatrepository', rpmPathType, { path: '/xcat', expires: 10 }); $('#update').empty(); - $('#update').append("

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

"); + $('#update').append("

Updating " + rpms + " from " + rpmPath + "

"); $('#update').append(""); $('#rpm button').attr('disabled', 'true'); @@ -269,10 +269,27 @@ function ShowUpdateResult(data) { var temp = 0; $('#loadingpic').remove(); - $('#update').append("Update finished."); - for (temp = 0; temp < data.rsp.length; temp++) + + var resArray = data.rsp[0].split(/\n/); + if (('' == resArray[resArray.length - 1]) && (resArray.length > 1)){ + $('#update').append(resArray[resArray.length - 2]); + } + else{ + $('#update').append(resArray[resArray.length - 1]); + } + + $('#update').append('Response Detail:'); + $('#update a').bind('click', function(){ + $('#resDetail').show(); + }); + + var resDetail = $('
'); + resDetail.hide(); + $('#update').append(resDetail); + + for (temp = 0; temp < resArray.length; temp++) { - $('#update').append(data.rsp[temp] + ""); + resDetail.append(resArray[temp] + ""); } //update the rpm info diff --git a/xCAT-server/lib/xcat/plugins/web.pm b/xCAT-server/lib/xcat/plugins/web.pm index dba1e5bcf..17f822817 100644 --- a/xCAT-server/lib/xcat/plugins/web.pm +++ b/xCAT-server/lib/xcat/plugins/web.pm @@ -295,7 +295,7 @@ sub web_update { my $WebpageContent = undef; my $RemoteRpmFilePath = undef; my $LocalRpmFilePath = undef; - my @temp = undef; + if (xCAT::Utils->isLinux()) { $os = xCAT::Utils->osver(); @@ -318,7 +318,7 @@ sub web_update { #create file, return error if failed. unless ( open ($FileHandle, '>>', "/tmp/xCAT_update.yum.conf")) { - $callback->({error=>"Create temp file eror!\n",errorcode=>[1]}); + $callback->({error=>"Create temp file error!\n",errorcode=>[1]}); return; } @@ -337,8 +337,7 @@ sub web_update { } #run the command and return the result $ReturnInfo = readpipe($cmd); - @temp = split(/\n/, $ReturnInfo); - $callback->({info=>$temp[-1]}); + $callback->({info=>$ReturnInfo}); } #AIX else