Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BZ#1525692-Hides console buttons when indicated by server sans message #1354

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions client/app/services/service-details/service-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,29 @@ <h2 translate>Resources</h2>
</ul>
</div>
<div class="btn-group dropdown-kebab-pf" uib-dropdown dropdown-append-to-body
ng-if="$ctrl.customScope.permissions.cockpit || $ctrl.customScope.permissions.console">
<button type="button" class="btn btn-default" uib-dropdown-toggle
ng-if="($ctrl.customScope.permissions.cockpit || $ctrl.customScope.permissions.console)
&& (item.supported_consoles.vnc.visible || item.supported_consoles.vnc.message
|| item.supported_consoles.cockpit.visible || item.supported_consoles.cockpit.message)"> <button type="button" class="btn btn-default" uib-dropdown-toggle
type="button">
<i class="fa fa-window-maximize "></i>
<span translate>Access</span>
<span class="caret"></span>
</button>
<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.supported_consoles.vnc.visible || !item.supported_consoles.vnc.enabled || !$ctrl.customScope.permissions.console}"
<li ng-if="item.supported_consoles.vnc.visible || item.supported_consoles.vnc.message"
role="menuitem"
uib-tooltip="{{item.supported_consoles.vnc.message}}"
tooltip-placement="bottom"
ng-class="{'disabled': !item.supported_consoles.vnc.enabled || !$ctrl.customScope.permissions.console}"
ng-click="$ctrl.customScope.openConsole(item)">
<a href="#" translate>VM Console</a>
</li>
<li role="menuitem"
ng-class="{'disabled': !item.supported_consoles.cockpit.visible || !item.supported_consoles.cockpit.enabled || !$ctrl.customScope.permissions.cockpit}"
<li ng-if="item.supported_consoles.cockpit.visible || item.supported_consoles.cockpit.message"
role="menuitem"
uib-tooltip="{{item.supported_consoles.cockpit.message}}"
tooltip-placement="bottom"
ng-class="{'disabled': !item.supported_consoles.cockpit.enabled || !$ctrl.customScope.permissions.cockpit}"
ng-click="$ctrl.customScope.openCockpit(item)">
<a href="#" translate>Web Console</a>
</li>
Expand Down Expand Up @@ -350,16 +357,16 @@ <h2 translate>Resources</h2>
</ul>
<ul class="list-group service-details-resources" ng-if="vm.genericObjects.length">
<li class="list-group-item service-details-resource-group-item"
ng-repeat="genericObject in vm.genericObjects">
ng-repeat="genericObject in vm.genericObjects">
<a class="service-details-resource-group-title"
ng-class="{'collapsed': !genericObject.isExpanded}"
ng-click="vm.toggleOpenGenericObjects(genericObject)">
ng-class="{'collapsed': !genericObject.isExpanded}"
ng-click="vm.toggleOpenGenericObjects(genericObject)">
{{genericObject.name}} ({{genericObject.objects.length}})
</a>
<div class="service-details-resource-list-container"
ng-class="{'collapse': !genericObject.isExpanded}">
ng-class="{'collapse': !genericObject.isExpanded}">
<generic-objects-list generic-object="genericObject"
on-update="vm.setGenericObjectViewState(object)"></generic-objects-list>
on-update="vm.setGenericObjectViewState(object)"></generic-objects-list>
</div>
</li>
</ul>
Expand All @@ -372,9 +379,10 @@ <h2 translate>Resources</h2>
<div class="panel-body">
<section>
<h2 translate>Relationships</h2>
<pf-empty-state ng-if="!vm.service.parent_service && !vm.service.service_template" config="vm.emptyState"></pf-empty-state>
<pf-empty-state ng-if="!vm.service.parent_service && !vm.service.service_template"
config="vm.emptyState"></pf-empty-state>

<div class="container-fluid" ng-if="vm.service.parent_service || vm.service.service_template" >
<div class="container-fluid" ng-if="vm.service.parent_service || vm.service.service_template">
<div class="row" ng-if="vm.service.parent_service">
<div class="col-sm-4">
<a href="#" ng-click="vm.gotoService(vm.service.parent_service)">{{vm.service.parent_service.name}}</a>
Expand Down