Skip to content

Commit

Permalink
Merge pull request ManageIQ#1195 from AllenBW/BZ/#1471158-add-support…
Browse files Browse the repository at this point in the history
…s-vnc-console-flag

BZ#1471158-Adds support for supports_vnc_console decorator
  • Loading branch information
chriskacerguis authored Nov 6, 2017
2 parents 7eca416 + d068caf commit 3745df5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ function ComponentController ($stateParams, $state, $window, CollectionsApi, Eve
}

function openConsole (item) {
if (item['supports_console?'] && item.power_state === 'on') {
if (item['supports_console?'] && item['supports_vnc_console?'] && item.power_state === 'on') {
Consoles.open(item.id)
}
}

function openCockpit (item) {
if (item['supports_cockpit?'] && item.power_state === 'on') {
if (item['supports_console?'] && item['supports_cockpit?'] && item.power_state === 'on') {
$window.open('http://' + item.ipaddresses[0] + ':9090')
}
}
Expand Down
4 changes: 2 additions & 2 deletions client/app/services/service-details/service-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ <h2 translate>Resources</h2>
<ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu role="menu"
aria-labelledby="btn-append-to-to-body">
<li role="menuitem"
ng-class="{'disabled': !item['supports_console?'] || item.power_state !== 'on' || !$ctrl.customScope.permissions.console}"
ng-class="{'disabled': !item['supports_console?'] || !item['supports_vnc_console?'] || item.power_state !== 'on' || !$ctrl.customScope.permissions.console}"
ng-click="$ctrl.customScope.openConsole(item)">
<a href="#" translate>VM Console</a>
</li>
<li role="menuitem"
ng-class="{'disabled': !item['supports_cockpit?'] || item.power_state !== 'on' || !$ctrl.customScope.permissions.cockpit}"
ng-class="{'disabled': !item['supports_console?'] || !item['supports_cockpit?'] || item.power_state !== 'on' || !$ctrl.customScope.permissions.cockpit}"
ng-click="$ctrl.customScope.openCockpit(item)">
<a href="#" translate>Web Console</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion client/app/services/services-state.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ServicesStateFactory (ListConfiguration, CollectionsApi, RBAC) {
'vms.max_mem_usage_absolute_average_avg_over_time_period', 'vms.hardware',
'vms.hardware.aggregate_cpu_speed', 'vms.cpu_usagemhz_rate_average_avg_over_time_period', 'generic_objects.picture', 'generic_objects.generic_object_definition'
],
decorators: ['vms.supports_console?', 'vms.supports_cockpit?'],
decorators: ['vms.supports_console?', 'vms.supports_cockpit?', 'supports_vnc_console?'],
expand: ['vms', 'orchestration_stacks', 'generic_objects'],
auto_refresh: refresh
}
Expand Down
2 changes: 1 addition & 1 deletion client/app/services/services-state.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Service: ServicesStateFactory', () => {
'generic_objects.generic_object_definition'
],
expand: ['vms', 'orchestration_stacks', 'generic_objects'],
decorators: ['vms.supports_console?', 'vms.supports_cockpit?'],
decorators: ['vms.supports_console?', 'vms.supports_cockpit?', 'supports_vnc_console?'],
auto_refresh: false
}
done()
Expand Down

0 comments on commit 3745df5

Please sign in to comment.