From a0b40264c6a2d33856dd5141b25ff20092956613 Mon Sep 17 00:00:00 2001 From: wangjianhua Date: Mon, 19 Sep 2022 15:06:30 +0800 Subject: [PATCH] * Modify defalult value of variable. --- module/zahost/control.php | 2 +- module/zahost/model.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/zahost/control.php b/module/zahost/control.php index f9b4f2d98b..5952275709 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -264,7 +264,7 @@ class zahost extends control * @access public * @return void */ - public function ajaxImageList($hostID, $templateID = null) + public function ajaxImageList($hostID, $templateID = 0) { $host = $this->zahost->getById($hostID); $imageList = $this->zahost->getImageList($host, $templateID); diff --git a/module/zahost/model.php b/module/zahost/model.php index 006546b1b1..02b21154b9 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -175,10 +175,11 @@ class zahostModel extends model * Get image files from ZAgent server. * * @param object $host + * @param int $templateID * @access public * @return array */ - public function getImageList($host, $templateID = null) + public function getImageList($host, $templateID = 0) { $result = json_decode(commonModel::http("http://{$host->publicIP}:8086/api/v1/kvm/listTmpl?token={$host->secret}")); if(empty($result) || $result->code != 200) @@ -197,7 +198,7 @@ class zahostModel extends model $imageList[] = array('name' => $image->name); } - /* templateID is not empty means editing template. */ + /* Template ID is not empty means editing template. */ if($templateID) foreach($usedImageList as $usedImage) $imageList[] = array('name' => $usedImage->imageName); return $imageList;