Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove some now unused views and ensure correct version is picked up …
…from URL
  • Loading branch information
gashcrumb committed May 31, 2013
1 parent 8cdc1de commit 802765c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
2 changes: 2 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/html/layoutFabric.html
Expand Up @@ -2,12 +2,14 @@
<li ng-class='{active : isActive("#/fabric/view")}'>
<a ng-href="#/fabric/view{{hash}}">Overview</a>
</li>
<!--
<li ng-class='{active : isActive("#/fabric/profile")}'>
<a ng-href="#/fabric/profiles{{hash}}">Profiles</a>
</li>
<li ng-class='{active : isActive("#/fabric/container")}'>
<a ng-href="#/fabric/containers{{hash}}">Containers</a>
</li>
-->
<li ng-class='{active : isActive("#/fabric/clusters")}' ng-disabled="!Fabric.getZooKeeperFacadeMBean(workspace)">
<a ng-href="{{clusterLink()}}">Clusters</a>
</li>
Expand Down
5 changes: 5 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/html/profile.html
Expand Up @@ -5,13 +5,18 @@
<h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{row.id}}">{{versionId}}</a> /
{{row.id}}</h2>
&nbsp;
<!--
TODO : add this link back in when the overview supports filtering via active profile in the address bar
<a href="#/fabric/containers?cv={{versionId}}&cp={{row.id}}">
-->
<ng-pluralize count="row.containerCount"
when="{'0': 'No containers running',
'one': '1 container is running',
'other': '{} containers are running'}">
</ng-pluralize>
<!--
</a>
-->
</div>
<div class="pull-right">
<a class="btn" ng-href="#/fabric/containers/createContainer?versionId={{versionId}}&profileIds={{profileId}}"><i class="icon-truck"></i> Create Container</a>
Expand Down
15 changes: 1 addition & 14 deletions hawtio-web/src/main/webapp/app/fabric/js/createContainer.ts
Expand Up @@ -65,18 +65,15 @@ module Fabric {
$scope.$on('$routeUpdate', $scope.init);

$scope.$watch('versions', (newValue, oldValue) => {

if (newValue !== oldValue) {
if (!$scope.selectedVersion) {
if ($scope.selectedVersionId && $scope.selectedVersionId !== '') {
if ($scope.selectedVersionId !== '') {
$scope.selectedVersion = $scope.versions.find((v) => { return v.id === $scope.selectedVersionId });
} else {
$scope.selectedVersion = $scope.versions.find((v) => {return v.defaultVersion });
}
console.log("$scope.selectedVersion: ", $scope.selectedVersion);
}
}

});


Expand Down Expand Up @@ -140,16 +137,6 @@ module Fabric {
if (!Object.equal($scope.response, response.value)) {
$scope.response = response.value;
$scope.versions = Object.clone($scope.response);

if (!Object.equal($scope.selectedVersion, {})) {
console.log("versions: ", $scope.versions);
if ($scope.selectedVersionId !== '') {
$scope.selectedVersion = $scope.versions.find((v) => { return v.defaultVersion === true; });
} else {
$scope.selectedVersion = $scope.versions.find((v) => { return v.id === $scope.selectedVersionId; });
}
}

$scope.$apply();
}
}
Expand Down
4 changes: 0 additions & 4 deletions hawtio-web/src/main/webapp/app/fabric/js/fabricPlugin.ts
Expand Up @@ -3,14 +3,10 @@ module Fabric {

angular.module('fabric', ['bootstrap', 'ui.bootstrap', 'ui.bootstrap.dialog', 'ngResource', 'ngGrid', 'hawtio-forms', 'hawtioCore', 'ngDragDrop']).config(($routeProvider) => {
$routeProvider.
when('/fabric/containers', {templateUrl: 'app/fabric/html/containers.html'}).
when('/fabric/containers/createContainer', {templateUrl: 'app/fabric/html/createContainer.html' , reloadOnSearch: false }).
when('/fabric/containers/assignProfiles', {templateUrl: 'app/fabric/html/assignProfiles.html'}).
when('/fabric/containers/migrateVersions', {templateUrl: 'app/fabric/html/migrateVersions.html'}).
when('/fabric/map', {templateUrl: 'app/fabric/html/map.html'}).
when('/fabric/clusters/*page', {templateUrl: 'app/fabric/html/clusters.html'}).
when('/fabric/container/:containerId', {templateUrl: 'app/fabric/html/container.html'}).
when('/fabric/profiles', {templateUrl: 'app/fabric/html/profiles.html'}).
when('/fabric/profile/:versionId/:profileId', {templateUrl: 'app/fabric/html/profile.html'}).
when('/fabric/profile/:versionId/:profileId/:fname', {templateUrl: 'app/fabric/html/pid.html'}).
when('/fabric/view', { templateUrl: 'app/fabric/html/fabricView.html', reloadOnSearch: false });
Expand Down
3 changes: 3 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/fabricView.ts
Expand Up @@ -641,6 +641,7 @@ module Fabric {


$scope.deleteContainer = (name) => {
notification('info', "Deleting " + name);
destroyContainer(jolokia, name, () => {
notification('success', "Deleted " + name);
}, (response) => {
Expand All @@ -650,6 +651,7 @@ module Fabric {


$scope.startContainer = (name) => {
notification('info', "Starting " + name);
startContainer(jolokia, name, () => {
notification('success', "Started " + name);
}, (response) => {
Expand All @@ -659,6 +661,7 @@ module Fabric {


$scope.stopContainer = (name) => {
notification('info', "Stopping " + name);
stopContainer(jolokia, name, () => {
notification('success', "Stopped " + name);
}, (response) => {
Expand Down

0 comments on commit 802765c

Please sign in to comment.