From 7f6afd21c6f835cfd7d511a15519500ffc7d7f4a Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 12 Nov 2024 20:02:48 +0800 Subject: [PATCH] * [bug#56919] Adjust host view page. --- db/update21.0.sql | 2 -- db/zentao.sql | 6 ------ module/host/ui/view.html.php | 16 ++++++++-------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/db/update21.0.sql b/db/update21.0.sql index fe7ab3f693..33415fea75 100644 --- a/db/update21.0.sql +++ b/db/update21.0.sql @@ -3,8 +3,6 @@ ALTER TABLE `zt_host` DROP COLUMN `hardwareType`; ALTER TABLE `zt_host` DROP COLUMN `cpuBrand`; ALTER TABLE `zt_host` DROP COLUMN `cpuModel`; ALTER TABLE `zt_host` DROP COLUMN `provider`; -ALTER TABLE `zt_host` ADD `CD` varchar(32) NOT NULL DEFAULT 'manual' AFTER `name`; -ALTER TABLE `zt_host` ADD `sshPort` mediumint NOT NULL DEFAULT 0 AFTER `ssh`; ALTER TABLE `zt_deploystep` DROP COLUMN `begin`; ALTER TABLE `zt_deploystep` DROP COLUMN `end`; diff --git a/db/zentao.sql b/db/zentao.sql index 5512a65189..e8857cefbb 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -2698,20 +2698,14 @@ CREATE TABLE `zt_host` ( `vsoft` varchar(30) NOT NULL DEFAULT '', `heartbeat` datetime NULL, `zap` varchar(10) NOT NULL DEFAULT '', - `provider` varchar(255) NOT NULL DEFAULT '', `vnc` int(11) NOT NULL DEFAULT '0', `ztf` int(11) NOT NULL DEFAULT '0', `zd` int(11) NOT NULL DEFAULT '0', `ssh` int(11) NOT NULL DEFAULT '0', - `sshPort` mediumint NOT NULL DEFAULT '0', `parent` int(11) unsigned NOT NULL DEFAULT '0', `image` int(11) unsigned NOT NULL DEFAULT '0', `admin` smallint(5) unsigned NOT NULL DEFAULT '0', `serverRoom` mediumint(8) unsigned NOT NULL DEFAULT '0', - `serverModel` varchar(256) NOT NULL DEFAULT '', - `hardwareType` varchar(64) NOT NULL DEFAULT '', - `cpuBrand` varchar(128) NOT NULL DEFAULT '', - `cpuModel` varchar(128) NOT NULL DEFAULT '', `cpuNumber` varchar(16) NOT NULL DEFAULT '', `cpuCores` varchar(30) NOT NULL DEFAULT '', `intranet` varchar(128) NOT NULL DEFAULT '', diff --git a/module/host/ui/view.html.php b/module/host/ui/view.html.php index 5c49d1926a..261b2b311f 100644 --- a/module/host/ui/view.html.php +++ b/module/host/ui/view.html.php @@ -32,8 +32,8 @@ detailBody setClass('table table-fixed canvas host-view-table'), h::tr ( - h::th($lang->host->CD), - h::td($host->CD), + isset($host->CD) ? h::th($lang->host->CD) : null, + isset($host->CD) ? h::td($host->CD) : null, h::th($lang->host->name), h::td($host->name) ), @@ -44,12 +44,12 @@ detailBody h::th($lang->host->serverRoom), h::td(zget($rooms, $host->serverRoom, "")) ), - $host->CD == 'spug' ? h::tr + zget($host, 'CD') == 'spug' ? h::tr ( h::th($lang->host->admin), h::td(zget($host, 'admin')), ) : null, - $host->CD == 'spug' ? h::tr + zget($host, 'CD') == 'spug' ? h::tr ( h::th($lang->host->password), h::td($lang->host->defaultPWD), @@ -77,12 +77,12 @@ detailBody ), h::tr ( - $host->CD != 'spug' ? h::th($lang->host->osName) : null, - $host->CD != 'spug' ? h::td($host->osName) : null, + zget($host, 'CD') != 'spug' ? h::th($lang->host->osName) : null, + zget($host, 'CD') != 'spug' ? h::td($host->osName) : null, h::th($lang->host->osVersion), - h::td($host->CD != 'spug' ? zget($lang->host->{$host->osName.'List'}, $host->osVersion) : $host->osName) + h::td(zget($host, 'CD') != 'spug' ? zget($lang->host->{$host->osName.'List'}, $host->osVersion) : $host->osName) ), - $host->CD != 'spug' ? h::tr + zget($host, 'CD') != 'spug' ? h::tr ( h::th($lang->host->status), h::td($lang->host->statusList[$host->status]),