Merge branch 'Web_Manager_Develope' of https://git.trustie.net/fhx569287825/aggregation-platform into Web_Manager_Develope
Conflicts: defs.d.ts dist/hawtio-kubernetes.js
This commit is contained in:
commit
757066182c
|
@ -0,0 +1,4 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
declare module Configs {
|
||||
function removeElementByValue(array: Array<any>, value: any, key?: string): void;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="configPlugin.d.ts" />
|
||||
declare module Configs {
|
||||
interface Block {
|
||||
ip: string;
|
||||
path: string;
|
||||
}
|
||||
interface oracleParam {
|
||||
name: string;
|
||||
ip: string;
|
||||
port: string;
|
||||
serviceName: string;
|
||||
tableName: string;
|
||||
status: string;
|
||||
}
|
||||
interface volume {
|
||||
name: string;
|
||||
totalSize: number;
|
||||
usedSize: number;
|
||||
block: Block;
|
||||
folder?: Array<any>;
|
||||
}
|
||||
class ConfigsModelService {
|
||||
cluster: Array<volume>;
|
||||
oracleParam: Array<oracleParam>;
|
||||
updateVolumeData($scope: ConfigsModelService, $http: any): void;
|
||||
getFolderByVolumeName(name: string): any[];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
declare module Configs {
|
||||
function removeElementByValue(array: Array<any>, value: any, key?: string): void;
|
||||
function removeElementsByValue(array: Array<any>, elements: Array<any>): void;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="configPlugin.d.ts" />
|
||||
/// <reference path="configsHelper.d.ts" />
|
||||
declare module Configs {
|
||||
var GfsController: ng.IModule;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="configPlugin.d.ts" />
|
||||
/// <reference path="ConfigsHelper.d.ts" />
|
||||
/// <reference path="configsUtils.d.ts" />
|
||||
declare module Configs {
|
||||
var KubeController: ng.IModule;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="configPlugin.d.ts" />
|
||||
declare module Configs {
|
||||
var EableEdit: ng.IModule;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
|
||||
/// <reference path="../../kubernetes/ts/kubernetesModel.d.ts" />
|
||||
/// <reference path="../../configs/ts/configsDataService.d.ts" />
|
||||
/// <reference path="developerEnrichers.d.ts" />
|
||||
/// <reference path="developerHelpers.d.ts" />
|
||||
/// <reference path="dataManagerHelper.d.ts" />
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
/// <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/configsDataService.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"/>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -117,3 +117,5 @@ treecontrol li:hover{}
|
|||
.search-query{ margin-top:0; margin-bottom: 0;}
|
||||
.filter-header .btn, .filter-header form { margin-bottom: 0; margin-top:0;}
|
||||
.kubernetes-view .filter-header{ margin-bottom: 0;}
|
||||
.sj_btn{box-shadow:none;-webkit-box-shadow:none; font-weight: normal; background:none; color: #0088cc;}
|
||||
.sj_btn:hover{ color: #005580;}
|
|
@ -5,13 +5,22 @@
|
|||
<div class="row">
|
||||
<div hawtio-tabs></div>
|
||||
</div>
|
||||
<div class="container-content container-fluid sj_content">
|
||||
<div class="container-content sj_content" >
|
||||
<div class="sj_content_position clear" >
|
||||
<ul >
|
||||
<li class="sj_icons_home"></li>
|
||||
<li>当前位置:</li>
|
||||
<li><a href="#">服务集群</a> <span>></span></li>
|
||||
<li><a href="#">服务管理</a> <span>></span></li>
|
||||
<li><a href="#">配置</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table" hawtio-simple-table="tableConfig" />
|
||||
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<button class="btn pull-right" ng-click="create()">
|
||||
<button class="btn pull-right sj_btn_blue" ng-click="create()">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<form class="form-horizontal" ng-submit="onSubmit(validForm.$valid)" novalidate="novalidate" name="validForm" ng-init="mode=tableForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" ng-model="mode.name" id="orcName" ng-minlength="4" ng-maxlength="20">
|
||||
<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="validForm.orcName.$valid" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" ng-model="mode.name" id="orcName" ng-minlength="4" ng-maxlength="20">
|
||||
<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="validForm.orcName.$valid" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn" type='submit'>
|
||||
<span class="glyphicon glyphicon-save"></span> 保存
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,18 @@
|
|||
<script type="text/ng-template" id="tableEdit.html" >
|
||||
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Configs.EableEdit">
|
||||
<button class="btn sj_btn" ng-click="editRow(entity)">
|
||||
<span class="glyphicon glyphicon-pencil"></span> 编辑
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
<button class="btn sj_btn" ng-click="deleteRow(entity)">
|
||||
<span class="glyphicon glyphicon-trash"></span> 删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="connectStatus.html">
|
||||
</script>
|
||||
<div ng-controller="Kubernetes.TopLevel">
|
||||
<div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop">
|
||||
<div class="row kubernetes-view" ng-view></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,70 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
module Configs{
|
||||
|
||||
export interface Block{
|
||||
ip:string; //存储块的机器ip地址
|
||||
path: string; //路径
|
||||
}
|
||||
|
||||
export interface oracleParam{
|
||||
name: string
|
||||
ip: string;
|
||||
port: string;
|
||||
serviceName: string;
|
||||
tableName: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface volume{
|
||||
name: string; //volume的名字
|
||||
totalSize: number; //volume空间大小
|
||||
usedSize: number; // volume已使用空间大小
|
||||
block: Block; //volume中的存储块
|
||||
folder?: Array<any>; //volume的文件
|
||||
}
|
||||
|
||||
//字节大小转换成字符大小
|
||||
function getStringSize(size: number){
|
||||
var result = size;
|
||||
var suffix =["B", "KB" ,"MB", "GB", "GB", "TB"];
|
||||
var count=1;
|
||||
while(result > 1024){
|
||||
result = result/1024;
|
||||
count ++;
|
||||
}
|
||||
return result + suffix[count];
|
||||
}
|
||||
|
||||
|
||||
export class ConfigsModelService{
|
||||
public cluster: Array<volume>=[];
|
||||
public oracleParam: Array<oracleParam>;
|
||||
|
||||
public updateVolumeData($scope: ConfigsModelService, $http){
|
||||
console.log($scope);
|
||||
$http({
|
||||
method: "POST",
|
||||
url: "/java/console/api/volume/list"
|
||||
}).success(function(data, status, headers, config) {
|
||||
$scope.cluster.push(data);
|
||||
}).error(function(data, status, headers, config) {
|
||||
//$scope.voume=data;
|
||||
});
|
||||
}
|
||||
|
||||
public getFolderByVolumeName(name: string){
|
||||
if(this.cluster===null)
|
||||
return null;
|
||||
for(var i=0; i< this.cluster.length; i++){
|
||||
if(this.cluster[i].name === name)
|
||||
return this.cluster[i].folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_module.factory('ConfigsModel', ['$rootScope', '$http', '$location', '$resource', ($rootScope, $http, $location, $resource) =>{
|
||||
var $scope = new ConfigsModelService();
|
||||
return $scope;
|
||||
}]);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
|
||||
module Configs{
|
||||
export function removeElementByValue(array:Array<any> ,value:any, key?:string ){
|
||||
if(key){
|
||||
for(var i=0; i<array.length; i++){
|
||||
if(array[i][key] === value){
|
||||
array.splice(i ,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(var i=0 ; i<array.length; i++){
|
||||
if(array[i] === value){
|
||||
array.splice(i ,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function removeElementsByValue(array: Array<any>, elements:Array<any>){
|
||||
angular.forEach(elements, (element) =>{
|
||||
removeElementByValue(array, element.value, element.key);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
/// <reference path="configsHelper.ts"/>
|
||||
/// <reference path="configsUtils.ts"/>
|
||||
module Configs{
|
||||
|
||||
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout",
|
||||
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout) => {
|
||||
|
||||
$scope.model= [{
|
||||
"name": "",
|
||||
"status": "OK",
|
||||
"ip": "10.188.2.3",
|
||||
"_id": 1
|
||||
},
|
||||
{
|
||||
"name": "camel-041",
|
||||
"status": "OK",
|
||||
"ip": "10.188.2.20",
|
||||
"_id": 2
|
||||
},
|
||||
{
|
||||
"name": "activemq-004",
|
||||
"status": "failed",
|
||||
"ip": "10.188.2.111",
|
||||
"_id": 3
|
||||
}];
|
||||
|
||||
$scope.tableConfig={
|
||||
data: "model",
|
||||
selectedItems: [{
|
||||
name: "activemq-004",
|
||||
status: "failed",
|
||||
ip: "10.188.2.111",
|
||||
_id: 2
|
||||
}],
|
||||
columnDefs: [{
|
||||
field: "_id",
|
||||
displayName: "序号"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
displayName: "名称"
|
||||
},
|
||||
{
|
||||
field: "ip",
|
||||
displayName: "IP"
|
||||
},
|
||||
{
|
||||
field: "port",
|
||||
displayName: "端口号"
|
||||
},
|
||||
{
|
||||
field: "userName",
|
||||
displayName: "用户名"
|
||||
},
|
||||
{
|
||||
field: "password",
|
||||
displayName: "密码"
|
||||
},
|
||||
{
|
||||
field: "serviceName",
|
||||
displayName: "服务名"
|
||||
},
|
||||
{
|
||||
field: "status",
|
||||
displayName: "连接状态"
|
||||
},
|
||||
{
|
||||
field: "entity",
|
||||
displayName: "操作",
|
||||
cellTemplate: $templateCache.get("tableEdit.html")
|
||||
}],
|
||||
enableRowClickSelection: true,
|
||||
showSelectionCheckbox: false,
|
||||
multiSelect: false,
|
||||
sortInfo: {
|
||||
sortBy: "_id",
|
||||
ascending: true
|
||||
}
|
||||
}
|
||||
|
||||
shareInit($scope, $location, $routeParams);
|
||||
|
||||
$scope.create = () =>{
|
||||
$scope.add= true;
|
||||
$scope.edit = false;
|
||||
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, null);
|
||||
removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
||||
}
|
||||
|
||||
$scope.onSubmit = () => {
|
||||
$scope.edit = false;
|
||||
$scope.add = false;
|
||||
console.log($scope.tableForm);
|
||||
}
|
||||
|
||||
$scope.$on("editRow", (event, data) =>{
|
||||
$scope.edit = true;
|
||||
$scope.add = false;
|
||||
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, data);
|
||||
removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
||||
}) ;
|
||||
|
||||
$scope.$on("deleteRow", (event, data) =>{
|
||||
removeElementByValue($scope.model, data._id, "_id");
|
||||
}) ;
|
||||
}]);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
module Configs{
|
||||
export var EableEdit = controller('EableEdit', ['$scope', ($scope) => {
|
||||
$scope.editRow = (entity)=>{
|
||||
$scope.$emit('editRow', entity);
|
||||
}
|
||||
|
||||
$scope.deleteRow = (entity) =>{
|
||||
$scope.$emit('deleteRow', entity);
|
||||
}
|
||||
}]);
|
||||
}
|
|
@ -65,10 +65,10 @@
|
|||
<label class="col-sm-3 control-label sj_contro_label" for="selectedItem ">
|
||||
请选择迁移集群
|
||||
</label>
|
||||
<select ng-model="migrationClick.selectedItem " class="col-sm-3 sj_modal_select" title="name of the new namespace " id="selectedItem " ng-options="x.$oracleName for x in filterReplicationControllers " />
|
||||
<select ng-model="migrationClick.selectedItem " class="col-sm-3 sj_modal_select" title="name of the new namespace " id="selectedItem " ng-options="x.name for x in configs.cluster " />
|
||||
</div>
|
||||
<div>
|
||||
<treecontrol class="tree-classic" tree-model="dataForTheTree" options="treeOptions" on-selection="showSelected(node)" selected-node="selectNode">
|
||||
<treecontrol class="tree-classic" tree-model="x.folder" options="treeOptions" on-selection="showSelected(node)" selected-node="selectNode">
|
||||
{{node.name}}
|
||||
</treecontrol>
|
||||
</div>
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/kubernetesModel.ts"/>
|
||||
/// <reference path="../../configs/ts/configsDataService.ts"/>
|
||||
/// <reference path="developerEnrichers.ts"/>
|
||||
/// <reference path="developerHelpers.ts"/>
|
||||
/// <reference path="dataManagerHelper.ts"/>
|
||||
/// <reference path="dataManagerModel.ts"/>
|
||||
|
||||
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);
|
||||
|
||||
console.log($location.url());
|
||||
export var WorkspacesController = controller("WorkspacesController", ["$scope", "KubernetesModel", "DataModel", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "$element",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, ConfigsModel:Configs.ConfigsModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element) => {
|
||||
init($scope, $location, $routeParams);
|
||||
$scope.model=DataModel;
|
||||
$scope.configs = ConfigsModel;
|
||||
$scope.model.initParamOptions();
|
||||
$scope.options = DataModel.paramOptions;
|
||||
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
|
||||
$scope.options.dataType = getDataType($location);
|
||||
|
||||
|
||||
console.log($scope.volumes);
|
||||
|
||||
$scope.model.updateModel();
|
||||
|
||||
|
@ -34,21 +37,6 @@ module Developer {
|
|||
labelSelected: "a8"
|
||||
}
|
||||
}
|
||||
$scope.dataForTheTree =
|
||||
[
|
||||
{ "name" : "Joe", "age" : "21", "children" : [
|
||||
{ "name" : "Smith", "age" : "42", "children" : [] },
|
||||
{ "name" : "Gary", "age" : "21", "children" : [
|
||||
{ "name" : "Jenifer", "age" : "23", "children" : [
|
||||
{ "name" : "Dani", "age" : "32", "children" : [] },
|
||||
{ "name" : "Max", "age" : "34", "children" : [] }
|
||||
]}
|
||||
]}
|
||||
]},
|
||||
{ "name" : "Albert", "age" : "33", "children" : [] },
|
||||
{ "name" : "Ron", "age" : "29", "children" : [] }
|
||||
];
|
||||
|
||||
|
||||
//配置数据表格需要显示的内容及显示格式
|
||||
$scope.tableConfig = {
|
||||
|
@ -181,16 +169,8 @@ module Developer {
|
|||
open: (selected) =>{
|
||||
var migrationClick = $scope.migrationClick;
|
||||
migrationClick.dialog.open();
|
||||
$http({
|
||||
url: "/java/console/api/getFolder",
|
||||
method:'POST',
|
||||
params:{oracleName: selected}
|
||||
}).success(function(data,header,config,status){
|
||||
$scope.treeData = data;
|
||||
console.log("success");
|
||||
}).error(function(data,header,config,status){
|
||||
//log.warn("Failed to connect " + connectParam + " " + data + " " + status);
|
||||
});
|
||||
console.log("===================");
|
||||
console.log(selected);
|
||||
},
|
||||
close: () => {
|
||||
$scope.migrationClick.dialog.close();
|
||||
|
@ -199,7 +179,7 @@ module Developer {
|
|||
|
||||
$scope.createOracleService = (items) =>{
|
||||
console.log(items);
|
||||
/*angular.forEach(items,(item)=>{
|
||||
angular.forEach(items,(item)=>{
|
||||
console.log(item);
|
||||
Kubernetes.createRC({
|
||||
name: item._key,
|
||||
|
@ -218,11 +198,12 @@ module Developer {
|
|||
}, (rc) =>{
|
||||
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
||||
function init($scope,$location,$routeParams){
|
||||
//创建二级菜单
|
||||
ConfigsModel.updateVolumeData($scope.configs, $http);
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.navbarItems =[{
|
||||
herf: "",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="kubernetesHelpers.ts"/>
|
||||
|
||||
|
||||
declare var OSOAuthConfig:any;
|
||||
declare var GoogleOAuthConfig:any;
|
||||
declare var KeycloakConfig:any;
|
||||
|
|
|
@ -2,12 +2,14 @@
|
|||
/// <reference path="kubernetesHelpers.ts"/>
|
||||
/// <reference path="kubernetesPlugin.ts"/>
|
||||
/// <reference path="kubernetesModel.ts"/>
|
||||
///
|
||||
|
||||
module Kubernetes {
|
||||
|
||||
export var FileDropController = controller("FileDropController", ["$scope", "KubernetesModel", "FileUploader", '$http', ($scope, model:KubernetesModelService, FileUploader, $http:ng.IHttpService) => {
|
||||
|
||||
var log = Logger.get('kubernetes-file-uploader');
|
||||
console.log("---------------------------");
|
||||
|
||||
var uploader = $scope.uploader = <FileUpload.FileUploader> new FileUploader(<FileUpload.IOptions>{
|
||||
autoUpload: false,
|
||||
|
|
Loading…
Reference in New Issue