Skip to content

Commit

Permalink
Fix #714
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Nov 4, 2013
1 parent ec80164 commit e5c930d
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
Expand Up @@ -94,7 +94,8 @@
<i class="icon-plus clickable" ng-show="container.root && container.alive"
title="Create a new child container" ng-click="createChildContainer(container)"></i>

<i class="icon-signin clickable" ng-show="container.jolokiaUrl && container.alive"
<i class="icon-signin clickable"
ng-show="canConnect(container)"
title="Open a new window and connect to this container" ng-click="doConnect(container)"></i>
</div>

Expand Down
3 changes: 2 additions & 1 deletion hawtio-web/src/main/webapp/app/fabric/html/brokers.html
Expand Up @@ -117,7 +117,8 @@
ng-click="createChildContainer(container)"></i>
-->

<i class="icon-signin clickable" ng-show="container.jolokiaUrl && container.alive"
<i class="icon-signin clickable"
ng-show="canConnect(container)"
title="Connect to the Broker inside Container: {{container.id}}"
ng-click="connectToBroker(container, broker)"></i>

Expand Down
6 changes: 5 additions & 1 deletion hawtio-web/src/main/webapp/app/fabric/html/container.html
Expand Up @@ -53,7 +53,11 @@
<!-- TODO - rework this header in the css -->
<h2 style="display: inline-block; margin: 0"><i ng-class="statusIcon()"></i> Container: {{row.id}}</h2>
<div class="pull-right">
<button class="btn" ng-show="row.jolokiaUrl" ng-click="doConnect(container)"><i class="icon-signin"></i> Connect</button>
<button class="btn"
ng-show="canConnect(row)"
ng-click="doConnect(row)">
<i class="icon-signin"></i> Connect
</button>
<button class="btn" ng-show="row.alive" ng-click="stop()"><i class="icon-off"></i> Stop</button>
<button class="btn" ng-hide="row.alive" ng-click="start()"><i class="icon-play-circle"></i> Start</button>
<button class="btn" ng-click="delete()"><i class="icon-remove"></i> Delete</button>
Expand Down
Expand Up @@ -30,7 +30,10 @@

<i class="icon-plus clickable" ng-show="container.root && container.alive" title="Create a new child container" ng-click="createChildContainer(container)"></i>

<i class="icon-signin clickable" ng-show="container.jolokiaUrl && container.alive" title="Open a new window and connect to this container" ng-click="doConnect(container)"></i>
<i class="icon-signin clickable"
ng-show="canConnect(container)"
title="Open a new window and connect to this container"
ng-click="doConnect(container)"></i>
</div>

</div>
Expand Down
32 changes: 32 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/helpers.ts
Expand Up @@ -40,6 +40,38 @@ module Fabric {
* Adds a bunch of common helper functions to the given scope
*/
export function initScope($scope, $location, jolokia, workspace) {

$scope.isCurrentContainer = (container) => {
if (!container) {
return false;
}
if (Core.isBlank(Fabric.currentContainerId)) {
return false;
}
if (angular.isObject(container)) {
return container['id'] === Fabric.currentContainerId;
}
if (angular.isString(container)) {
return container === Fabric.currentContainerId;
}

return false;
};

$scope.canConnect = (container) => {
if (!container) {
return false;
}
if (Core.isBlank(container['jolokiaUrl'])) {
return false;
}

if (!Core.parseBooleanValue(container['alive'])) {
return false;
}
return !$scope.isCurrentContainer(container);
};

$scope.hasFabricWiki = () => {
return Git.isGitMBeanFabric(workspace);
};
Expand Down
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/css/site-base.css
Expand Up @@ -3041,7 +3041,7 @@ fs-donut svg g text.units {
}

.health-details-wrap table tr td:last-child {
padding-lrft: 5px;
padding-left: 5px;
overflow-x: hidden;
text-overflow: ellipsis;
}
Expand Down

0 comments on commit e5c930d

Please sign in to comment.