Merge branch 'Web_Manager_Develope' of https://git.trustie.net/fhx569287825/aggregation-platform into Web_Manager_Develope

Web_Manager_Develope
Linda 8 years ago
commit 6141ec9723

@ -0,0 +1,6 @@
/// <reference path="../includes.d.ts" />
declare module Configs {
var pluginName: string;
var context: string;
var _module: ng.IModule;
}

@ -0,0 +1,7 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="configPlugin.d.ts" />
/// <reference path="../../developer/ts/developerNavigation.d.ts" />
declare module Configs {
function shareInit($scope: any, $location: any, $routeParams: any): void;
function createNewObejct(array: Array<any>, obj: any): any[];
}

@ -0,0 +1,13 @@
/// <reference path="../../includes.d.ts" />
declare module Configs {
var pluginName: string;
var context: string;
var pluginPath: string;
var templatePath: string;
var _module: ng.IModule;
var route: (templateName: string, reloadOnSearch?: boolean) => {
templateUrl: string;
reloadOnSearch: boolean;
};
var controller: (name: string, inlineAnnotatedConstructor: any[]) => ng.IModule;
}

@ -1,4 +1,5 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerNavigation.d.ts" />
declare module Developer {
function createCurrentSubNavBar($scope: any, $location: any, $routeParams: any): any;
}

@ -60,4 +60,5 @@ declare module Developer {
function environmentInstanceLink(env: any, projectName?: any): string;
function namespaceLink($scope: any, $routeParams: any, path?: any): string;
function normalizeHref(href: string): string;
function activateCurrent(navBarItems: any): any;
}

@ -1,5 +1,6 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerHelpers.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
declare module Developer {
var _module: ng.IModule;
var controller: (name: string, inlineAnnotatedConstructor: any[]) => ng.IModule;

@ -1,5 +1,6 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesModel.d.ts" />
/// <reference path="developerEnrichers.d.ts" />
/// <reference path="developerHelpers.d.ts" />
/// <reference path="dataManagerHelper.d.ts" />

11
defs.d.ts vendored

@ -1,13 +1,18 @@
/// <reference path="d.ts/includes.d.ts"/>
/// <reference path="d.ts/configs/ts/configPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/developerNavigation.d.ts"/>
/// <reference path="d.ts/configs/ts/configsHelper.d.ts"/>
/// <reference path="d.ts/configs/ts/configsUtils.d.ts"/>
/// <reference path="d.ts/configs/ts/kubeClusterSetting.d.ts"/>
/// <reference path="d.ts/configs/ts/shareController.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerHelper.d.ts"/>
/// <reference path="d.ts/developer/ts/developerHelpers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesInterfaces.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerEnrichers.d.ts"/>
/// <reference path="d.ts/developer/ts/developerNavigation.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesInterfaces.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJobs.d.ts"/>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -249,7 +249,7 @@ gulp.task('connect', ['watch'], function() {
}, {
proto: "http",
port: "8080",
hostname: "192.168.0.101",
hostname: "192.168.0.102",
path: '/java/console/api',
targetPath: "/"
}];

@ -26,7 +26,6 @@
<link rel="stylesheet" type="text/css" href="libs/angular-tree-control/css/tree-control-attribute.css">
<link rel="stylesheet" type="text/css" href="libs/angular-tree-control/css/tree-control.css">
<link rel="stylesheet" href="dist/hawtio-kubernetes.css" />
<link rel="stylesheet" type="text/css" href="new/sj_style.css">
<!-- bower:js -->
<script src="libs/jquery/dist/jquery.js"></script>
@ -95,7 +94,7 @@
<script type="text/javascript" src="libs/codemirror/mode/clike/clike.js"></script>
<script type="text/javascript" src="libs/codemirror/mode/yaml/yaml.js"></script>
<!-- link for js when using the tree as -->
<script type="text/javascript" src="libs/angular-tree-control/angular-tree-control.js"></script>
<script type="text/javascript" src="libs/angular-tree-control/angular-tree-control.js"></script>
<script src="libs/bootstrap/dist/js/bootstrap.js"></script>
<script src="libs/patternfly/dist/js/patternfly.js"></script>
<script src="libs/hawtio-extension-service/dist/hawtio-extension-service.js"></script>
@ -129,14 +128,24 @@
}
</style>
</head>
<body >
<nav class="navbar navbar-fixed-top navbar-pf sj_header " role="navigation" >
<a href="/" class="log fl sj_logo" ><img src="new/images/logo.png" class="log-img" ></a>
<ul class="nav navbar-nav navbar-primary sj_topnav" hawtio-main-nav></ul>
<body>
<nav class="navbar navbar-fixed-top navbar-pf sj_header " role="navigation">
<a href="/" class="log fl sj_logo"><img src="new/images/logo.png" class="log-img"></a>
<ul class="nav navbar-nav navbar-primary sj_topnav" hawtio-main-nav></ul>
<ul class="nav navbar-nav navbar-utility">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-cog"></span> 配置<b class="caret"></b>
</a>
<div class="dropdown-menu" hawtio-extension name="config-setting">
</div>
</li>
</ul>
</nav>
<platform-sub-tabs-outlet></platform-sub-tabs-outlet>
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet >
<div class="row" ng-class="getClass()" >
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet>
<div class="row" ng-class="getClass()">
<hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet>
</div>
<div class="row" ng-class="getClass()">

@ -0,0 +1,5 @@
<ul ng-controller="Configs.MenuItemController" class="nav nav-pills" role="tablist">
<li ng-repeat="item in menuItem" role="presentation">
<a href="{{item.href}}"><span class="{{item.icon}}"></span> {{item.label}}</a>
</li>
</ul>

@ -0,0 +1,8 @@
<div>
<div class="row">
<div hawtio-breadcrumbs></div>
</div>
<div class="row">
<div hawtio-tabs></div>
</div>
</div>

@ -0,0 +1,41 @@
<div ng-controller="Configs.KubeController">
<div class="row">
<div hawtio-breadcrumbs></div>
</div>
<div class="row">
<div hawtio-tabs></div>
</div>
<div class="container-content container-fluid sj_content">
<div class="row">
<table class="table" hawtio-simple-table="tableConfig" />
</div>
<div class="row">
<div class="col-md-1">
<button class="btn pull-right" ng-click="create()">
<span class="glyphicon glyphicon-plus"></span> 添加
</button>
</div>
</div>
<hr>
<div class="row" ng-show="tableForm.length>=0 && (edit || add)">
<h3 ng-show="edit">编辑汇总库连接信息:</h3>
<h3 ng-show="add">添加汇总库信息:</h3>
<div class="col-md-6 col-md-offset-1">
<form class="form-horizontal" ng-submit="onSubmit(validForm.$valid)" novalidate="novalidate" name="validForm">
<div class="form-group" ng-repeat="item in tableForm">
<label class="col-sm-2 control-label">{{item.name}}</label>
<div class="col-sm-10">
<input type="text" ng-model="item.value">
</div>
</div>
<div class="form-group">
<button class="btn" type='submit'>
<span class="glyphicon glyphicon-save"></span> 保存
</button>
</div>
</form>
</div>
</div>
<hr>
</div>
</div>

@ -0,0 +1,69 @@
/// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.ts"/>
/// <reference path="../../developer/ts/developerNavigation.ts"/>
module Configs{
_module.controller('Configs.MenuItemController',['$scope', '$location', ($scope, $location) => {
$scope.menuItem=[{
icon: "glyphicon glyphicon-cloud-upload",
label: "数据管理配置",
title: "配置数据存储信息",
href: UrlHelpers.join(context, "/gluster-fs/setting")
},
{
icon: "glyphicon glyphicon-th-list",
label: "服务集群配置",
title: "配置服务集群信息",
href: UrlHelpers.join(context, "/kube-cluster/setting")
}]
}]);
function createConfigBreadcrumbs($scope, $location, $routeParams){
var url = $location.url();
var label, title;
switch (url) {
case "/config/gluster-fs/setting":
label = "数据管理配置";
title= "配置数据存储信息";
break;
case "/config/kube-cluster/setting":
label = "服务集群配置";
title= "配置服务集群信息";
break;
default:
break;
}
return Developer.activateCurrent([{
href: url,
label: label,//item.label,
title: title//item.title
}]);
}
export function shareInit($scope, $location, $routeParams){
$scope.subTabConfig = createConfigBreadcrumbs($scope, $location, $routeParams);
}
export function createNewObejct(array:Array<any>, obj){
var result =[];
if(obj){
angular.forEach(array, (arr) =>{
result.push({
field: arr.field,
name: arr.displayName,
value: obj[arr.field]
});
});
}else{
angular.forEach(array, (arr) =>{
result.push({
field: arr.field,
name: arr.displayName,
value: null
});
});
}
return result;
}
}

@ -0,0 +1,28 @@
/// <reference path="../../includes.ts"/>
module Configs {
export var pluginName = "Configs";
export var context = "/config";
export var pluginPath = 'plugins/configs/';
export var templatePath = pluginPath + 'html/';
export var _module = angular.module(pluginName, ['hawtio-core', 'hawtio-ui', 'ui.codemirror', 'nvd3']);
export var route = PluginHelpers.createRoutingFunction(templatePath);
export var controller = PluginHelpers.createControllerFunction(_module, pluginName);
_module.config(['$provide', '$routeProvider', ($provide, $routeProvider) =>{
$routeProvider.when(UrlHelpers.join(context, '/gluster-fs/setting'), route('glusterfsSetting.html', false))
.when(UrlHelpers.join(context, 'kube-cluster/setting'), route('kubeClusterSetting.html', false))
.when(context, {redirectTo: UrlHelpers.join(context, '/kube-cluster/setting')});
}]);
_module.run(['viewRegistry', '$templateCache', 'HawtioExtension', '$compile', (viewRegistry, $templateCache:ng.ITemplateCacheService, ext, $compile:ng.ICompileService) => {
ext.add('config-setting', ($scope) => {
var template = $templateCache.get<string>(UrlHelpers.join(templatePath, "configMenuItem.html"));
return $compile(template)($scope);
});
viewRegistry['config'] = templatePath + "shareLayout.html";
}]);
hawtioPluginLoader.addModule(pluginName);
}

@ -1,4 +1,5 @@
/// <reference path="../../includes.ts"/>
/// <reference path="developerNavigation.ts"/>
module Developer{
var log = Logger.get('developer-navigation');
export function createCurrentSubNavBar($scope, $location, $routeParams){
@ -44,73 +45,5 @@ module Developer{
}]
}
]);
}
function activateCurrent(navBarItems) {
navBarItems = _.compact(navBarItems);
var injector = HawtioCore.injector;
var $location = injector ? injector.get<ng.ILocationService>("$location") : null;
if ($location) {
var path = normalizeHref(trimQuery($location.path()));
var found = false;
function makeActive(item) {
item.active = true;
found = true;
}
function getHref(item) {
var href = item.href;
var trimHref = trimQuery(href);
return normalizeHref(trimHref);
}
angular.forEach(navBarItems, (item) => {
if (!found && item) {
if (angular.isFunction(item.isActive)) {
if (item.isActive(item, path)) {
makeActive(item);
}
} else {
var trimHref = getHref(item);
if (!trimHref) {
return;
}
if (trimHref === path) {
makeActive(item);
}
}
}
});
// Maybe it's a sub-item of a tab, let's fall back to that maybe
if (!found) {
angular.forEach(navBarItems, (item) => {
if (!found) {
if (!angular.isFunction(item.isActive)) {
var trimHref = getHref(item);
if (!trimHref) {
return;
}
if (_.startsWith(path, trimHref)) {
makeActive(item);
}
}
}
});
}
// still not found, let's log it
if (!found) {
log.debug("No navigation tab found for path:", path);
}
}
return navBarItems;
}
function trimQuery(text) {
if (text) {
var idx = text.indexOf("?");
if (idx >= 0) {
return text.substring(0, idx);
}
}
return text;
}
}
}

@ -645,7 +645,7 @@ module Developer {
return href.replace(regex, '/');
}
function activateCurrent(navBarItems) {
export function activateCurrent(navBarItems) {
navBarItems = _.compact(navBarItems);
var injector = HawtioCore.injector;
var $location = injector ? injector.get<ng.ILocationService>("$location") : null;

@ -1,24 +1,23 @@
/// <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']);
export var controller = PluginHelpers.createControllerFunction(_module, pluginName);
export var route = PluginHelpers.createRoutingFunction(templatePath);
_module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => {
_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, 'task'), route('apps.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.otherwise(context);
}]);
}]);
_module.run(['viewRegistry', 'ServiceRegistry', 'HawtioNav', 'KubernetesModel', '$templateCache', (viewRegistry, ServiceRegistry, HawtioNav, KubernetesModel, $templateCache) => {
log.debug("Running");
log.debug("Running");
viewRegistry['workspaces'] = Kubernetes.templatePath + 'layoutKubernetes.html';
viewRegistry['namespaces'] = Kubernetes.templatePath + 'layoutKubernetes.html';

@ -1,6 +1,6 @@
/// <reference path="../../includes.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesModel.ts"/>
/// <reference path="developerEnrichers.ts"/>
/// <reference path="developerHelpers.ts"/>
/// <reference path="dataManagerHelper.ts"/>
@ -8,9 +8,10 @@
module Developer {
export var WorkspacesController = controller("WorkspacesController", ["$scope", "KubernetesModel", "DataModel","KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "$element",
($scope, KubernetesModel:Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element) => {
init($scope,location,$routeParams);
($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element) => {
init($scope, $location, $routeParams);
console.log($location.url());
$scope.model=DataModel;
$scope.model.initParamOptions();
$scope.options = DataModel.paramOptions;

@ -11,8 +11,7 @@ module Kubernetes {
export var controller = PluginHelpers.createControllerFunction(_module, pluginName);
export var route = PluginHelpers.createRoutingFunction(templatePath);
_module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => {
_module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => {
$routeProvider
.when(UrlHelpers.join(context, '/pods'), route('pods.html', false))
.when(UrlHelpers.join(context, 'replicationControllers'), route('replicationControllers.html', false))
@ -25,9 +24,7 @@ module Kubernetes {
.when(UrlHelpers.join(context, 'hosts/:id'), route('host.html', true))
.when(UrlHelpers.join(context, 'pipelines'), route('pipelines.html', false))
.when(UrlHelpers.join(context, 'overview'), route('overview.html', true))
.when(context, {redirectTo: UrlHelpers.join(context, 'replicationControllers')});
console.log("===================");
console.log(context);
.when(context, {redirectTo: UrlHelpers.join(context, 'replicationControllers')});
angular.forEach([context, "/workspaces/:workspace/projects/:project"], (context) => {
$routeProvider
@ -104,7 +101,7 @@ module Kubernetes {
});
_module.run(['viewRegistry', 'ServiceRegistry', 'HawtioNav', 'KubernetesModel', '$templateCache', (viewRegistry, ServiceRegistry, HawtioNav, KubernetesModel, $templateCache) => {
console.log("3");
log.debug("Running");
viewRegistry['kubernetes'] = templatePath + 'layoutKubernetes.html';
var builder = HawtioNav.builder();

@ -5,7 +5,8 @@ module Navigation {
export var log = Logger.get(pluginName);
export var _module = angular.module(pluginName, []);
_module.run(() => {
_module.run(() =>{
console.log("1");
});
_module.service('HawtioBreadcrumbs', () => {
@ -248,6 +249,7 @@ module Navigation {
}]);
//hawtioPluginLoader.addModule('patternfly');
hawtioPluginLoader.addModule(pluginName);
}

Loading…
Cancel
Save