aggregation-platform/plugins/developer/ts/developerPlugin.ts

49 lines
2.3 KiB
TypeScript

/// <reference path="../../includes.ts"/>
/// <reference path="developerHelpers.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
module Developer {
export var _module = angular.module(pluginName, ['hawtio-core', 'hawtio-ui', 'ui.codemirror', 'nvd3', 'treeControl', 'ngDialog']);
export var controller = PluginHelpers.createControllerFunction(_module, pluginName);
export var route = PluginHelpers.createRoutingFunction(templatePath);
_module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => {
$routeProvider.when(context, route('workspaces.html', false))
.when("/data-manager", route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/task'), route('fileMigrationTask.html', false))
.otherwise(context);
}]);
_module.run(['viewRegistry', 'ServiceRegistry', 'HawtioNav', 'KubernetesModel', '$templateCache', (viewRegistry, ServiceRegistry, HawtioNav, KubernetesModel, $templateCache) => {
log.debug("Running");
viewRegistry['workspaces'] = Kubernetes.templatePath + 'layoutKubernetes.html';
viewRegistry['namespaces'] = Kubernetes.templatePath + 'layoutKubernetes.html';
// viewRegistry['workspaces'] = Configs.templatePath + 'shareLayout.html';
var builder = HawtioNav.builder();
var dmanagerTab = builder.id('dmanager')
.rank(200)
.href(() => context)
.title(() => '数据管理')
//.isValid(() => !Core.isRemoteConnection())
.build();
HawtioNav.add(dmanagerTab);
}]);
_module.filter('asTrustedHtml', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text);
};
}]);
hawtioPluginLoader.addModule(pluginName);
// for scroll-glue directive
hawtioPluginLoader.addModule('luegg.directives');
}