* Finish task #79050.

This commit is contained in:
tanghucheng
2022-12-06 13:40:26 +08:00
parent b135baf56c
commit ee2fed7a28
12 changed files with 50 additions and 10 deletions
+2
View File
@@ -255,6 +255,7 @@ define('TABLE_TESTRESULT', '`' . $config->db->prefix . 'testresult`');
define('TABLE_USERTPL', '`' . $config->db->prefix . 'usertpl`');
define('TABLE_ZAHOST', '`' . $config->db->prefix . 'host`');
define('TABLE_IMAGE', '`' . $config->db->prefix . 'image`');
define('TABLE_AUTOMATION', '`' . $config->db->prefix . 'automation`');
if(!defined('TABLE_ASSET')) define('TABLE_ASSET', '`' . $config->db->prefix . 'asset`');
@@ -399,6 +400,7 @@ $config->objectTables['stage'] = TABLE_STAGE;
$config->objectTables['apistruct'] = TABLE_APISTRUCT;
$config->objectTables['repo'] = TABLE_REPO;
$config->objectTables['zahost'] = TABLE_ZAHOST;
$config->objectTables['automation'] = TABLE_AUTOMATION;
$config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions');
$config->disabledFeatures = '';
+14 -3
View File
@@ -7,7 +7,7 @@ ALTER TABLE `zt_release` CHANGE `branch` `branch` varchar(255) NOT NULL;
ALTER TABLE `zt_release` CHANGE `build` `build` varchar(255) NOT NULL;
ALTER TABLE `zt_release` ADD `shadow` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `branch`;
ALTER TABLE `zt_host`
ALTER TABLE `zt_host`
DROP COLUMN `cabinet`,
DROP COLUMN `cpuRate`,
DROP COLUMN `diskType`,
@@ -56,7 +56,7 @@ CHANGE COLUMN `privateIP` `intranet` varchar(128) NOT NULL AFTER `cpuCores`,
CHANGE COLUMN `publicIP` `extranet` varchar(128) NOT NULL AFTER `intranet`;
UPDATE zt_host h,
zt_asset a
zt_asset a
SET h.`name` = a.`name`,
h.`createdBy` = a.`createdBy`,
h.`createdDate` = a.`createdDate`,
@@ -66,7 +66,7 @@ h.`group` = a.`group`,
h.`type` = a.`type`,
h.`deleted` = a.`deleted`
WHERE
h.`assetID` = a.`id`;
h.`assetID` = a.`id`;
ALTER TABLE `zt_host` DROP COLUMN `assetID`;
@@ -96,6 +96,17 @@ CREATE TABLE `zt_image` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `zt_automation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`node` int(11) unsigned NOT NULL DEFAULT 0,
`product` int(11) unsigned NOT NULL DEFAULT 0,
`path` varchar(255) NOT NULL DEFAULT '',
`shell` mediumtext NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES
+12
View File
@@ -7313,6 +7313,18 @@ CREATE TABLE `zt_image` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_automation`;
CREATE TABLE `zt_automation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`node` int(11) unsigned NOT NULL DEFAULT 0,
`product` int(11) unsigned NOT NULL DEFAULT 0,
`path` varchar(255) NOT NULL DEFAULT '',
`shell` mediumtext NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_service`;
CREATE TABLE IF NOT EXISTS `zt_service` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
+2
View File
@@ -1,3 +1,5 @@
.c-ip {width: 100px;}
.c-memory, .c-diskSize, .c-status, .c-cpuCores, .c-software, .c-instanceNum {width: 90px;}
.c-datetime {width: 150px;}
.status-wait {color: #f00;}
.c-actions {overflow: visible!important;}
+5
View File
@@ -0,0 +1,5 @@
$('#hostList tr[data-status="wait"]').hover(function(){
$(this).find('.inithost').tooltip('toggle');
},function(){
$(this).find('.inithost').tooltip('hide');
});
+1
View File
@@ -96,6 +96,7 @@ $lang->zahost->image->cancelDownloadSuccess = 'Successed to cancel image task';
$lang->zahost->empty = 'No Host';
$lang->zahost->statusList['wait'] = 'Wait';
$lang->zahost->statusList['ready'] = 'Ready';
$lang->zahost->statusList['online'] = 'Online';
+2 -1
View File
@@ -88,7 +88,7 @@ $lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';
$lang->zahost->image->imageEmpty = 'No Image';
$lang->zahost->image->downloadImageFail = 'Failed to create image task';
$lang->zahost->image->downloadImageSuccess = 'Successed to create image task';
$lang->zahost->image->cancelDownloadFail = 'Failed to cancel image task';
@@ -96,6 +96,7 @@ $lang->zahost->image->cancelDownloadSuccess = 'Successed to cancel image task';
$lang->zahost->empty = 'No Host';
$lang->zahost->statusList['wait'] = 'Wait';
$lang->zahost->statusList['ready'] = 'Ready';
$lang->zahost->statusList['online'] = 'Online';
+3 -2
View File
@@ -6,12 +6,12 @@ $lang->zahost->create = 'Add Host';
$lang->zahost->view = 'Host View';
$lang->zahost->init = 'Init Host';
$lang->zahost->edit = 'Éditer';
$lang->zahost->editAction = 'Edit Host';
$lang->zahost->delete = 'Delete';
$lang->zahost->cancel = "Cancel";
$lang->zahost->editAction = 'Éditer Hôte';
$lang->zahost->delete = 'Supprimer';
$lang->zahost->deleteAction = 'Supprimer Hôte';
$lang->zahost->byQuery = 'Recherche';
$lang->zahost->all = 'Tous les hôtes';
$lang->zahost->browseNode = 'ZAnode Browse';
$lang->zahost->deleted = "Deleted";
@@ -96,6 +96,7 @@ $lang->zahost->image->cancelDownloadSuccess = 'Successed to cancel image task';
$lang->zahost->empty = 'No Host';
$lang->zahost->statusList['wait'] = 'Wait';
$lang->zahost->statusList['ready'] = 'Ready';
$lang->zahost->statusList['online'] = 'Online';
+1
View File
@@ -96,6 +96,7 @@ $lang->zahost->image->cancelDownloadSuccess = '取消下载镜像任务成功';
$lang->zahost->empty = '暂时没有宿主机';
$lang->zahost->statusList['wait'] = '待初始化';
$lang->zahost->statusList['ready'] = '准备中';
$lang->zahost->statusList['online'] = '已上架';
+1
View File
@@ -37,6 +37,7 @@ class zahostModel extends model
$this->dao->table = 'zahost';
$hostInfo->type = 'zahost';
$hostInfo->status = 'wait';
$hostInfo->createdBy = $this->app->user->account;
$hostInfo->createdDate = helper::now();
$hostInfo->secret = md5($hostInfo->name . time());
+4 -4
View File
@@ -38,7 +38,7 @@
</p>
</div>
<?php else:?>
<table class='table has-sort-head table-fixed'>
<table class='table has-sort-head table-fixed' id='hostTable'>
<thead>
<tr>
<?php $vars = "browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
@@ -57,7 +57,7 @@
</thead>
<tbody>
<?php foreach($hostList as $host):?>
<tr class='text-left'>
<tr class='text-left' data-status="<?php echo $host->status;?>">
<td><?php printf('%03d', $host->hostID);?></td>
<td title='<?php echo $host->name?>'><?php echo html::a($this->inlink('view', "id=$host->hostID"), $host->name, '', "");?></td>
<td><?php echo zget($lang->zahost->zaHostTypeList, $host->hostType);?></td>
@@ -66,7 +66,7 @@
<td><?php echo $host->memory . $lang->zahost->unitList['GB'];?></td>
<td><?php echo $host->diskSize . $lang->zahost->unitList['GB'];?></td>
<td><?php echo $host->vsoft;?></td>
<td><?php echo zget($lang->host->statusList, $host->status);?></td>
<td class="status-<?php echo $host->status;?>"><?php echo zget($lang->host->statusList, $host->status);?></td>
<td><?php echo helper::isZeroDate($host->heartbeat) ? '' : $host->heartbeat;?></td>
<td class='c-actions'>
<?php $disabled = !empty($nodeList[$host->hostID]) ? '' : 'disabled';?>
@@ -74,7 +74,7 @@
<?php if(common::hasPriv('zahost', 'edit')) common::printIcon('zahost', 'edit', "hostID={$host->hostID}", $host, 'list');?>
<?php if(common::hasPriv('zahost', 'delete')) echo html::a($this->createLink('zahost', 'delete', "hostID={$host->id}"), '<i class="icon-trash"></i>', 'hiddenwin', "title='$title' class='btn $disabled'");;?>
<?php if(common::hasPriv('zahost', 'browseImage')) common::printIcon('zahost', 'browseImage', "hostID={$host->hostID}", $host, 'list', 'file', '', 'iframe', true, "data-width='60%'", $lang->zahost->image->list);?>
<?php if(common::hasPriv('zahost', 'initHost')) common::printIcon('zahost', 'initHost', "hostID={$host->hostID}", $host, 'list', 'info', '', '', false, '', $lang->zahost->initHost->title);?>
<?php if(common::hasPriv('zahost', 'initHost')) common::printIcon('zahost', 'initHost', "hostID={$host->hostID}", $host, 'list', 'info', '', ' inithost', false, "data-placement='bottom'", $lang->zahost->initHost->title);?>
</td>
</tr>
<?php endforeach;?>
+3
View File
@@ -231,3 +231,6 @@ tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-
.btn.disabled {pointer-events: auto;}
.btn.disabled i {color: #313c52;}
/* Unset style for qa qa-automation-menu. */
.qa-automation-menu > a:focus, .qa-automation-menu > a:hover {background: unset!important; cursor: default;}