Merge branch 'Web_Manager_Develope' of https://git.trustie.net/fhx569287825/aggregation-platform into Web_Manager_Develope
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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -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);
|
||||
}
|
Loading…
Reference in new issue