Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #590
  • Loading branch information
gashcrumb committed Sep 30, 2013
1 parent dcf0310 commit c04e23f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/fabric/js/fabricPlugin.ts
Expand Up @@ -56,7 +56,7 @@ module Fabric {
workspace.topLevelTabs.push( {
content: "Create Fabric",
title: "Create a fabric starting with this container",
isValid: (workspace) => !Fabric.hasFabric(workspace),
isValid: (workspace) => Fabric.canBootstrapFabric(workspace) && !Fabric.fabricCreated(workspace),
href: () => "#/createFabric",
isActive: (workspace) => workspace.isLinkActive("createFabric")
});
Expand Down
13 changes: 11 additions & 2 deletions hawtio-web/src/main/webapp/app/fabric/js/helpers.ts
Expand Up @@ -8,12 +8,21 @@ module Fabric {
var fabricTopLevel = "fabric/profiles/";
var profileSuffix = ".profile";


export function fabricCreated(workspace) {
return workspace.treeContainsDomainAndProperties(Fabric.jmxDomain, {type: "Fabric"});
}

export function canBootstrapFabric(workspace) {
return workspace.treeContainsDomainAndProperties(Fabric.jmxDomain, {type: "ClusterBootstrapManager"});
}


export function hasFabric(workspace) {
// lets make sure we only have a fabric if we have the ClusterBootstrapManager available
// so that we hide Fabric for 6.0 or earlier of JBoss Fuse which doesn't have the necessary
// mbeans for hawtio awesomeness
return workspace.treeContainsDomainAndProperties(Fabric.jmxDomain, {type: "Fabric"})
&& workspace.treeContainsDomainAndProperties(Fabric.jmxDomain, {type: "ClusterBootstrapManager"});
return fabricCreated(workspace) && canBootstrapFabric(workspace);
}

/**
Expand Down

0 comments on commit c04e23f

Please sign in to comment.