Loading src/Controller/DashboardController.php +33 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ class DashboardController extends ControllerBase implements DashboardControllerI if ($this->moduleHandler()->moduleExists('terraform') === TRUE) { $content[] = $this->getTerraformBlocks(); } if ($this->moduleHandler()->moduleExists('vmware') === TRUE) { $content[] = $this->getVmwareBlocks(); } return [ '#theme' => 'cloud_orchestrator_dashboard', '#top' => $this->getBlock('cloud_config_location'), Loading @@ -71,6 +74,36 @@ class DashboardController extends ControllerBase implements DashboardControllerI ]; } /** * Helper to get VMware blocks. * * @return array * Array of blocks; */ private function getVmwareBlocks(): array { $vmware_blocks = []; $vmware_blocks['label'] = $this->t('VMware'); $vmware_blocks['top'] = $this->getBlock( 'vmware_resources_block', [ 'cloud_context' => '', ], ); $vmware_blocks['first_above'][] = $this->getBlock( 'vmware_host_block', [ 'cloud_context' => '', ] ); $vmware_blocks['second_above'][] = $this->getBlock( 'vmware_vm_block', [ 'cloud_context' => '', ] ); return $vmware_blocks; } /** * Helper to get Terraform blocks. * Loading Loading
src/Controller/DashboardController.php +33 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ class DashboardController extends ControllerBase implements DashboardControllerI if ($this->moduleHandler()->moduleExists('terraform') === TRUE) { $content[] = $this->getTerraformBlocks(); } if ($this->moduleHandler()->moduleExists('vmware') === TRUE) { $content[] = $this->getVmwareBlocks(); } return [ '#theme' => 'cloud_orchestrator_dashboard', '#top' => $this->getBlock('cloud_config_location'), Loading @@ -71,6 +74,36 @@ class DashboardController extends ControllerBase implements DashboardControllerI ]; } /** * Helper to get VMware blocks. * * @return array * Array of blocks; */ private function getVmwareBlocks(): array { $vmware_blocks = []; $vmware_blocks['label'] = $this->t('VMware'); $vmware_blocks['top'] = $this->getBlock( 'vmware_resources_block', [ 'cloud_context' => '', ], ); $vmware_blocks['first_above'][] = $this->getBlock( 'vmware_host_block', [ 'cloud_context' => '', ] ); $vmware_blocks['second_above'][] = $this->getBlock( 'vmware_vm_block', [ 'cloud_context' => '', ] ); return $vmware_blocks; } /** * Helper to get Terraform blocks. * Loading