* Code for task #76213.

This commit is contained in:
tanghucheng
2022-11-29 09:13:53 +08:00
parent b48be4763b
commit b2ae4e15a1
7 changed files with 30 additions and 6 deletions
+1
View File
@@ -232,6 +232,7 @@ $lang->action->desc->reboot = '$date, the execution node is reboot
$lang->action->desc->destroy = '$date, the execution node is destroyed by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->getvnc = '$date, Remote control <strong>$extra</strong> by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1
View File
@@ -232,6 +232,7 @@ $lang->action->desc->reboot = '$date, the execution node is reboot
$lang->action->desc->destroy = '$date, the execution node is destroyed by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->getvnc = '$date, Remote control <strong>$extra</strong> by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1
View File
@@ -232,6 +232,7 @@ $lang->action->desc->reboot = '$date, the execution node is reboot
$lang->action->desc->destroy = '$date, the execution node is destroyed by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->getvnc = '$date, Remote control <strong>$extra</strong> by <strong>$actor</strong> .' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> a créé un sous-tâche <strong>$extra</strong>。' . "\n";
+2
View File
@@ -232,6 +232,7 @@ $lang->action->desc->reboot = '$date, 由 <strong>$actor</strong>
$lang->action->desc->destroy = '$date, 由 <strong>$actor</strong> 销毁。' . "\n";
$lang->action->desc->switchtolight = '$date, 由 <strong>'. $lang->admin->system .'</strong> 从全生命周期管理模式切换为轻量管理模式。' . "\n";
$lang->action->desc->unlinkproduct = '$date, 系统判断由于迭代所属项目与$extra取消关联,同步将迭代与$extra取消关联。' . "\n";
$lang->action->desc->getvnc = '$date, <strong>$actor</strong>对执行节点 <strong>$extra</strong> 进行了远程操控。' . "\n";
/* 用来描述和父子任务相关的操作历史记录。*/
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 创建子任务 <strong>$extra</strong>。' . "\n";
@@ -406,6 +407,7 @@ $lang->action->label->suspend = '暂停了';
$lang->action->label->resume = '恢复了';
$lang->action->label->reboot = '重启了';
$lang->action->label->destroy = '销毁了';
$lang->action->label->getvnc = '远程操控';
$lang->action->label->switchtolight = '从全生命周期管理模式切换为轻量管理模式';
$lang->action->label->linkedrepo = '关联代码库到';
$lang->action->label->unlinkedrepo = '取消了项目与代码库的关联';
+19
View File
@@ -172,6 +172,25 @@ class zanode extends control
}
}
/**
* Bring up novmc management view.
*
* @param int $nodeID
* @access public
* @return void
*/
public function getVNC($nodeID)
{
$vnc = $this->zanode->getVncUrl($nodeID);
/* Add action log. */
if(!empty($vnc->token)) $this->loadModel('action')->create('zanode', $nodeID, 'getVNC');
$this->view->host = $vnc->hostIP;
$this->view->token = $vnc->token;
$this->display();
}
/**
* Ajax get template pairs by api.
*
+4 -4
View File
@@ -24,7 +24,7 @@ class zanodemodel extends model
const STATUS_DESTROY_FAIL = 'vim_destroy_fail';
const KVM_CREATE_PATH = '/api/v1/kvm/create';
const KVM_TOKEN_PATH = '/api/v1/vnc/getToken';
const KVM_TOKEN_PATH = '/api/v1/virtual/getVncToken';
/**
@@ -425,15 +425,15 @@ class zanodemodel extends model
$host = $this->getHostByID($vm->parent);
if(empty($host)) return false;
$agnetUrl = 'http://' . $host->extranet . ':' . $host->agentPort . static::KVM_TOKEN_PATH;
$result = json_decode(commonModel::http("$agnetUrl?port={$vm->vnc}"));
$agnetUrl = 'http://' . $host->extranet . ':8086' . static::KVM_TOKEN_PATH;
$result = json_decode(commonModel::http("$agnetUrl?port={$vm->vnc}", array(), array(CURLOPT_CUSTOMREQUEST => 'GET'), array(), 'json'));
if(empty($result) or $result->code != 'success') return false;
$returnData = new stdClass();
$returnData->hostIP = $host->extranet;
$returnData->agentPort = $host->agentPort;
$returnData->vnc = $vm->vnc;
$returnData->vnc = $vm->vnc;
$returnData->token = $result->data->token;
return $returnData;
}
+2 -2
View File
@@ -100,7 +100,7 @@
if(in_array($zanode->status, array("suspend", "")))
common::printLink('zanode', 'suspend', "id={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->suspend, '', "title='{$lang->zanode->suspend}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'");
common::printLink('zanode', 'resume', "id={$zanode->id}", "<i class='icon icon-restart'></i> " . $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}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn' target='hiddenwin'");
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn iframe'", '', true);
}
?>
<div class='divider'></div>
@@ -116,4 +116,4 @@
<div id='mainActions' class='main-actions'>
<?php common::printPreAndNext($browseLink); ?>
</div>
<?php include '../../common/view/footer.html.php'; ?>
<?php include '../../common/view/footer.html.php'; ?>