diff --git a/module/zahost/js/browseimage.js b/module/zahost/js/browseimage.js index 6c8ab6b080..c0c7f8f0cd 100644 --- a/module/zahost/js/browseimage.js +++ b/module/zahost/js/browseimage.js @@ -27,8 +27,8 @@ function updateProgress() { $('.image-download-' + imageID).addClass('disabled'); $('.image-cancel-' + imageID).removeClass('disabled'); } - else if (statusList[imageID].statusCode == 'completed') - { + else if (statusList[imageID].statusCode == 'completed') + { $('.image-path-' + imageID).text(statusList[imageID].path); $('.image-path-' + imageID).attr('title', statusList[imageID].path); $('.image-download-' + imageID).addClass('disabled'); @@ -45,7 +45,7 @@ function updateProgress() { $('.image-progress-' + imageID).text(''); } $('.image-status-' + imageID).text(statusList[imageID].status); - if(statusList[imageID].progress != '') + if(statusList[imageID].progress != '' && statusList[imageID].statusCode != 'completed') { $('.image-progress-' + imageID).text(statusList[imageID].progress); } diff --git a/module/zahost/view/browseimage.html.php b/module/zahost/view/browseimage.html.php index de1d0fb181..c02d922464 100755 --- a/module/zahost/view/browseimage.html.php +++ b/module/zahost/view/browseimage.html.php @@ -46,7 +46,7 @@ osName;?> '>zahost->image->statusList, $image->status, '');?> '> - status == 'completed' ? '100%' : '';?> + createLink('zahost', 'downloadImage', "hostID={$hostID}&imageID={$image->id}"), '', 'hiddenwin', zget($image, 'downloadMisc', ''));?> createLink('zahost', 'cancelDownload', "id={$image->id}"), '', 'hiddenwin', zget($image, 'cancelMisc', ''));?> diff --git a/module/zanode/model.php b/module/zanode/model.php index 0109a9a642..698ad85f74 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -327,18 +327,18 @@ class zanodemodel extends model ->orderBy($orderBy) ->page($pager) ->fetchAll(); - + $hostIDList = array_column($list, 'parent'); $hosts = $this->dao->select('id,status,heartbeat')->from(TABLE_ZAHOST) ->where('id')->in(array_unique($hostIDList)) ->fetchAll('id'); - + foreach($list as $l) { $host = zget($hosts, $l->parent); if($l->status == 'running' || $l->status == 'ready') { - if(empty($host)) + if(empty($host)) { $l->status = self::STATUS_SHUTOFF; continue; @@ -548,7 +548,7 @@ class zanodemodel extends model ->where('mac')->eq($mac) ->andWhere("type")->eq('node') ->fetch(); - + $host = $this->loadModel("zahost")->getByID($node->parent); if($node->status == 'running' || $node->status == 'ready') {