-
sonarqube->noReport;?>
+
+

sonarqube->noReport;?>

+

- createLink('sonarqube', 'browseIssue', "sonarqubeID={$sonarqubeID}&project={$projectName}"), $projectName, '_parent') : $projectName;?> + createLink('sonarqube', 'browseIssue', "sonarqubeID={$sonarqubeID}&project=" . str_replace('-', '*', $projectKey)), $projectName, '_parent') : $projectName;?> projectStatus->status) and $qualitygate->projectStatus->status != 'NONE'):?> sonarqube->qualitygateList, $qualitygate->projectStatus->status);?> diff --git a/module/zahost/config/dtable.php b/module/zahost/config/dtable.php index 762456b7b0..be17bbe6c0 100644 --- a/module/zahost/config/dtable.php +++ b/module/zahost/config/dtable.php @@ -7,7 +7,7 @@ $config->zahost->dtable->fieldList['id']['title'] = $lang->idAB; $config->zahost->dtable->fieldList['id']['name'] = 'hostID'; $config->zahost->dtable->fieldList['id']['type'] = 'id'; -$config->zahost->dtable->fieldList['name']['type'] = 'title'; +$config->zahost->dtable->fieldList['name']['type'] = 'name'; $config->zahost->dtable->fieldList['name']['link'] = array('module' => 'zahost', 'method' => 'view', 'params' => 'id={hostID}'); $config->zahost->dtable->fieldList['type']['name'] = 'hostType'; diff --git a/module/zahost/ui/browse.html.php b/module/zahost/ui/browse.html.php index d988e0d9d7..0cd60b132c 100644 --- a/module/zahost/ui/browse.html.php +++ b/module/zahost/ui/browse.html.php @@ -54,6 +54,7 @@ dtable set::afterRender(jsRaw('window.afterRender')), set::sortLink(jsRaw('createSortLink')), set::footPager(usePager()), + set::orderBy(str_replace('id_', 'hostID_', $orderBy)), ); render(); diff --git a/module/zanode/config/dtable.php b/module/zanode/config/dtable.php index a9692f41ee..749a64c281 100644 --- a/module/zanode/config/dtable.php +++ b/module/zanode/config/dtable.php @@ -7,11 +7,12 @@ $config->zanode->dtable = new stdclass(); $config->zanode->dtable->fieldList['id']['title'] = $lang->idAB; $config->zanode->dtable->fieldList['id']['type'] = 'id'; -$config->zanode->dtable->fieldList['name']['type'] = 'title'; +$config->zanode->dtable->fieldList['name']['type'] = 'name'; $config->zanode->dtable->fieldList['name']['link'] = array('module' => 'zanode', 'method' => 'view', 'params' => 'id={id}'); -$config->zanode->dtable->fieldList['type']['name'] = 'hostType'; -$config->zanode->dtable->fieldList['type']['title'] = $lang->zahost->type; +$config->zanode->dtable->fieldList['type']['name'] = 'hostType'; +$config->zanode->dtable->fieldList['type']['title'] = $lang->zahost->type; +$config->zanode->dtable->fieldList['type']['map'] = array('physics' => $this->lang->zanode->typeList['physics'], 'physical' => $this->lang->zanode->typeList['node']); $config->zanode->dtable->fieldList['type']['sortType'] = true; $config->zanode->dtable->fieldList['extranet']['name'] = 'extranet'; @@ -26,7 +27,7 @@ $config->zanode->dtable->fieldList['memory']['sortType'] = true; $config->zanode->dtable->fieldList['diskSize']['name'] = 'diskSize'; $config->zanode->dtable->fieldList['diskSize']['sortType'] = true; -$config->zanode->dtable->fieldList['osName']['name'] = 'osName'; +$config->zanode->dtable->fieldList['osName']['name'] = 'osName'; $config->zanode->dtable->fieldList['status']['name'] = 'status'; $config->zanode->dtable->fieldList['status']['map'] = $lang->zanode->statusList; @@ -38,7 +39,7 @@ $config->zanode->dtable->fieldList['hostName']['sortType'] = true; $config->zanode->dtable->fieldList['actions']['name'] = 'actions'; $config->zanode->dtable->fieldList['actions']['title'] = $lang->actions; $config->zanode->dtable->fieldList['actions']['type'] = 'actions'; -$config->zanode->dtable->fieldList['actions']['menu'] = array('getVNC', 'resume|suspend', 'start|close', 'reboot', 'createSnapshot', 'more' => array('edit')); +$config->zanode->dtable->fieldList['actions']['menu'] = array('getVNC', 'resume|suspend', 'start|close', 'reboot', 'createSnapshot', 'more' => array('edit', 'createImage', 'destroy')); $config->zanode->dtable->fieldList['actions']['list']['getVNC']['icon'] = 'remote'; $config->zanode->dtable->fieldList['actions']['list']['getVNC']['hint'] = $lang->zanode->getVNC; @@ -76,11 +77,16 @@ $config->zanode->dtable->fieldList['actions']['list']['createSnapshot']['url'] $config->zanode->dtable->fieldList['actions']['list']['createSnapshot']['data-toggle'] = 'modal'; $config->zanode->dtable->fieldList['actions']['list']['createSnapshot']['className'] = 'create-snapshot'; -$config->zanode->dtable->fieldList['actions']['list']['more']['icon'] = 'ellipsis-v'; -$config->zanode->dtable->fieldList['actions']['list']['more']['hint'] = 'more'; -$config->zanode->dtable->fieldList['actions']['list']['more']['type'] = 'dropdown'; -$config->zanode->dtable->fieldList['actions']['list']['more']['caret'] = false; +$config->zanode->dtable->fieldList['actions']['list']['edit']['icon'] = 'edit'; +$config->zanode->dtable->fieldList['actions']['list']['edit']['hint'] = $lang->zanode->edit; +$config->zanode->dtable->fieldList['actions']['list']['edit']['url'] = array('module' => 'zanode', 'method' => 'edit', 'params' => 'zanodeID={id}'); -$config->zanode->dtable->fieldList['actions']['list']['edit']['icon'] = 'edit'; -$config->zanode->dtable->fieldList['actions']['list']['edit']['hint'] = $lang->zanode->edit; -$config->zanode->dtable->fieldList['actions']['list']['edit']['url'] = array('module' => 'zanode', 'method' => 'edit', 'params' => 'zanodeID={id}'); +$config->zanode->dtable->fieldList['actions']['list']['createImage']['icon'] = 'export'; +$config->zanode->dtable->fieldList['actions']['list']['createImage']['hint'] = $lang->zanode->createImage; +$config->zanode->dtable->fieldList['actions']['list']['createImage']['url'] = array('module' => 'zanode', 'method' => 'createImage', 'params' => 'zanodeID={id}'); +$config->zanode->dtable->fieldList['actions']['list']['createImage']['data-toggle'] = 'modal'; + +$config->zanode->dtable->fieldList['actions']['list']['destroy']['icon'] = 'trash'; +$config->zanode->dtable->fieldList['actions']['list']['destroy']['hint'] = $lang->zanode->destory; +$config->zanode->dtable->fieldList['actions']['list']['destroy']['url'] = array('module' => 'zanode', 'method' => 'destory', 'params' => 'zanodeID={id}'); +$config->zanode->dtable->fieldList['actions']['list']['destroy']['className'] = 'ajax-submit'; diff --git a/module/zanode/model.php b/module/zanode/model.php index 1685a8c1b5..bb60e0e800 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -1160,7 +1160,7 @@ class zanodemodel extends model * 判断按钮是否可点击。 * Judge an action is clickable or not. * - * @param object $host + * @param object $node * @param string $action * @access public * @return bool @@ -1173,9 +1173,11 @@ class zanodemodel extends model if($action == 'start') return $node->status == 'shutoff' && $node->hostType != 'physics' && !in_array($node->status, array('wait', 'creating_img', 'creating_snap', 'restoring')); if($action == 'close') return $node->status != 'shutoff' && $node->hostType != 'physics' && !in_array($node->status, array('wait', 'creating_img', 'creating_snap', 'restoring')); - if($action == 'getVNC') return $node->hostType == '' && in_array($node->status ,array('running', 'launch', 'wait')); + if($action == 'getVNC') return $node->hostType == '' && in_array($node->status ,array('running', 'launch', 'wait')); if($action == 'reboot') return $node->hostType != 'physics' && !in_array($node->status, array('wait', 'creating_img', 'creating_snap', 'restoring', 'shutoff')); + if($action == 'createSnapshot') return $node->hostType != 'physics' && $node->status == 'running'; + if($action == 'createImage') return $node->hostType != 'physics' && $node->status == 'running'; return true; } diff --git a/module/zanode/ui/browse.html.php b/module/zanode/ui/browse.html.php index 737eea89cd..0916e601e6 100644 --- a/module/zanode/ui/browse.html.php +++ b/module/zanode/ui/browse.html.php @@ -49,7 +49,7 @@ dtable set::afterRender(jsRaw('window.afterRender')), set::sortLink(jsRaw('createSortLink')), set::footPager(usePager()), - set::orderBy($orderBy), + set::orderBy(str_replace('t1.', '', $orderBy)), ); render();