diff --git a/api/v1/entries/zanodeheartbeat.php b/api/v1/entries/zanodeheartbeat.php index dc2af26f0f..bc82b6801a 100644 --- a/api/v1/entries/zanodeheartbeat.php +++ b/api/v1/entries/zanodeheartbeat.php @@ -23,8 +23,7 @@ class zanodeHeartbeatEntry extends baseEntry /* Check authorize. */ $header = getallheaders(); $token = isset($header['Authorization']) ? substr($header['Authorization'], 7) : ''; - $secret = isset($this->requestBody->secret) ? $this->requestBody->secret : ''; - if(!$secret and !$token) return $this->sendError(401, 'Unauthorized'); + if(!$token) return $this->sendError(401, 'Unauthorized'); /* Check param. */ $status = isset($this->requestBody->status) ? $this->requestBody->status : ''; @@ -34,8 +33,7 @@ class zanodeHeartbeatEntry extends baseEntry $this->dao = $this->loadModel('common')->dao; $host = $this->dao->select('id,extranet')->from(TABLE_ZAHOST) - ->beginIF($secret)->where('secret')->eq($secret)->fi() - ->beginIF(!$secret)->where('tokenSN')->eq($token) + ->where('tokenSN')->eq($token) ->andWhere('tokenTime')->gt($now)->fi() ->fetch(); if(empty($host)) return $this->sendError(400, 'Secret error.'); @@ -49,31 +47,8 @@ class zanodeHeartbeatEntry extends baseEntry $node->zap = $this->requestBody->agentPortOnHost; $node->status = $this->requestBody->status; - if($secret) - { - $node->tokenSN = md5($secret . $now); - $node->tokenTime = date('Y-m-d H:i:s', time() + 7200); - } - $this->dao->update(TABLE_ZAHOST)->data($node)->where('id')->eq($node->id)->exec(); - if($secret) - { - //install services - $node->ip = $host->extranet; - $nodeStatus = $this->loadModel('zanode')->getServiceStatus($node); - if($nodeStatus['ZTF'] != "ready") - { - $node->secret = $secret; - $node->extranet = $host->extranet; - $this->loadModel('zanode')->installService($node, "ZTF"); - } - } - - if(!$secret) return $this->sendSuccess(200, 'success'); - - $node->tokenTimeUnix = strtotime($node->tokenTime); - unset($node->status); unset($node->tokenTime); return $this->send(200, $node); diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 7097bb9b7c..ae647ebecc 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -227,10 +227,10 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; -$lang->action->desc->suspend = '$date, the execution node is suspended by $actor .' . "\n"; -$lang->action->desc->resume = '$date, the execution node is resumed by $actor .' . "\n"; -$lang->action->desc->reboot = '$date, the execution node is reboot by $actor .' . "\n"; -$lang->action->desc->destroy = '$date, the execution node is destroyed by $actor .' . "\n"; +$lang->action->desc->suspend = '$date, the ZenAgent Node is suspended by $actor .' . "\n"; +$lang->action->desc->resume = '$date, the ZenAgent Node is resumed by $actor .' . "\n"; +$lang->action->desc->reboot = '$date, the ZenAgent Node is reboot by $actor .' . "\n"; +$lang->action->desc->destroy = '$date, the ZenAgent Node is destroyed by $actor .' . "\n"; $lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by '. $lang->admin->system .'.' . "\n"; $lang->action->desc->getvnc = '$date, Remote control $extra by $actor .' . "\n"; $lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n"; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 6db47d91d7..28d549d44e 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -227,10 +227,10 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; -$lang->action->desc->suspend = '$date, the execution node is suspended by $actor .' . "\n"; -$lang->action->desc->resume = '$date, the execution node is resumed by $actor .' . "\n"; -$lang->action->desc->reboot = '$date, the execution node is reboot by $actor .' . "\n"; -$lang->action->desc->destroy = '$date, the execution node is destroyed by $actor .' . "\n"; +$lang->action->desc->suspend = '$date, the ZenAgent Node is suspended by $actor .' . "\n"; +$lang->action->desc->resume = '$date, the ZenAgent Node is resumed by $actor .' . "\n"; +$lang->action->desc->reboot = '$date, the ZenAgent Node is reboot by $actor .' . "\n"; +$lang->action->desc->destroy = '$date, the ZenAgent Node is destroyed by $actor .' . "\n"; $lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by '. $lang->admin->system .'.' . "\n"; $lang->action->desc->getvnc = '$date, Remote control $extra by $actor .' . "\n"; $lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n"; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index ffae2409c6..cc23b87958 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -227,10 +227,10 @@ $lang->action->desc->reopen = '$date, reopened by $actoraction->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; $lang->action->desc->ganttmove = '$date, sort by $actor .' . "\n"; -$lang->action->desc->suspend = '$date, the execution node is suspended by $actor .' . "\n"; -$lang->action->desc->resume = '$date, the execution node is resumed by $actor .' . "\n"; -$lang->action->desc->reboot = '$date, the execution node is reboot by $actor .' . "\n"; -$lang->action->desc->destroy = '$date, the execution node is destroyed by $actor .' . "\n"; +$lang->action->desc->suspend = '$date, the ZenAgent Node is suspended by $actor .' . "\n"; +$lang->action->desc->resume = '$date, the ZenAgent Node is resumed by $actor .' . "\n"; +$lang->action->desc->reboot = '$date, the ZenAgent Node is reboot by $actor .' . "\n"; +$lang->action->desc->destroy = '$date, the ZenAgent Node is destroyed by $actor .' . "\n"; $lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by '. $lang->admin->system .'.' . "\n"; $lang->action->desc->getvnc = '$date, Remote control $extra by $actor .' . "\n"; $lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n"; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index 4b5518d315..698e660763 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -186,10 +186,10 @@ $lang->action->desc->syncexecution = '$date, starting the task sets the execut $lang->action->desc->reopen = '$date, reopened by $actor .' . "\n"; $lang->action->desc->merged = '$date, merged by $actor .' . "\n"; $lang->action->desc->submitreview = '$date, submitted for review by $actor.' . "\n"; -$lang->action->desc->suspend = '$date, the execution node is suspended by $actor .' . "\n"; -$lang->action->desc->resume = '$date, the execution node is resumed by $actor .' . "\n"; -$lang->action->desc->reboot = '$date, the execution node is reboot by $actor .' . "\n"; -$lang->action->desc->destroy = '$date, the execution node is destroyed by $actor .' . "\n"; +$lang->action->desc->suspend = '$date, the ZenAgent Node is suspended by $actor .' . "\n"; +$lang->action->desc->resume = '$date, the ZenAgent Node is resumed by $actor .' . "\n"; +$lang->action->desc->reboot = '$date, the ZenAgent Node is reboot by $actor .' . "\n"; +$lang->action->desc->destroy = '$date, the ZenAgent Node is destroyed by $actor .' . "\n"; /* Used to describe the history of operations related to parent-child tasks. */ $lang->action->desc->createchildren = '$date, $actor created a child task $extra。' . "\n"; diff --git a/module/zahost/model.php b/module/zahost/model.php index 005a45c103..d405ff9a5d 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -197,17 +197,28 @@ class zahostModel extends model ->page($pager) ->fetchAll('name'); + $refreshPageData = false; foreach($imageList as &$image) { $downloadedImage = zget($downloadedImageList, $image->name, ''); if(empty($downloadedImage)) { + $refreshPageData = true; $image->id = 0; $image->status = 'notDownloaded'; $image->from = 'zentao'; $image->osName = $image->os; + $image->host = $hostID; + $image->status = 'notDownloaded'; + + unset($image->os); + $this->dao->insert(TABLE_IMAGE)->data($image, 'desc')->autoCheck()->exec(); + $image->cancelMisc = sprintf("title='%s' class='btn image-cancel image-cancel-%d %s'", $this->lang->zahost->cancel, $image->id, "disabled"); $image->downloadMisc = sprintf("title='%s' class='btn image-download image-download-%d %s'", $this->lang->zahost->image->downloadImage, $image->id, ""); + if(dao::isError()) continue; + + $image->id = $this->dao->lastInsertID(); } else { @@ -223,10 +234,13 @@ class zahostModel extends model $image->host = $hostID; } - $orderBy = explode('_', $orderBy); - if(count($orderBy) == 2) + if($refreshPageData) { - array_multisort(array_column($imageList, $orderBy[0]), $orderBy[1] == 'asc' ? SORT_ASC : SORT_DESC, $imageList); + $downloadedImageList = $this->dao->select('*')->from(TABLE_IMAGE) + ->where('host')->eq($hostID) + ->orderBy($orderBy) + ->page($pager) + ->fetchAll('name'); } return $imageList; } diff --git a/module/zanode/control.php b/module/zanode/control.php index 9e74d54940..96a5391d75 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -1,6 +1,6 @@ zanode->common = 'Execution Node'; -$lang->zanode->browse = 'Execution Node List'; -$lang->zanode->create = 'Create Execution Node'; -$lang->zanode->editAction = 'Edit Execution Node'; -$lang->zanode->view = 'View Execution Node'; +$lang->zanode->common = 'ZenAgent Node'; +$lang->zanode->browse = 'ZenAgent Node List'; +$lang->zanode->create = 'Create ZenAgent Node'; +$lang->zanode->editAction = 'Edit ZenAgent Node'; +$lang->zanode->view = 'View ZenAgent Node'; $lang->zanode->initTitle = 'Init ZenAgent Node'; -$lang->zanode->suspend = 'Suspend Execution Node'; -$lang->zanode->destroy = 'Destroy Execution Node'; -$lang->zanode->handleVM = 'Restart Execution Node'; -$lang->zanode->boot = 'Start Execution Node'; -$lang->zanode->reboot = 'Restart Execution Node'; -$lang->zanode->shutdown = 'Shutdown Execution Node'; -$lang->zanode->resume = 'Resume Execution Node'; +$lang->zanode->suspend = 'Suspend ZenAgent Node'; +$lang->zanode->destroy = 'Destroy ZenAgent Node'; +$lang->zanode->boot = 'Start ZenAgent Node'; +$lang->zanode->reboot = 'Restart ZenAgent Node'; +$lang->zanode->shutdown = 'Shutdown ZenAgent Node'; +$lang->zanode->resume = 'Resume ZenAgent Node'; $lang->zanode->getVNC = 'Remote management'; $lang->zanode->all = 'All'; $lang->zanode->byQuery = 'Search'; @@ -34,12 +33,12 @@ $lang->zanode->vnc = 'VNC Port'; $lang->zanode->destroyAt = 'Destroy Time'; $lang->zanode->creater = 'Creator'; $lang->zanode->createdDate = 'Create Date'; -$lang->zanode->confirmDelete = "Are you sure about destroying the execution node?"; -$lang->zanode->confirmBoot = "Are you sure to start the execution node?"; -$lang->zanode->confirmReboot = "Are you sure to restart the execution node?"; -$lang->zanode->confirmShutdown = "Are you sure to shutdown the execution node?"; -$lang->zanode->confirmSuspend = "Are you sure to suspend the execution node?"; -$lang->zanode->confirmResume = "Are you sure to resume the execution node?"; +$lang->zanode->confirmDelete = "Are you sure about destroying the ZenAgent Node?"; +$lang->zanode->confirmBoot = "Are you sure to start the ZenAgent Node?"; +$lang->zanode->confirmReboot = "Are you sure to restart the ZenAgent Node?"; +$lang->zanode->confirmShutdown = "Are you sure to shutdown the ZenAgent Node?"; +$lang->zanode->confirmSuspend = "Are you sure to suspend the ZenAgent Node?"; +$lang->zanode->confirmResume = "Are you sure to resume the ZenAgent Node?"; $lang->zanode->actionSuccess = 'Success'; $lang->zanode->deleted = "Deleted"; $lang->zanode->scriptPath = "Script path"; @@ -51,22 +50,22 @@ $lang->automation->scriptPath = $lang->zanode->scriptPath; $lang->automation->node = $lang->zanode->common; $lang->zanode->notFoundAgent = 'No Agent service is found'; -$lang->zanode->createVmFail = 'Failed to create a execution node'; +$lang->zanode->createVmFail = 'Failed to create a ZenAgent Node'; $lang->zanode->noVncPort = 'Failed to get vnc port'; $lang->zanode->nameValid = "Name must be letters, numbers,'-','_','.', And cannot begin with a symbol"; -$lang->zanode->empty = 'Execution node not found.'; +$lang->zanode->empty = 'ZenAgent Node not found.'; $lang->zanode->runCaseConfirm = 'The system detects the presence of an automation script. Whether to execute?'; -$lang->zanode->empty = 'No Execution Node'; +$lang->zanode->empty = 'No ZenAgent Node'; $lang->zanode->createImaging = 'Creating'; -$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the execution node to be shut down. Do you want to continue?'; +$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; $lang->zanode->createImageButton = 'Create image'; $lang->zanode->imageNameEmpty = 'Name can not be empty.'; -$lang->zanode->apiError['-10100'] = 'Execution node not found.'; +$lang->zanode->apiError['-10100'] = 'ZenAgent Node not found.'; $lang->zanode->publicList[0] = 'Private'; $lang->zanode->publicList[1] = 'Public'; diff --git a/module/zanode/lang/en.php b/module/zanode/lang/en.php index 53513c118e..58b5a6fa79 100644 --- a/module/zanode/lang/en.php +++ b/module/zanode/lang/en.php @@ -1,17 +1,16 @@ zanode->common = 'Execution Node'; -$lang->zanode->browse = 'Execution Node List'; -$lang->zanode->create = 'Create Execution Node'; -$lang->zanode->editAction = 'Edit Execution Node'; -$lang->zanode->view = 'View Execution Node'; +$lang->zanode->common = 'ZenAgent Node'; +$lang->zanode->browse = 'ZenAgent Node List'; +$lang->zanode->create = 'Create ZenAgent Node'; +$lang->zanode->editAction = 'Edit ZenAgent Node'; +$lang->zanode->view = 'View ZenAgent Node'; $lang->zanode->initTitle = 'Init ZenAgent Node'; -$lang->zanode->suspend = 'Suspend Execution Node'; -$lang->zanode->destroy = 'Destroy Execution Node'; -$lang->zanode->handleVM = 'Restart Execution Node'; -$lang->zanode->boot = 'Start Execution Node'; -$lang->zanode->reboot = 'Restart Execution Node'; -$lang->zanode->shutdown = 'Shutdown Execution Node'; -$lang->zanode->resume = 'Resume Execution Node'; +$lang->zanode->suspend = 'Suspend ZenAgent Node'; +$lang->zanode->destroy = 'Destroy ZenAgent Node'; +$lang->zanode->boot = 'Start ZenAgent Node'; +$lang->zanode->reboot = 'Restart ZenAgent Node'; +$lang->zanode->shutdown = 'Shutdown ZenAgent Node'; +$lang->zanode->resume = 'Resume ZenAgent Node'; $lang->zanode->getVNC = 'Remote management'; $lang->zanode->all = 'All'; $lang->zanode->byQuery = 'Search'; @@ -34,12 +33,12 @@ $lang->zanode->vnc = 'VNC Port'; $lang->zanode->destroyAt = 'Destroy Time'; $lang->zanode->creater = 'Creator'; $lang->zanode->createdDate = 'Create Date'; -$lang->zanode->confirmDelete = "Are you sure about destroying the execution node?"; -$lang->zanode->confirmBoot = "Are you sure to start the execution node?"; -$lang->zanode->confirmReboot = "Are you sure to restart the execution node?"; -$lang->zanode->confirmShutdown = "Are you sure to shutdown the execution node?"; -$lang->zanode->confirmSuspend = "Are you sure to suspend the execution node?"; -$lang->zanode->confirmResume = "Are you sure to resume the execution node?"; +$lang->zanode->confirmDelete = "Are you sure about destroying the ZenAgent Node?"; +$lang->zanode->confirmBoot = "Are you sure to start the ZenAgent Node?"; +$lang->zanode->confirmReboot = "Are you sure to restart the ZenAgent Node?"; +$lang->zanode->confirmShutdown = "Are you sure to shutdown the ZenAgent Node?"; +$lang->zanode->confirmSuspend = "Are you sure to suspend the ZenAgent Node?"; +$lang->zanode->confirmResume = "Are you sure to resume the ZenAgent Node?"; $lang->zanode->actionSuccess = 'Success'; $lang->zanode->deleted = "Deleted"; $lang->zanode->scriptPath = "Script path"; @@ -51,7 +50,7 @@ $lang->automation->scriptPath = $lang->zanode->scriptPath; $lang->automation->node = $lang->zanode->common; $lang->zanode->notFoundAgent = 'No Agent service is found'; -$lang->zanode->createVmFail = 'Failed to create a execution node'; +$lang->zanode->createVmFail = 'Failed to create a ZenAgent Node'; $lang->zanode->noVncPort = 'Failed to get vnc port'; $lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol"; $lang->zanode->empty = 'No zanode is found'; @@ -59,14 +58,14 @@ $lang->zanode->runCaseConfirm = 'The system detects the presence of an automatio $lang->zanode->empty = 'No ZenAgent Node'; $lang->zanode->createImaging = 'Creating'; -$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the execution node to be shut down. Do you want to continue?'; +$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; $lang->zanode->createImageButton = 'Create image'; $lang->zanode->imageNameEmpty = 'Name can not be empty.'; -$lang->zanode->apiError['-10100'] = 'Execution node not found.'; +$lang->zanode->apiError['-10100'] = 'ZenAgent Node not found.'; $lang->zanode->publicList[0] = 'Private'; $lang->zanode->publicList[1] = 'Public'; diff --git a/module/zanode/lang/fr.php b/module/zanode/lang/fr.php index 7f38c29a74..58b5a6fa79 100644 --- a/module/zanode/lang/fr.php +++ b/module/zanode/lang/fr.php @@ -1,17 +1,16 @@ zanode->common = 'Execution Node'; -$lang->zanode->browse = 'Execution Node List'; -$lang->zanode->create = 'Create Execution Node'; -$lang->zanode->editAction = 'Edit Execution Node'; -$lang->zanode->view = 'View Execution Node'; +$lang->zanode->common = 'ZenAgent Node'; +$lang->zanode->browse = 'ZenAgent Node List'; +$lang->zanode->create = 'Create ZenAgent Node'; +$lang->zanode->editAction = 'Edit ZenAgent Node'; +$lang->zanode->view = 'View ZenAgent Node'; $lang->zanode->initTitle = 'Init ZenAgent Node'; -$lang->zanode->suspend = 'Suspend Execution Node'; -$lang->zanode->destroy = 'Destroy Execution Node'; -$lang->zanode->handleVM = 'Restart Execution Node'; -$lang->zanode->boot = 'Start Execution Node'; -$lang->zanode->reboot = 'Restart Execution Node'; -$lang->zanode->shutdown = 'Shutdown Execution Node'; -$lang->zanode->resume = 'Resume Execution Node'; +$lang->zanode->suspend = 'Suspend ZenAgent Node'; +$lang->zanode->destroy = 'Destroy ZenAgent Node'; +$lang->zanode->boot = 'Start ZenAgent Node'; +$lang->zanode->reboot = 'Restart ZenAgent Node'; +$lang->zanode->shutdown = 'Shutdown ZenAgent Node'; +$lang->zanode->resume = 'Resume ZenAgent Node'; $lang->zanode->getVNC = 'Remote management'; $lang->zanode->all = 'All'; $lang->zanode->byQuery = 'Search'; @@ -34,12 +33,12 @@ $lang->zanode->vnc = 'VNC Port'; $lang->zanode->destroyAt = 'Destroy Time'; $lang->zanode->creater = 'Creator'; $lang->zanode->createdDate = 'Create Date'; -$lang->zanode->confirmDelete = "Are you sure about destroying the execution node?"; -$lang->zanode->confirmBoot = "Are you sure to start the execution node?"; -$lang->zanode->confirmReboot = "Are you sure to restart the execution node?"; -$lang->zanode->confirmShutdown = "Are you sure to shutdown the execution node?"; -$lang->zanode->confirmSuspend = "Are you sure to suspend the execution node?"; -$lang->zanode->confirmResume = "Are you sure to resume the execution node?"; +$lang->zanode->confirmDelete = "Are you sure about destroying the ZenAgent Node?"; +$lang->zanode->confirmBoot = "Are you sure to start the ZenAgent Node?"; +$lang->zanode->confirmReboot = "Are you sure to restart the ZenAgent Node?"; +$lang->zanode->confirmShutdown = "Are you sure to shutdown the ZenAgent Node?"; +$lang->zanode->confirmSuspend = "Are you sure to suspend the ZenAgent Node?"; +$lang->zanode->confirmResume = "Are you sure to resume the ZenAgent Node?"; $lang->zanode->actionSuccess = 'Success'; $lang->zanode->deleted = "Deleted"; $lang->zanode->scriptPath = "Script path"; @@ -51,22 +50,22 @@ $lang->automation->scriptPath = $lang->zanode->scriptPath; $lang->automation->node = $lang->zanode->common; $lang->zanode->notFoundAgent = 'No Agent service is found'; -$lang->zanode->createVmFail = 'Failed to create a execution node'; +$lang->zanode->createVmFail = 'Failed to create a ZenAgent Node'; $lang->zanode->noVncPort = 'Failed to get vnc port'; $lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol"; $lang->zanode->empty = 'No zanode is found'; $lang->zanode->runCaseConfirm = 'The system detects the presence of an automation script. Whether to execute?'; -$lang->zanode->empty = 'No Execution Node'; +$lang->zanode->empty = 'No ZenAgent Node'; $lang->zanode->createImaging = 'Creating'; -$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the execution node to be shut down. Do you want to continue?'; +$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; $lang->zanode->createImageButton = 'Create image'; $lang->zanode->imageNameEmpty = 'Name can not be empty.'; -$lang->zanode->apiError['-10100'] = 'Execution node not found.'; +$lang->zanode->apiError['-10100'] = 'ZenAgent Node not found.'; $lang->zanode->publicList[0] = 'Private'; $lang->zanode->publicList[1] = 'Public'; diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php index 9266f40c30..31362470e6 100644 --- a/module/zanode/lang/zh-cn.php +++ b/module/zanode/lang/zh-cn.php @@ -5,13 +5,12 @@ $lang->zanode->create = '创建执行节点'; $lang->zanode->editAction = '编辑执行节点'; $lang->zanode->view = '执行节点详情'; $lang->zanode->initTitle = '初始化执行节点'; -$lang->zanode->suspend = '暂停执行节点'; +$lang->zanode->suspend = '休眠执行节点'; $lang->zanode->destroy = '销毁执行节点'; -$lang->zanode->handleVM = '重启执行节点'; $lang->zanode->boot = '启动执行节点'; $lang->zanode->reboot = '重启执行节点'; $lang->zanode->shutdown = '关闭执行节点'; -$lang->zanode->resume = '恢复执行节点'; +$lang->zanode->resume = '启动执行节点'; $lang->zanode->getVNC = '远程管理'; $lang->zanode->all = '全部'; $lang->zanode->byQuery = '搜索'; diff --git a/module/zanode/model.php b/module/zanode/model.php index f9367d0e75..7de2da9aaf 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -84,7 +84,7 @@ class zanodemodel extends model return false; } - /* Prepare create execution node data. */ + /* Prepare create ZenAgent Node data. */ $data->image = $data->image; $data->parent = $host->id; $data->mac = $result->data->mac; @@ -93,7 +93,7 @@ class zanodemodel extends model $data->createdDate = helper::now(); $data->vnc = (int)$result->data->vnc; - /* Save execution node. */ + /* Save ZenAgent Node. */ $this->dao->insert(TABLE_ZAHOST)->data($data)->autoCheck()->exec(); if(dao::isError()) return false; @@ -209,7 +209,7 @@ class zanodemodel extends model if($data['code'] != 'success') return zget($this->lang->zanode->apiError, $data['code'], $data['msg']); } - /* delete execution node. */ + /* delete ZenAgent Node. */ $this->dao->update(TABLE_ZAHOST) ->set('deleted')->eq(1) ->where('id')->eq($id) @@ -219,7 +219,7 @@ class zanodemodel extends model } /** - * Get execution node created action record by node ID. + * Get ZenAgent Node created action record by node ID. * * @param int $id * @access public diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 9bb7ceb9e3..b532cbe1b3 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -110,13 +110,13 @@ if (empty($zanode->deleted)) { if($zanode->status == "running"){ - common::printLink('zanode', 'suspend', "id={$zanode->id}", " " . $lang->zanode->suspend, '', "title='{$lang->zanode->suspend}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"); + common::printLink('zanode', 'suspend', "id={$zanode->id}", " " . $lang->zanode->suspend, '', "title='{$lang->zanode->suspend}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"); } elseif($zanode->status == "suspend") { - common::printLink('zanode', 'resume', "id={$zanode->id}", " " . $lang->zanode->resume, '', "title='{$lang->zanode->resume}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"); + common::printLink('zanode', 'resume', "id={$zanode->id}", " " . $lang->zanode->resume, '', "title='{$lang->zanode->resume}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"); } - common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn iframe " . (common::hasPriv('zahost', 'getVNC') && $zanode->status == 'running' ? '':'disabled') . "'", '', true); + common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn iframe " . (common::hasPriv('zanode', 'getVNC') && $zanode->status == 'running' ? '':'disabled') . "'", '', true); } ?>