Skip to content

Commit

Permalink
Link to the wiki pages for the profile view if it's in place
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Sep 11, 2013
1 parent 647448d commit 519d4b5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
Expand Up @@ -30,7 +30,7 @@
</td>
<td ng-class="getSelectedClass(profile)">
<span>{{profile.id}}</span>
<a ng-show="showLinks" ng-href="#/fabric/profile/{{versionId}}/{{profile.id}}"><i class="icon-info-sign clickable pull-right" title="Details for {{profile.id}}"></i></a>
<a href="" ng-show="showLinks" ng-click="goto(profile)"><i class="icon-info-sign clickable pull-right" title="Details for {{profile.id}}"></i></a>
</td>
</tr>
</tbody>
Expand Down
6 changes: 3 additions & 3 deletions hawtio-web/src/main/webapp/app/fabric/js/fabricView.ts
@@ -1,6 +1,6 @@
module Fabric {

export function FabricViewController($scope, $location, jolokia, localStorage) {
export function FabricViewController($scope, $location, jolokia, localStorage, workspace) {

$scope.containerArgs = ["id", "alive", "parentId", "profileIds", "versionId", "provisionResult", "jolokiaUrl", "root"];
$scope.containersOp = 'containers(java.util.List)';
Expand Down Expand Up @@ -472,9 +472,9 @@ module Fabric {

$scope.showProfile = (profile) => {
if (angular.isDefined(profile.versionId)) {
$location.path('/fabric/profile/' + profile.versionId + '/' + profile.id);
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, profile.versionId, profile);
} else {
$location.path('/fabric/profile/' + $scope.activeVersionId + '/' + profile.id);
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, $scope.activeVersionId, profile);
}
};

Expand Down
8 changes: 8 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/helpers.ts
Expand Up @@ -18,6 +18,14 @@ module Fabric {
}
}

export function gotoProfile(workspace, jolokia, localStorage, $location, versionId, profile) {
if (Wiki.isWikiEnabled(workspace, jolokia, localStorage)) {
$location.url("/wiki/branch/" + versionId + "/view/fabric/profiles/" + profile.id);
} else {
$location.url("/fabric/profile/" + versionId + "/" + profile.id);
}
}

export function setSelect(selection, group) {
if (!angular.isDefined(selection)) {
return group[0];
Expand Down
Expand Up @@ -19,7 +19,7 @@ module Fabric {
includedProfiles: '='
};

public controller = ($scope, $element, $attrs, jolokia) => {
public controller = ($scope, $element, $attrs, workspace, jolokia, localStorage, $location) => {
$scope.profiles = [];
$scope.responseJson = '';
$scope.filterText = '';
Expand All @@ -33,7 +33,11 @@ module Fabric {

$scope.showProfile = (profile) => {
return $scope.filterText.isBlank() || profile.id.has($scope.filterText);
}
};

$scope.goto = (profile) => {
Fabric.gotoProfile(workspace, jolokia, localStorage, $location, $scope.versionId, profile);
};


$scope.render = (response) => {
Expand All @@ -59,7 +63,7 @@ module Fabric {

Core.$apply($scope);
}
}
};

$scope.$watch('includedProfiles', (newValue, oldValue) => {
if (newValue !== oldValue) {
Expand All @@ -76,15 +80,15 @@ module Fabric {

$scope.selected = () => {
return $scope.profiles.filter((profile) => { return profile['selected']; });
}
};

$scope.selectAll = () => {
$scope.profiles.each((profile) => { profile.selected = true; });
}
};

$scope.selectNone = () => {
$scope.profiles.each((profile) => { delete profile.selected; });
}
};

$scope.$parent.profileSelectAll = $scope.selectAll;
$scope.$parent.profileSelectNone = $scope.selectNone;
Expand All @@ -95,7 +99,7 @@ module Fabric {
return "selected";
}
return "";
}
};


$scope.$watch('selectedAll', (newValue, oldValue) => {
Expand Down Expand Up @@ -132,7 +136,7 @@ module Fabric {
arguments: [$scope.versionId, ['id']]
}, onSuccess($scope.render));
}
}
};


$scope.$watch('versionId', (newValue, oldValue) => {
Expand Down

0 comments on commit 519d4b5

Please sign in to comment.