Skip to content

Commit

Permalink
fixed up the links so you can navigate quicky to the profile, contain…
Browse files Browse the repository at this point in the history
…er or broker configuration
  • Loading branch information
jstrachan committed Oct 4, 2013
1 parent dcbdd0a commit 63f9e6f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
8 changes: 4 additions & 4 deletions hawtio-web/src/main/webapp/app/fabric/html/brokers.html
Expand Up @@ -21,7 +21,7 @@
</div>
<div class="mq-group-list" ng-repeat="group in groups" ng-show="groupMatchesFilter(profile)">
<div class="expandable" model="group">
<div class="mq-group-row">
<div class="mq-group-row" title="A group of message brokers; used by messaging clients to connect to one of a cluster of message brokers">
<span class="title mq-group-expander">
<i class="expandable-indicator" ng-show="group.profiles.length"></i>
</span>
Expand All @@ -36,7 +36,7 @@
<div class="mq-profile-list" ng-repeat="profile in group.profiles"
ng-show="profileMatchesFilter(profile)">
<div class="expandable" model="profile">
<div class="mq-profile-row">
<div class="mq-profile-row" title="Profile for running one or more logical brokers">
<span class="title mq-profile-expander">
<i class="expandable-indicator" ng-show="profile.brokers.length"></i>
</span>
Expand All @@ -51,7 +51,7 @@
<div class="mq-broker-list" ng-repeat="broker in profile.brokers"
ng-show="brokerMatchesFilter(broker)">
<div class="expandable" model="broker">
<div class="mq-broker-row">
<div class="mq-broker-row" title="Logical broker inside this profile">
<span class="title mq-broker-expander">
<i class="expandable-indicator" ng-show="broker.containers.length"></i>
</span>
Expand All @@ -66,7 +66,7 @@
<ul>
<li class="no-list" ng-repeat="container in broker.containers"
ng-show="containerMatchesFilter(container)">
<div class="mq-container-row">
<div class="mq-container-row" title="A container (JVM) which implements one or more logical brokers within this profile">
<i ng-show="!container.selected && showSelect" class="icon-circle-blank clickable"
title="Not Selected"
ng-click="container.selected = true"></i>
Expand Down
19 changes: 15 additions & 4 deletions hawtio-web/src/main/webapp/app/fabric/js/brokers.ts
Expand Up @@ -11,6 +11,13 @@ module Fabric {
container: {}
};

$scope.showBroker = (broker) => {
var path = Fabric.profileLink(workspace, jolokia, localStorage, broker.version, broker.profile);
path += "/org.fusesource.mq.fabric.server-" + broker.id + ".properties";
$location.path(path);
};


$scope.groupMatchesFilter = (group) => {
return true;
// return group.id.has($scope.searchFilter) || !group.profiles.find((profile) => $scope.profileMatchesFilter(profile));
Expand Down Expand Up @@ -61,7 +68,7 @@ module Fabric {
var groupId = brokerStatus.group || "Unknown";
var profileId = brokerStatus.profile || "Unknown";
var brokerId = brokerStatus.brokerName || "Unknown";
var containerId = brokerStatus.container || "Unknown";
var containerId = brokerStatus.container;
var versionId = brokerStatus.version || "1.0";

var group = findByIdOrCreate($scope.groups, groupId, maps.group, () => {
Expand All @@ -77,12 +84,16 @@ module Fabric {
});
var broker = findByIdOrCreate(profile.brokers, brokerId, maps.broker, () => {
return {
profile: profileId,
version: versionId,
containers: []
};
});
var container = findByIdOrCreate(broker.containers, containerId, maps.container, () => {
return brokerStatus;
});
if (containerId) {
var container = findByIdOrCreate(broker.containers, containerId, maps.container, () => {
return brokerStatus;
});
}
});
Core.$apply($scope);
}
Expand Down
20 changes: 12 additions & 8 deletions hawtio-web/src/main/webapp/app/fabric/js/helpers.ts
Expand Up @@ -94,11 +94,8 @@ module Fabric {
};

$scope.showProfile = (profile) => {
if (angular.isDefined(profile.versionId)) {
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, profile.versionId, profile);
} else {
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, $scope.activeVersionId, profile);
}
var version = profile.versionId || profile.version || $scope.activeVersionId;
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, version, profile);
};

$scope.getSelectedClass = (obj) => {
Expand Down Expand Up @@ -180,12 +177,19 @@ module Fabric {
return profileId.replace(/-/g, "/") + profileSuffix;
}

export function gotoProfile(workspace, jolokia, localStorage, $location, versionId, profile) {
export function profileLink(workspace, jolokia, localStorage, versionId, profileId) {
var path;
if (Wiki.isWikiEnabled(workspace, jolokia, localStorage)) {
$location.url("/wiki/branch/" + versionId + "/view/fabric/profiles/" + Fabric.profilePath(profile.id));
path = "/wiki/branch/" + versionId + "/view/fabric/profiles/" + Fabric.profilePath(profileId);
} else {
$location.url("/fabric/profile/" + versionId + "/" + profile.id);
path = "/fabric/profile/" + versionId + "/" + profileId;
}
return path;
}

export function gotoProfile(workspace, jolokia, localStorage, $location, versionId, profile) {
var path = profileLink(workspace, jolokia, localStorage, versionId, profile.id);
$location.url(path);
}

export function setSelect(selection, group) {
Expand Down

0 comments on commit 63f9e6f

Please sign in to comment.