Skip to content

Commit

Permalink
Fix #367
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Aug 6, 2013
1 parent 495b9c9 commit 8d4d68a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 50 deletions.
18 changes: 0 additions & 18 deletions hawtio-web/src/main/webapp/app/karaf/html/layoutKaraf.html

This file was deleted.

33 changes: 4 additions & 29 deletions hawtio-web/src/main/webapp/app/karaf/js/karafPlugin.ts
Expand Up @@ -2,38 +2,13 @@ module Karaf {
var pluginName = 'karaf';
angular.module(pluginName, ['bootstrap', 'ngResource', 'hawtioCore']).config(($routeProvider) => {
$routeProvider.
when('/karaf/server', {templateUrl: 'app/karaf/html/server.html'}).
when('/karaf/features', {templateUrl: 'app/karaf/html/features.html'}).
when('/karaf/scr', {templateUrl: 'app/karaf/html/scr.html'}).
when('/karaf/feature/:name/:version', {templateUrl: 'app/karaf/html/feature.html'})
when('/osgi/server', {templateUrl: 'app/karaf/html/server.html'}).
when('/osgi/features', {templateUrl: 'app/karaf/html/features.html'}).
when('/osgi/scr', {templateUrl: 'app/karaf/html/scr.html'}).
when('/osgi/feature/:name/:version', {templateUrl: 'app/karaf/html/feature.html'})
}).
run((workspace:Workspace, viewRegistry) => {

viewRegistry['karaf'] = "app/karaf/html/layoutKaraf.html";

workspace.topLevelTabs.push( {
content: "Karaf",
title: "Visualise and manage the bundles and services in this OSGi container",
isValid: (workspace: Workspace) => workspace.treeContainsDomainAndProperties("org.apache.karaf"),
href: () => "#/karaf/server?tab=karafTab",
isActive: (workspace: Workspace) => workspace.isTopTabActive("karafTab")
});

/*
workspace.subLevelTabs.push( {
content: '<i class="icon-list"></i> Server',
title: "View information about this OSGi container",
isValid: (workspace: Workspace) => workspace.isKarafFolder(),
href: () => "#/karaf/server"
});
workspace.subLevelTabs.push( {
content: '<i class="icon-list"></i> Features',
title: "View the available bundles in this OSGi container",
isValid: (workspace: Workspace) => getSelectionFeaturesMBean(workspace),
href: () => "#/karaf/features"
});
*/
});

hawtioPluginLoader.addModule(pluginName);
Expand Down
5 changes: 3 additions & 2 deletions hawtio-web/src/main/webapp/app/karaf/js/navbar.ts
@@ -1,7 +1,8 @@
module Karaf {

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

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

Expand All @@ -10,4 +11,4 @@ module Karaf {
return workspace.isLinkActive(nav);
};
}
}
}
11 changes: 10 additions & 1 deletion hawtio-web/src/main/webapp/app/osgi/html/layoutOsgi.html
@@ -1,4 +1,7 @@
<ul class="nav nav-tabs" ng-controller="Core.NavBarController">
<ul class="nav nav-tabs" ng-controller="Karaf.NavBarController">
<li ng-class='{active : isActive("#/osgi/server")}'>
<a ng-href="#/osgi/server{{hash}}">Server</a>
</li>
<li ng-class='{active : isActive("#/osgi/bundle")}'>
<a ng-href="#/osgi/bundle-list{{hash}}">Bundles</a>
</li>
Expand All @@ -8,9 +11,15 @@
<li ng-class='{active : isActive("#/osgi/service")}'>
<a ng-href="#/osgi/services{{hash}}">Services</a>
</li>
<li ng-class='{active : isActive("#/osgi/features")}' ng-show="isFeaturesEnabled">
<a ng-href="#/osgi/features{{hash}}">Features</a>
</li>
<li ng-class='{active : isActive("#/osgi/configuration")}'>
<a ng-href="#/osgi/configurations{{hash}}">Configuration</a>
</li>
<li ng-class='{active : isActive("#/osgi/scr")}' ng-show="isScrEnabled">
<a ng-href="#/osgi/scr{{hash}}">Declarative Services</a>
</li>
<li ng-class='{active : isActive("#/osgi/fwk")}'>
<a ng-href="#/osgi/fwk{{hash}}">Framework</a>
</li>
Expand Down

0 comments on commit 8d4d68a

Please sign in to comment.