Skip to content

Commit

Permalink
Kick off new page for #746
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Nov 12, 2013
1 parent beacc45 commit b75295e
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 190 deletions.
41 changes: 41 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/html/assignProfile.html
@@ -0,0 +1,41 @@
<div class="controller-section" ng-controller="Fabric.AssignProfileController">

<div class="row-fluid">
<div class="span12">
Select the containers to assign "{{profileId}}" from version "{{versionId}}" to:
</div>
</div>

<div class="row-fluid">
<div class="span6">

<div class="section-header">

<div class="selection-controls">
<i class="icon-circle-blank clickable" title="Clear Selection" ng-click="setActiveContainer(null)"></i>
<i class="icon-circle clickable" title="Select All" ng-click="selectAllContainers()"></i>
</div>

<div class="section-filter">
<input type="text" class="search-query" placeholder="Filter..." ng-model="containerIdFilter">
<i class="icon-remove clickable" title="Clear Filter" ng-click="containerIdFilter = ''"></i>
</div>
</div>

<div fabric-container-list at-version="versionId" without-profile="profileId"></div>
</div>

<div class="span6">
<div class="row-fluid">
<h6>Selected Containers</h6>
<ul class="zebra-list">
<li ng-repeat="id in selectedContainerIds">{{id}}</li>
</ul>
</div>
</div>


</div>


</div>
43 changes: 0 additions & 43 deletions hawtio-web/src/main/webapp/app/fabric/html/assignProfiles.html

This file was deleted.

35 changes: 35 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/assignProfile.ts
@@ -0,0 +1,35 @@
module Fabric {

export function AssignProfileController($scope, jolokia, $location, $routeParams) {

$scope.profileId = $routeParams['pid'];
$scope.versionId = $routeParams['vid'];

var valid = true;

if (Core.isBlank($scope.profileId)) {
log.warn("No profile ID specified, redirecting to Fabric management view");
valid = false;
}

if (Core.isBlank($scope.versionId)) {
log.warn("No version ID specified, redirecting to Fabric management view");
valid = false;
}

if (!valid) {
$location.path("/fabric/view");
}

$scope.$on('$routeChangeSuccess', () => {
log.debug("RouteParams: ", $routeParams);
log.debug("Scope: ", $scope);
});

$scope.$watch('selectedContainerIds', (newValue, oldValue) => {
log.debug("selected containers: ", newValue);
}, true);

}

}
145 changes: 0 additions & 145 deletions hawtio-web/src/main/webapp/app/fabric/js/assignProfiles.ts

This file was deleted.

Expand Up @@ -184,6 +184,16 @@ module Fabric {
newContainers = tmp;
}

if (angular.isDefined($scope.atVersion)) {
newContainers = newContainers.filter((c) => { return c.versionId === $scope.atVersion; });
}

if (angular.isDefined($scope.withoutProfile)) {
newContainers = newContainers.filter((c) => {
return !c.profileIds.any((p) => { return p === $scope.withoutProfile; });
});
}

newContainers.each((container) => {
container.services = getServiceList(container);
var c = $scope.containers.find((c) => { return c.id === container.id; });
Expand Down Expand Up @@ -379,9 +389,25 @@ module Fabric {
}

public link = ($scope, $element, $attrs) => {
if (angular.isDefined($attrs['showSelect'])) {
$scope.showSelect = Core.parseBooleanValue($attrs['showSelect']);
$scope.showSelect = Core.parseBooleanValue(UI.getIfSet('showSelect', $attrs, 'true'));

var atVersion = UI.getIfSet('atVersion', $attrs, null);
var withoutProfile = UI.getIfSet('withoutProfile', $attrs, null);

if (atVersion !== null) {
$scope.atVersion = $scope.$eval(atVersion);
}

if (withoutProfile !== null) {
$scope.withoutProfile = $scope.$eval(withoutProfile);
}

log.debug("atVersion: ", $scope.atVersion);
log.debug("withoutProfile: ", $scope.withoutProfile);

log.debug("container list attributes: ", $attrs);


};

}
Expand Down
1 change: 1 addition & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/fabricPlugin.ts
Expand Up @@ -15,6 +15,7 @@ module Fabric {
when('/fabric/clusters/*page', {templateUrl: templatePath + 'clusters.html'}).
when('/fabric/containers', {templateUrl: templatePath + 'containers.html'}).
when('/fabric/container/:containerId', {templateUrl: templatePath + 'container.html'}).
when('/fabric/assignProfile', {templateUrl: templatePath + 'assignProfile.html'}).
when('/fabric/activeProfiles', {templateUrl: templatePath + 'activeProfiles.html'}).
//when('/fabric/profile/:versionId/:profileId', {templateUrl: templatePath + 'profile.html'}).
when('/wiki/profile/:versionId/:profileId/editFeatures', {templateUrl: templatePath + 'editFeatures.html'}).
Expand Down

0 comments on commit b75295e

Please sign in to comment.