Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #693, also tracked down a few more spots so hopefully the perspec…
…tive won't seem to switch so randomly.
  • Loading branch information
gashcrumb committed Oct 31, 2013
1 parent b5958a0 commit ada4c74
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 17 deletions.
8 changes: 7 additions & 1 deletion hawtio-web/src/main/webapp/app/core/js/navbar.ts
Expand Up @@ -2,7 +2,7 @@ module Core {

export function NavBarController($scope, $location:ng.ILocationService, workspace:Workspace, $route, jolokia, localStorage) {

$scope.hash = null;
$scope.hash = workspace.hash();
$scope.topLevelTabs = [];
$scope.subLevelTabs = workspace.subLevelTabs;
$scope.currentPerspective = null;
Expand Down Expand Up @@ -56,6 +56,12 @@ module Core {
}
};

$scope.$watch('hash', (newValue, oldValue) => {
if (newValue !== oldValue) {
log.debug("hash changed from ", oldValue, " to ", newValue);
}
});

// when we change the view/selection lets update the hash so links have the latest stuff
$scope.$on('$routeChangeSuccess', function () {
$scope.hash = workspace.hash();
Expand Down
@@ -1,6 +1,8 @@
module Dashboard {

export function EditDashboardsController($scope, $routeParams, $route, $location, $rootScope, dashboardRepository:DefaultDashboardRepository, jolokia) {
export function EditDashboardsController($scope, $routeParams, $route, $location, $rootScope, dashboardRepository:DefaultDashboardRepository, jolokia, workspace:Workspace) {

$scope.hash = workspace.hash();
$scope.selectedItems = [];
$scope.repository = dashboardRepository;
$scope.duplicateDashboards = new Core.Dialog();
Expand Down
1 change: 1 addition & 0 deletions hawtio-web/src/main/webapp/app/dashboard/js/navbar.ts
Expand Up @@ -2,6 +2,7 @@ module Dashboard {
export function NavBarController($scope, $routeParams, $rootScope, workspace:Workspace,
dashboardRepository: DefaultDashboardRepository) {

$scope.hash = workspace.hash();
$scope._dashboards = [];

$scope.activeDashboard = $routeParams['dashboardId'];
Expand Down
Expand Up @@ -54,7 +54,7 @@
<div id="collapseFeatures" class="accordion-body collapse in">
<ul class="accordion-inner">
<li ng-repeat="feature in row.Dependencies">
<a href='#/osgi/feature/{{feature.Name}}/{{feature.Version}}{{hash}}'>{{feature.Name}}/{{feature.Version}}</a>
<a href='#/osgi/feature/{{feature.Name}}/{{feature.Version}}?p=container'>{{feature.Name}}/{{feature.Version}}</a>
</li>
</ul>
</div>
Expand All @@ -79,7 +79,7 @@
<li ng-repeat="bundle in row.BundleDetails">
<div ng-switch="bundle.Installed">
<p style="display: inline;" ng-switch-when="true">
<a href='#/osgi/bundle/{{bundle.Identifier}}{{hash}}'>{{bundle.Location}}</a></p>
<a href='#/osgi/bundle/{{bundle.Identifier}}?p=container'>{{bundle.Location}}</a></p>

<p style="display: inline;" ng-switch-default>{{bundle.Location}}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/karaf/js/features.ts
Expand Up @@ -129,7 +129,7 @@ module Karaf {
{
field: 'Version',
displayName: 'Version',
cellTemplate: '<div class="ngCellText"><a href="#/osgi/feature/{{row.entity.Name}}/{{row.entity.Version}}">{{row.getProperty(col.field)}}</a></div>',
cellTemplate: '<div class="ngCellText"><a href="#/osgi/feature/{{row.entity.Name}}/{{row.entity.Version}}?p=container">{{row.getProperty(col.field)}}</a></div>',
width: 200
},
{
Expand Down
5 changes: 5 additions & 0 deletions hawtio-web/src/main/webapp/app/karaf/js/navbar.ts
Expand Up @@ -2,10 +2,15 @@ module Karaf {

export function NavBarController($scope, workspace:Workspace) {

$scope.hash = workspace.hash();

$scope.isKarafEnabled = workspace.treeContainsDomainAndProperties("org.apache.karaf")
$scope.isFeaturesEnabled = Karaf.getSelectionFeaturesMBean(workspace);
$scope.isScrEnabled = Karaf.getSelectionScrMBean(workspace);

$scope.$on('$routeChangeSuccess', () => {
$scope.hash = workspace.hash();
});

$scope.isActive = (nav) => {
return workspace.isLinkActive(nav);
Expand Down
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/karaf/js/scr-components.ts
Expand Up @@ -29,7 +29,7 @@ module Karaf {
{
field: 'Name',
displayName: 'Name',
cellTemplate: '<div class="ngCellText"><a href="#/osgi/scr-component/{{row.entity.Name}}">{{row.getProperty(col.field)}}</a></div>',
cellTemplate: '<div class="ngCellText"><a href="#/osgi/scr-component/{{row.entity.Name}}?p=container">{{row.getProperty(col.field)}}</a></div>',
width: 400
},
{
Expand Down
10 changes: 5 additions & 5 deletions hawtio-web/src/main/webapp/app/osgi/html/bundle-list.html
Expand Up @@ -5,18 +5,18 @@
<form class="form-inline no-bottom-margin">
<fieldset>
<div class="btn-group inline-block">
<button onclick="location.href='#/osgi/bundle-list'"
<a ng-href="#/osgi/bundle-list?p=container"
type="button"
class="btn active"
title="List view">
<i class="icon-list"></i>
</button>
<button onclick="location.href='#/osgi/bundles'"
</a>
<a ng-href="#/osgi/bundles?p=container"
type="button"
class="btn"
title="Table view">
<i class="icon-table"></i>
</button>
</a>
</div>

<div class="input-append">
Expand Down Expand Up @@ -74,7 +74,7 @@
ng-show="filterBundle(bundle)"
hawtio-template-popover title="Bundle Details">
<a id="{{bundle.Identifier}}"
ng-href="#/osgi/bundle/{{bundle.Identifier}}">
ng-href="#/osgi/bundle/{{bundle.Identifier}}?p=container">
<span class="badge" ng-class="getStateStyle(bundle.State)">{{getLabel(bundle)}}</span>
</a>
</div>
Expand Down
8 changes: 4 additions & 4 deletions hawtio-web/src/main/webapp/app/osgi/html/bundles.html
Expand Up @@ -6,18 +6,18 @@
<fieldset>

<div class="btn-group inline-block">
<button onclick="location.href='#/osgi/bundle-list'"
<a ng-href="#/osgi/bundle-list?p=container"
type="button"
class="btn"
title="List view">
<i class="icon-list"></i>
</button>
<button onclick="location.href='#/osgi/bundles'"
</a>
<a ng-href="#/osgi/bundles?p=container"
type="button"
class="btn active"
title="Table view">
<i class="icon-table"></i>
</button>
</a>
</div>

<div class="controls control-group inline-block controls-row">
Expand Down
4 changes: 2 additions & 2 deletions hawtio-web/src/main/webapp/app/osgi/js/bundles.ts
Expand Up @@ -30,13 +30,13 @@ module Osgi {
field: 'Name',
displayName: 'Name',
width: "***",
cellTemplate: '<div class="ngCellText"><a href="#/osgi/bundle/{{row.entity.Identifier}}">{{row.getProperty(col.field)}}</a></div>'
cellTemplate: '<div class="ngCellText"><a href="#/osgi/bundle/{{row.entity.Identifier}}?p=container">{{row.getProperty(col.field)}}</a></div>'
},
{
field: 'SymbolicName',
displayName: 'Symbolic Name',
width: "***",
cellTemplate: '<div class="ngCellText"><a href="#/osgi/bundle/{{row.entity.Identifier}}">{{row.getProperty(col.field)}}</a></div>'
cellTemplate: '<div class="ngCellText"><a href="#/osgi/bundle/{{row.entity.Identifier}}?p=container">{{row.getProperty(col.field)}}</a></div>'
},
{
field: 'Version',
Expand Down

0 comments on commit ada4c74

Please sign in to comment.