From 3d3d9a3ef48227421380d8bd157e14b33704f0cd Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 16 Dec 2022 15:15:42 +0800 Subject: [PATCH] * Fix bug #30962,30965. --- module/zahost/model.php | 6 ++++-- module/zahost/view/browse.html.php | 2 +- module/zahost/view/edit.html.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/zahost/model.php b/module/zahost/model.php index 28f6060570..1d5fb404aa 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -89,15 +89,17 @@ class zahostModel extends model if(dao::isError()) return false; $ping = $this->checkAddress($hostInfo->extranet); + if(!$ping) { return false; } - $this->dao->update(TABLE_ZAHOST)->data($hostInfo, 'name')->autoCheck() + $this->dao->update(TABLE_ZAHOST)->data($hostInfo)->autoCheck() ->batchCheck('cpuCores,diskSize', 'gt', 0) ->batchCheck('diskSize,memory', 'float') ->where('id')->eq($hostID)->exec(); + return common::createChanges($oldHost, $hostInfo); } @@ -224,7 +226,7 @@ class zahostModel extends model ->page($pager) ->fetchAll('name'); } - + foreach($downloadedImageList as $image) { if($image->status == 'notDownloaded') diff --git a/module/zahost/view/browse.html.php b/module/zahost/view/browse.html.php index 244b6a7aec..b5a7113c77 100644 --- a/module/zahost/view/browse.html.php +++ b/module/zahost/view/browse.html.php @@ -69,7 +69,7 @@ host->statusList, $host->status);?> heartbeat) ? '' : $host->heartbeat;?> - hostID]) ? '' : 'disabled';?> + hostID]) ? 'disabled' : '';?> hostID]) ? $lang->zahost->delete : $lang->zahost->undeletedNotice;?> hostID}", $host, 'list');?> createLink('zahost', 'delete', "hostID={$host->id}"), '', 'hiddenwin', "title='$title' class='btn $disabled'");;?> diff --git a/module/zahost/view/edit.html.php b/module/zahost/view/edit.html.php index 8b160574a9..82f389f2dd 100644 --- a/module/zahost/view/edit.html.php +++ b/module/zahost/view/edit.html.php @@ -31,11 +31,11 @@ zahost->name;?> - name, "class='form-control' disabled");?> + name, "class='form-control'");?> zahost->IP;?> - extranet, "class='form-control' disabled");?> + extranet, "class='form-control' readonly");?> zahost->cpuCores;?>