commit
fa0c482bcd
|
@ -2,6 +2,17 @@
|
|||
/// <reference path="configPlugin.d.ts" />
|
||||
/// <reference path="../../developer/ts/developerNavigation.d.ts" />
|
||||
declare module Configs {
|
||||
class OperateType {
|
||||
static DELETE: string;
|
||||
static UPDATE: string;
|
||||
static PUT: string;
|
||||
static MOVE: string;
|
||||
static EXTRACT: string;
|
||||
}
|
||||
function createOracleInfo(array: Array<any>, id: number): {
|
||||
"id": number;
|
||||
};
|
||||
function shareInit($scope: any, $location: any, $routeParams: any): void;
|
||||
function createNewObejct(array: Array<any>, obj: any): any[];
|
||||
function oracleInfoOperate($http: any, url: string, operate: string, resource: any, fn?: (data, status) => void): void;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ declare module Configs {
|
|||
serviceName: string;
|
||||
tableName: string;
|
||||
status: string;
|
||||
id?: number;
|
||||
}
|
||||
interface volume {
|
||||
name: string;
|
||||
|
@ -23,7 +24,10 @@ declare module Configs {
|
|||
class ConfigsModelService {
|
||||
cluster: Array<volume>;
|
||||
oracleParam: Array<oracleParam>;
|
||||
updateVolumeData($scope: ConfigsModelService, $http: any): void;
|
||||
constructor();
|
||||
updateAllData(): void;
|
||||
updateVolumeData(): void;
|
||||
updateOracleParam(): void;
|
||||
getFolderByVolumeName(name: string): any[];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="configPlugin.d.ts" />
|
||||
/// <reference path="configsHelper.d.ts" />
|
||||
/// <reference path="ConfigsHelper.d.ts" />
|
||||
/// <reference path="configsUtils.d.ts" />
|
||||
/// <reference path="configsDataService.d.ts" />
|
||||
declare module Configs {
|
||||
var GfsController: ng.IModule;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ declare module Developer {
|
|||
}
|
||||
class DataModelService {
|
||||
data: any[];
|
||||
paramOptions: any;
|
||||
paramOptions: OptionsParams;
|
||||
constructor();
|
||||
protected getDataModel(paramOptions: any): any;
|
||||
initParamOptions(): void;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
/// <reference path="developerHelpers.d.ts" />
|
||||
/// <reference path="dataManagerHelper.d.ts" />
|
||||
/// <reference path="dataManagerModel.d.ts" />
|
||||
/// <reference path="../../configs/ts/ConfigsHelper.d.ts" />
|
||||
declare module Developer {
|
||||
var WorkspacesController: ng.IModule;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="kubernetesInterfaces.d.ts" />
|
||||
/// <reference path="utilHelpers.d.ts" />
|
||||
/// <reference path="readPlacedivision.d.ts" />
|
||||
declare module Kubernetes {
|
||||
var context: string;
|
||||
var hash: string;
|
||||
|
@ -207,7 +209,7 @@ declare module Kubernetes {
|
|||
function getOracleStatus(labels: any): number;
|
||||
function getExtractStatus(labels: any): number;
|
||||
function getOracleName(name: string): string;
|
||||
function extractDataToOracle($http: any, selectedReplicationControllers: any, targetReplicationController: any): void;
|
||||
function checkoutOracleRCIsRunning(rc: any): boolean;
|
||||
function extractDataToOracle($http: any, selectedReplicationControllers: any, targetOracle: Configs.oracleParam): void;
|
||||
function checkoutOracleIsRunning(rc: any): boolean;
|
||||
function replicasIsCreated(replicationcontrollers: Array<any>, name: string): boolean;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="../../includes.d.ts" />
|
||||
/// <reference path="kubernetesHelpers.d.ts" />
|
||||
/// <reference path="kubernetesPlugin.d.ts" />
|
||||
/// <reference path="kubernetesModel.d.ts" />
|
||||
declare module Kubernetes {
|
||||
var ReplicationControllers: ng.IModule;
|
||||
}
|
||||
|
|
|
@ -4,11 +4,14 @@
|
|||
/// <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/glusterfsSetting.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/utilHelpers.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/readPlacedivision.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"/>
|
||||
|
@ -43,7 +46,6 @@
|
|||
/// <reference path="d.ts/kubernetes/ts/deploymentConfigs.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/events.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/host.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/utilHelpers.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/hosts.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/imageRepositories.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/kubernetesNavigation.d.ts"/>
|
||||
|
@ -60,7 +62,6 @@
|
|||
/// <reference path="d.ts/kubernetes/ts/term.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/podLogs.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/pods.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/readPlacedivision.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/replicationController.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/replicationControllerEdit.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/replicationControllers.d.ts"/>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -143,6 +143,15 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="sj_content_position clear" style="margin-top:70px;">
|
||||
<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</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<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()">
|
||||
|
|
|
@ -28,6 +28,7 @@ a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3
|
|||
.sj_btn_blue:hover{ background-image:-webkit-linear-gradient(top, #4894ea,#3a83d6);background-image:linear-gradient(top,#4894ea,#3a83d6) color#fff;}
|
||||
.sj_btn_green{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #5cb85c,#398439);background-image:linear-gradient(top,#5cb85c,#398439);border:1px solid #398439; color:#fff;}
|
||||
.sj_btn_green:hover{ background-image:-webkit-linear-gradient(top, #65c965,#398439);background-image:linear-gradient(top,#65c965,#398439); color#fff;}
|
||||
.sj_btn_cir{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:0px 15px; height:30px; line-height:30px;}
|
||||
/* sj_header */
|
||||
.sj_header{ height:70px; width:100%; background:#1d1d1d;}
|
||||
.sj_header a.sj_logo{ display:block; height:41px; width:146px; padding:14px 20px 0 12px;}
|
||||
|
@ -35,7 +36,6 @@ a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3
|
|||
.navbar-pf .sj_topnav > li > a{ height:70px; line-height:70px; font-size:14px; color:#fff; padding:0px 20px;}
|
||||
.sj_topnav li a:hover,.sj_topnav li a.sj_topnav_active{ background-image:-webkit-linear-gradient(top, #424242,#323232);background-image:linear-gradient(top,#424242,#323232); }
|
||||
/* sj_content */
|
||||
.sj_content{ margin-top: 56px;}
|
||||
.sj_leftnav{ width:170px; min-height:800px; max-height:985px; background:#1d1d1d; }
|
||||
.sj_leftnav_i{ background:#717171; padding:0 5px;;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left:80px; }
|
||||
.sj_menu {margin-top:12px;background:#1d1d1d; }
|
||||
|
@ -53,7 +53,7 @@ a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3
|
|||
.sj_menu_04{ background:url(../new/images/sj_icons.png) 0 -133px no-repeat; padding-left:20px;}
|
||||
.sj_contentbox{ width:100%; background:#fff; min-height:800px; }
|
||||
.sj_icons_home{ background:url(../new/images/sj_icons.png) 0 -60px no-repeat; width:15px; height:15px; margin-top:10px; margin-right:3px;}
|
||||
.sj_content_position{ background:#e1e1e1; height:35px; line-height:35px; color:#7a7a7a; padding-left:20px; margin-left:-20px; margin-bottom: 20px; width: 110%;}
|
||||
.sj_content_position{ background:#e1e1e1; height:35px; line-height:35px; color:#7a7a7a; padding-left:190px; width: 100%;}
|
||||
.sj_content_position ul li{ float:left;}
|
||||
.sj_filter li{ float:left;}
|
||||
.sj_filter li a{ display: inline-block; border:1px solid #cecece;background-image:-webkit-linear-gradient(top, #fcfcfc,#e9e9e9);background-image:linear-gradient(top, #fcfcfc,#e9e9e9); padding:5px 15px; color:#363636; margin-right:5px;}
|
||||
|
@ -116,9 +116,16 @@ treecontrol li:hover{}
|
|||
.nav-pills > li + li{ margin-left: 0px;}
|
||||
.sj_server{ }
|
||||
.sj_txt_box{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:32px; width:310px;box-shadow: inset 0px 0px 3px #dcdcdc; }
|
||||
.sj_txt_box02{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:32px; width:370px;box-shadow: inset 0px 0px 3px #dcdcdc;}
|
||||
.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;}
|
||||
.sj_form_input input{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:32px; width:310px;box-shadow: inset 0px 0px 3px #dcdcdc;}
|
||||
.sj_form_input input{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:32px; width:310px;box-shadow: inset 0px 0px 3px #dcdcdc;}
|
||||
.sj_alert-warning{ background-color: #fff6d0; border-color:#f6e7aa; color: #fd5f00; margin-top:10px;}
|
||||
.help-block{ color: #fd5f00;}
|
||||
.alert{ padding:10px 15px; margin-bottom:0;}
|
||||
.sj_control-label{ padding:0; line-height:30px; }
|
||||
.modal-footer{ margin-top: 0;}
|
||||
.badge-info{ background-color: #3498db;}
|
|
@ -1,8 +1,45 @@
|
|||
<div>
|
||||
<div ng-controller="Configs.GfsController">
|
||||
<div class="row">
|
||||
<div hawtio-breadcrumbs></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div hawtio-tabs></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-content sj_content">
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<button class="btn pull-right sj_btn_blue" ng-click="create()">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" ng-repeat="volume in volumes">
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<th class="no-fade table-header">
|
||||
<span class="">{{volume.name}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header">
|
||||
<span class="">云路径:{{volume.path}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header">
|
||||
<span class="">状态</span>
|
||||
</th>
|
||||
<th class="no-fade table-header">
|
||||
<span class="">已用{{volume.usedSize}}/共{{allSize}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header">
|
||||
<button class="btn sj_btn" ng-click="editRow(volume)">
|
||||
<span class="glyphicon glyphicon-pencil"></span> 编辑
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
<tr ng-repeat="row in volume.brick track by $index" class="row.class">
|
||||
<td ng-repeat="col in row" class="col.class">
|
||||
<span class="col.class">{{col.title}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,31 +5,25 @@
|
|||
<div class="row">
|
||||
<div hawtio-tabs></div>
|
||||
</div>
|
||||
<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 class="container-content " >
|
||||
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
|
||||
<p class="alert alert-info">当前没有配置汇总库信息,请配置,否则汇总操作将不可用!</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row mb10" ng-show="model.oracleParam.length">
|
||||
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
|
||||
</div>
|
||||
<div class="row" >
|
||||
<div >
|
||||
<button class="btn sj_btn_green" style="color:#fff;" ng-click="create()">
|
||||
<button class="btn sj_btn_green mb10" style="color:#fff;" 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 mt10 mb10">添加汇总库信息:</h3>
|
||||
<div class="col-md-6 col-md-offset-1">
|
||||
<div class="row " style="padding-top:10px;" ng-show="tableForm.length>=0 && (edit || add)" >
|
||||
<h3 class="mb10" ng-show="edit" >编辑汇总库连接信息:</h3>
|
||||
<h3 class="mb10" 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>
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="connectStatus.html">
|
||||
<div class="ngCellText" ng-init="entity=row.entity">
|
||||
<div ng-show="true" title="汇总库的连接状态">
|
||||
<span ng-show="entity.status== 0" class="glyphicon glyphicon-minus"> 未连接</span>
|
||||
<span ng-show="entity.status== 1" class="glyphicon glyphicon-ok"> 连接成功</span>
|
||||
<span ng-show="entity.status== 2" class="glyphicon glyphicon-import"> 使用中</span>
|
||||
<span ng-show="entity.status== 3" class="glyphicon glyphicon-remove"> 连接失败</span>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
/// <reference path="configPlugin.ts"/>
|
||||
/// <reference path="../../developer/ts/developerNavigation.ts"/>
|
||||
module Configs{
|
||||
export class OperateType{
|
||||
public static get DELETE():string {return "delete"}
|
||||
public static get UPDATE():string {return "update"}
|
||||
public static get PUT():string{return "put"}
|
||||
public static get MOVE():string{return "move"}
|
||||
public static get EXTRACT():string{return "extract"}
|
||||
}
|
||||
|
||||
_module.controller('Configs.MenuItemController',['$scope', '$location', ($scope, $location) => {
|
||||
$scope.menuItem=[{
|
||||
icon: "glyphicon glyphicon-cloud-upload",
|
||||
|
@ -40,8 +48,17 @@ module Configs{
|
|||
}]);
|
||||
}
|
||||
|
||||
export function createOracleInfo(array:Array<any>, id:number){
|
||||
var result ={"id": id};
|
||||
angular.forEach(array, (arr) => {
|
||||
result[arr.field] = arr.value;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export function shareInit($scope, $location, $routeParams){
|
||||
$scope.subTabConfig = createConfigBreadcrumbs($scope, $location, $routeParams);
|
||||
$scope.subTabConfig = createConfigBreadcrumbs($scope, $location, $routeParams);
|
||||
$scope.model.updateAllData();
|
||||
}
|
||||
|
||||
export function createNewObejct(array:Array<any>, obj){
|
||||
|
@ -64,6 +81,33 @@ module Configs{
|
|||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function oracleInfoOperate($http, url:string, operate:string, resource, fn?: (data, status)=>void ){
|
||||
if(resource === null)
|
||||
throw "不能操作空资源对象";
|
||||
|
||||
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
|
||||
var RESTfulUrl=url;
|
||||
if(id===undefined){
|
||||
RESTfulUrl = UrlHelpers.join(url, operate);
|
||||
}else{
|
||||
RESTfulUrl = UrlHelpers.join(url, resource.id+"", operate);
|
||||
}
|
||||
|
||||
$http({
|
||||
method: "POST",
|
||||
url: RESTfulUrl,
|
||||
params: resource
|
||||
}).success(function(data, status, headers, config) {
|
||||
//成功之后做一些事情
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, status);
|
||||
|
||||
}).error(function(data, status, headers, config) {
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, status);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,5 +24,31 @@ module Configs {
|
|||
viewRegistry['config'] = templatePath + "shareLayout.html";
|
||||
}]);
|
||||
|
||||
_module.directive('gfsConfigTable', [() =>{
|
||||
return{
|
||||
restrict: 'AE',
|
||||
replace : true,
|
||||
scope: {
|
||||
tableTitle: '=',
|
||||
tableContent: '='
|
||||
},
|
||||
template: `<table class="table table-hover">
|
||||
<tr>
|
||||
<th ng-repeat="column in tableTitle.column" class="no-fade table-header">
|
||||
<span class="{{column.class}}">{{column.title}}</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr ng-repeat = "row in tableContent" class="row.class">
|
||||
<td ng-repeat="col in row" class="col.class">
|
||||
<span class="col.class">{{col.title}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
`,
|
||||
link: (scope, element, attr) =>{
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
hawtioPluginLoader.addModule(pluginName);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ module Configs{
|
|||
port: string;
|
||||
serviceName: string;
|
||||
tableName: string;
|
||||
status: string;
|
||||
status: string;
|
||||
id?:number;
|
||||
}
|
||||
|
||||
export interface volume{
|
||||
|
@ -39,18 +40,45 @@ module Configs{
|
|||
|
||||
export class ConfigsModelService{
|
||||
public cluster: Array<volume>=[];
|
||||
public oracleParam: Array<oracleParam>;
|
||||
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 constructor(){
|
||||
this.updateAllData();
|
||||
}
|
||||
|
||||
public updateAllData(){
|
||||
this.updateVolumeData();
|
||||
this.updateOracleParam();
|
||||
}
|
||||
public updateVolumeData(){
|
||||
var result=null;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type : "POST",
|
||||
url : "/java/console/api/volume/list",
|
||||
success : function(data) {
|
||||
if(data){
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.cluster = result;
|
||||
|
||||
}
|
||||
|
||||
public updateOracleParam(){
|
||||
var result=null;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type : "POST",
|
||||
url : "/java/console/api/oracle/list",
|
||||
success : function(data) {
|
||||
if(data){
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.oracleParam = result;
|
||||
}
|
||||
|
||||
public getFolderByVolumeName(name: string){
|
||||
|
@ -64,7 +92,7 @@ module Configs{
|
|||
}
|
||||
|
||||
_module.factory('ConfigsModel', ['$rootScope', '$http', '$location', '$resource', ($rootScope, $http, $location, $resource) =>{
|
||||
var $scope = new ConfigsModelService();
|
||||
var $scope = new ConfigsModelService();
|
||||
return $scope;
|
||||
}]);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
/// <reference path="configsHelper.ts"/>
|
||||
/// <reference path="configsUtils.ts"/>
|
||||
/// <reference path="configsDataService.ts"/>
|
||||
module Configs{
|
||||
|
||||
export var GfsController = controller('GfsController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout", 'ConfigsModel',
|
||||
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel) =>{
|
||||
$scope.model = ConfigsModel;
|
||||
$scope.volumes = ConfigsModel.cluster;
|
||||
shareInit($scope, $location, $routeParams);
|
||||
}]);
|
||||
}
|
|
@ -4,41 +4,14 @@
|
|||
/// <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
|
||||
}];
|
||||
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout","ConfigsModel",
|
||||
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel) => {
|
||||
|
||||
$scope.model= ConfigsModel;
|
||||
$scope.tableConfig={
|
||||
data: "model",
|
||||
selectedItems: [{
|
||||
name: "activemq-004",
|
||||
status: "failed",
|
||||
ip: "10.188.2.111",
|
||||
_id: 2
|
||||
}],
|
||||
data: 'model.oracleParam',
|
||||
selectedItems: [],
|
||||
columnDefs: [{
|
||||
field: "_id",
|
||||
displayName: "序号"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
displayName: "名称"
|
||||
},
|
||||
|
@ -51,7 +24,7 @@ module Configs{
|
|||
displayName: "端口号"
|
||||
},
|
||||
{
|
||||
field: "userName",
|
||||
field: "user",
|
||||
displayName: "用户名"
|
||||
},
|
||||
{
|
||||
|
@ -59,51 +32,75 @@ module Configs{
|
|||
displayName: "密码"
|
||||
},
|
||||
{
|
||||
field: "serviceName",
|
||||
field: "databaseName",
|
||||
displayName: "服务名"
|
||||
},
|
||||
{
|
||||
field: "tableName",
|
||||
displayName: "表空间名"
|
||||
},
|
||||
{
|
||||
field: "suffix",
|
||||
displayName: "表后缀"
|
||||
},
|
||||
{
|
||||
field: "status",
|
||||
displayName: "连接状态"
|
||||
displayName: "连接状态",
|
||||
cellTemplate: $templateCache.get("connectStatus.html")
|
||||
},
|
||||
{
|
||||
field: "entity",
|
||||
displayName: "操作",
|
||||
cellTemplate: $templateCache.get("tableEdit.html")
|
||||
}],
|
||||
enableRowClickSelection: true,
|
||||
enableRowClickSelection: false,
|
||||
showSelectionCheckbox: false,
|
||||
multiSelect: false,
|
||||
sortInfo: {
|
||||
sortBy: "_id",
|
||||
sortBy: "name",
|
||||
ascending: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shareInit($scope, $location, $routeParams);
|
||||
|
||||
$scope.create = () =>{
|
||||
$scope.add= true;
|
||||
$scope.edit = false;
|
||||
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, null);
|
||||
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, null);
|
||||
$scope.rowId=0;
|
||||
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.add = false;
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, createOracleInfo($scope.tableForm, $scope.rowId), (result, status) => {
|
||||
if(status===200){
|
||||
$scope.model.updateOracleParam();
|
||||
}else{
|
||||
throw "资源请求失败";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on("editRow", (event, data) =>{
|
||||
$scope.edit = true;
|
||||
$scope.add = false;
|
||||
$scope.rowId = data.id
|
||||
$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");
|
||||
$scope.$on("deleteRow", (event, data) =>{
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
|
||||
if(status===200){
|
||||
$scope.model.updateOracleParam();
|
||||
}else{
|
||||
throw "资源请求失败";
|
||||
}
|
||||
});
|
||||
//removeElementByValue($scope.model, data._id, "_id");
|
||||
}) ;
|
||||
}]);
|
||||
}
|
|
@ -2,12 +2,12 @@
|
|||
/// <reference path="configPlugin.ts"/>
|
||||
module Configs{
|
||||
export var EableEdit = controller('EableEdit', ['$scope', ($scope) => {
|
||||
$scope.editRow = (entity)=>{
|
||||
$scope.editRow = (entity)=>{
|
||||
$scope.$emit('editRow', entity);
|
||||
}
|
||||
|
||||
$scope.deleteRow = (entity) =>{
|
||||
$scope.$emit('deleteRow', entity);
|
||||
}
|
||||
}]);
|
||||
}]);
|
||||
}
|
|
@ -1,16 +1,8 @@
|
|||
<div ng-controller="Developer.WorkspacesController" hawtio-card-bg >
|
||||
<div hawtio-breadcrumbs></div>
|
||||
<div hawtio-tabs></div>
|
||||
<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</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="container-content ">
|
||||
|
||||
<div class="container-fluid sj_fluid">
|
||||
<div class="row nav-content mb10 clear " >
|
||||
<ul class="nav nav-tabs sj_nav_taps fl" ng-show="navbarItems.length">
|
||||
|
|
|
@ -29,10 +29,10 @@ module Developer{
|
|||
return result;
|
||||
}
|
||||
|
||||
public getPageSizeNum(){
|
||||
public getPageSizeNum(){
|
||||
var num = Math.ceil(this.totalSize/this.currentTableSize);
|
||||
if(num < this.currentPageNum)
|
||||
num = this.currentPageNum;
|
||||
num = this.currentPageNum;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
@ -101,13 +101,10 @@ module Developer{
|
|||
|
||||
export class DataModelService{
|
||||
public data = [];
|
||||
public paramOptions = null;
|
||||
public paramOptions = new OptionsParams();
|
||||
|
||||
constructor(){
|
||||
this.initParamOptions();
|
||||
//this.updateModel();
|
||||
this.maybeFormat();
|
||||
|
||||
constructor(){
|
||||
this.updateModel();
|
||||
}
|
||||
|
||||
//更新数据模型
|
||||
|
@ -119,10 +116,9 @@ module Developer{
|
|||
url : "/java/console/api/data.json",
|
||||
dataType : 'json',
|
||||
data: createParamData(paramOptions),
|
||||
success : function(data) {
|
||||
console.log(paramOptions);
|
||||
success : function(data) {
|
||||
result = data.data;
|
||||
paramOptions.totalSize=data.length;
|
||||
paramOptions.totalSize=data.length;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
|
|
@ -6,25 +6,24 @@
|
|||
/// <reference path="developerHelpers.ts"/>
|
||||
/// <reference path="dataManagerHelper.ts"/>
|
||||
/// <reference path="dataManagerModel.ts"/>
|
||||
/// <reference path="../../configs/ts/configsHelper.ts"/>
|
||||
|
||||
module Developer {
|
||||
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.model=DataModel;
|
||||
init($scope, $location, $routeParams);
|
||||
$scope.options = DataModel.paramOptions;
|
||||
console.log($scope.options);
|
||||
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
|
||||
$scope.options.dataType = getDataType($location);
|
||||
$scope.options.dataType = getDataType($location);
|
||||
console.log($scope.volumes);
|
||||
//console.log(JSON.stringify($scope.volumes[0].folderNode));
|
||||
|
||||
|
||||
|
||||
console.log($scope.volumes);
|
||||
|
||||
$scope.model.updateModel();
|
||||
|
||||
$scope.treeOptions = {
|
||||
nodeChildren: "children",
|
||||
nodeChildren: "childNodes",
|
||||
dirSelectable: true,
|
||||
injectClasses: {
|
||||
ul: "a1",
|
||||
|
@ -37,7 +36,6 @@ module Developer {
|
|||
labelSelected: "a8"
|
||||
}
|
||||
}
|
||||
|
||||
//配置数据表格需要显示的内容及显示格式
|
||||
$scope.tableConfig = {
|
||||
data: 'model.data',
|
||||
|
@ -162,25 +160,35 @@ module Developer {
|
|||
|
||||
$scope.migrationClick = {
|
||||
items:null,
|
||||
selectedItem: $scope.tableConfig.selectedItems,
|
||||
selectedItem: $scope.volumes[0] || {"name": "当前没有可以迁移的集群"},
|
||||
dialog: new UI.Dialog(),
|
||||
onOk: () => {
|
||||
onOk: () => {
|
||||
var migrationClick = $scope.migrationClick;
|
||||
Configs.oracleInfoOperate($http, "/java/console/api/volume", Configs.OperateType.MOVE,
|
||||
{
|
||||
"name": migrationClick.selectedItem.name,
|
||||
"selectItems": $scope.tableConfig.selectedItems,
|
||||
"selectNode": $scope.selectNode
|
||||
}, (result, status) => {
|
||||
if(status===200){
|
||||
//$scope.model.updateOracleParam();
|
||||
}else{
|
||||
throw "资源请求失败";
|
||||
}
|
||||
});
|
||||
migrationClick.close();
|
||||
},
|
||||
open: (selected) =>{
|
||||
var migrationClick = $scope.migrationClick;
|
||||
migrationClick.dialog.open();
|
||||
console.log("===================");
|
||||
console.log(selected);
|
||||
migrationClick.dialog.open();
|
||||
},
|
||||
close: () => {
|
||||
$scope.migrationClick.dialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.createOracleService = (items) =>{
|
||||
console.log(items);
|
||||
angular.forEach(items,(item)=>{
|
||||
console.log(item);
|
||||
$scope.createOracleService = (items) =>{
|
||||
angular.forEach(items,(item)=>{
|
||||
Kubernetes.createRC({
|
||||
name: item._key,
|
||||
labels: {
|
||||
|
@ -197,13 +205,16 @@ module Developer {
|
|||
isTarget: "false"
|
||||
}, (rc) =>{
|
||||
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0);
|
||||
$location.path('/kubernetes/namespace/default/replicationControllers');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function init($scope,$location,$routeParams){
|
||||
//创建二级菜单
|
||||
ConfigsModel.updateVolumeData($scope.configs, $http);
|
||||
$scope.model.updateModel();
|
||||
if(ConfigsModel.cluster!=null)
|
||||
$scope.volumes = ConfigsModel.cluster;
|
||||
//创建二级菜单
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.navbarItems =[{
|
||||
herf: "",
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<a ng-show="row.entity.$podCounters.podsLink" title="pods status">
|
||||
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===2)" class="badge badge-success" > 启动</span>
|
||||
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===0)" class="badge badge-info" > 等待</span>
|
||||
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===1)" class="badge badge-warning" > 失败</span>
|
||||
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===1)" class="badge badge-warning " > 失败</span>
|
||||
<span ng-show="row.entity.$podCounters.valid || row.entity.$podCounters.waiting" class="badge badge-info"> 等待</span>
|
||||
<span ng-show="!(row.entity.$podCounters.waiting || row.entity.$podCounters.ready || row.entity.$podCounters.valid || row.entity.$podCounters.error)" class="badge"> 停止</span>
|
||||
<span ng-show="row.entity.$podCounters.error" class="badge badge-warning" > 失败</span>
|
||||
|
@ -206,7 +206,7 @@
|
|||
<input class="btn btn-primary" type="submit"
|
||||
ng-disabled="resizeDialog.newReplicas === resizeDialog.controller.status.replicas"
|
||||
value="Resize">
|
||||
<button class="btn btn-warning cancel" type="button" ng-click="resizeDialog.close()">取消</button>
|
||||
<button class="btn btn-warning cancel sj_btn_grey" type="button" ng-click="resizeDialog.close()">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -24,14 +24,6 @@
|
|||
</div>
|
||||
|
||||
<div class="row filter-header">
|
||||
<div class="sj_content_position clear" style="margin-top:25px;">
|
||||
<ul >
|
||||
<li class="sj_icons_home"></li>
|
||||
<li>当前位置:</li>
|
||||
<li><a href="#">服务集群</a> <span>></span></li>
|
||||
<li><a href="#">服务管理</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-12 sj_fluid" >
|
||||
<span ng-show="!id">
|
||||
<hawtio-filter ng-model="tableConfig.filterOptions.filterText"
|
||||
|
@ -40,42 +32,34 @@
|
|||
save-as="kubernetes-replication-controllers-text-filter"></hawtio-filter>
|
||||
</span>
|
||||
<button ng-show="model.fetched"
|
||||
class="btn btn-danger pull-right sj_btn_grey"
|
||||
class="btn btn-danger pull-right sj_btn_grey "
|
||||
ng-disabled="!id && tableConfig.selectedItems.length == 0"
|
||||
ng-click="deletePrompt(id || tableConfig.selectedItems)">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
<i class="glyphicon glyphicon-trash"></i> 删除
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
|
||||
<button ng-show="model.fetched"
|
||||
class="btn btn-danger pull-right sj_btn_grey"
|
||||
class="btn btn-warning pull-right sj_btn_grey "
|
||||
ng-disabled="!id && tableConfig.selectedItems.length == 0"
|
||||
ng-click="stopPrompt(id || tableConfig.selectedItems)">
|
||||
<i class="fa fa-remove"></i> 停止
|
||||
<i class="glyphicon glyphicon-off"></i> 停止
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
|
||||
<button ng-show="model.fetched"
|
||||
class="btn btn-primary pull-right sj_btn_grey"
|
||||
class="btn btn-info pull-right sj_btn_grey"
|
||||
ng-disabled="!id && tableConfig.selectedItems.length == 0"
|
||||
ng-click="reStartPrompt(id || tableConfig.selectedItems)">
|
||||
<i class="fa fa-plus"></i> 启动
|
||||
<i class="glyphicon glyphicon-play"></i> 启动
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
|
||||
<!--<button ng-show="id"
|
||||
class="btn btn-primary pull-right"
|
||||
ng-click="id = undefined"><i class="fa fa-list"></i></button>
|
||||
<span ng-show="id" class="pull-right"> </span>
|
||||
<a class="btn btn-default pull-right"
|
||||
title="Create a new replication controller"
|
||||
ng-click="createRCs()"><i class="fa fa-plus"></i> 创建汇总数据库</a>
|
||||
<span class="pull-right"> </span>-->
|
||||
<button ng-show="model.fetched"
|
||||
ng-disabled="!id && tableConfig.selectedItems.length == 0"
|
||||
class="btn btn-success pull-right sj_btn_grey"
|
||||
ng-click="extractData.open(id || tableConfig.selectedItems)">
|
||||
<i class="fa fa-play-circle"></i> 汇总
|
||||
ng-click="extractClick.open(id || tableConfig.selectedItems)">
|
||||
<i class="glyphicon glyphicon-cloud-download"></i> 汇总
|
||||
</button>
|
||||
<!--<span ng-include="'runButton.html'"></span>-->
|
||||
</div>
|
||||
|
@ -100,13 +84,13 @@
|
|||
</div>
|
||||
<ng-include src="'resizeDialog.html'"/>
|
||||
|
||||
<div modal="extractData.dialog.show">
|
||||
<form name="createNamespaceForm" class="" ng-submit="extractData.onOk()">
|
||||
<div modal="extractClick.dialog.show">
|
||||
<form name="selectOracle" class="" ng-submit="extractClick.onOk()">
|
||||
<div class="modal-header"><h4>数据汇总</h4></div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group" ng-class="{'has-error': createNamespaceForm.$invalid}">
|
||||
<label class="col-sm-3 control-label" for="selectedItem">
|
||||
<div class="form-group" ng-class="{'has-error': selectOracle.$invalid}">
|
||||
<label class="fl control-label sj_control-label" for="selectedItem">
|
||||
数据库名称
|
||||
<a tabindex="0" role="button" data-toggle="popover" data-trigger="focus" data-html="true" title=""
|
||||
data-content="name of the new project" data-placement="top" data-original-title="">
|
||||
|
@ -115,37 +99,35 @@
|
|||
</label>
|
||||
|
||||
<div class="col-sm-9">
|
||||
<select ng-model="extractData.selectedItem" class="form-control"
|
||||
<select ng-model="extractClick.selectedItem" class="form-control sj_txt_box02"
|
||||
title="name of the new namespace"
|
||||
id ="selectedItem"
|
||||
ng-options="x.$oracleName for x in filterReplicationControllers">
|
||||
|
||||
ng-options="x.name for x in configs.oracleParam">
|
||||
</select>
|
||||
|
||||
<span class="help-block" ng-show="filterReplicationControllers.length == 0">
|
||||
当前没有汇总数据库可以选择,请先创建,可以点击创建汇总数据库按钮进行创建或从汇总页面中的服务器数据列表中启动已创建的汇总数据库!
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<span class="help-block" ng-show="extractData.selectedItem">
|
||||
<div class="col-sm-12 alert alert-warning sj_alert-warning">
|
||||
<span class="help-block " ng-show="configs.oracleParam.length >0 && extractClick.selectedItem">
|
||||
<br>
|
||||
您所选择的数据库数据将会被抽取到汇总数据库:
|
||||
<font color="Red"><strong>{{extractData.selectedItem.$oracleName}}</strong></font> 中,是否继续请确认!
|
||||
</span>
|
||||
您所选择的数据库数据将会被抽取到汇总数据库:
|
||||
<font color="Red"><strong>{{extractClick.selectedItem.name}}</strong></font> 中,是否继续请确认!
|
||||
</span>
|
||||
<span class="help-block" ng-show="configs.oracleParam.length == 0">
|
||||
当前没有汇总数据库可以选择,请先创建,可以点击创建汇总数据库按钮进行创建或从汇总页面中的服务器数据列表中启动已创建的汇总数据库!
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input class="btn btn-primary" type="submit"
|
||||
ng-disabled="filterReplicationControllers.length == 0"
|
||||
<input class="btn btn-primary sj_btn_blue" type="submit"
|
||||
ng-disabled="configs.oracleParam.length == 0"
|
||||
value="确定">
|
||||
|
||||
<button class="btn btn-warning cancel" type="button" ng-click="extractData.close()">取消</button>
|
||||
<button class="btn btn-warning cancel sj_btn_grey" type="button" ng-click="extractClick.close()">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="kubernetesInterfaces.ts"/>
|
||||
/// <reference path="utilHelpers.ts"/>
|
||||
/// <reference path="readPlacedivision.ts"/>
|
||||
module Kubernetes {
|
||||
|
||||
export var context = '/kubernetes';
|
||||
|
@ -1799,49 +1801,30 @@ module Kubernetes {
|
|||
}
|
||||
}
|
||||
|
||||
export function extractDataToOracle($http, selectedReplicationControllers, targetReplicationController){
|
||||
//console.log(targetReplicationController.length);
|
||||
if(selectedReplicationControllers.length ===1 && (getName(selectedReplicationControllers[0]) === getName(targetReplicationController))){
|
||||
alert("您选择的数据库中不包含需要汇总的数据库,导致汇总操作失败,请重新选择!");
|
||||
return;
|
||||
}
|
||||
var answer = checkoutOracleRCIsRunning(targetReplicationController) && targetReplicationController;
|
||||
var oracleConnectParam = [{
|
||||
OracleName: getName(targetReplicationController),
|
||||
connectHost: getHost(targetReplicationController.$pods[0]),
|
||||
connectPort: targetReplicationController.$pods[0].spec.containers[0].ports[0].hostPort,
|
||||
isTarget: true
|
||||
}];
|
||||
selectedReplicationControllers.forEach((rc) => {
|
||||
if(getName(rc) !== getName(targetReplicationController)){
|
||||
answer = answer && checkoutOracleRCIsRunning(rc);
|
||||
oracleConnectParam.push({
|
||||
"OracleName": getName(rc),
|
||||
"connectHost": getHost(rc.$pods[0]),
|
||||
"connectPort": rc.$pods[0].spec.containers[0].ports[0].hostPort,
|
||||
"isTarget": false
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if(answer){
|
||||
$http({
|
||||
url: '/extractOracleData',
|
||||
dataType: 'json',
|
||||
method:'POST',
|
||||
params:{param: oracleConnectParam}
|
||||
}).success(function(data,header,config,status){
|
||||
console.log("success");
|
||||
}).error(function(data,header,config,status){
|
||||
//log.warn("Failed to connect " + connectParam + " " + data + " " + status);
|
||||
});
|
||||
export function extractDataToOracle($http, selectedReplicationControllers, targetOracle: Configs.oracleParam){
|
||||
//console.log(targetReplicationController.length);
|
||||
var answer = targetOracle && true;
|
||||
var inneedOracle = [];
|
||||
selectedReplicationControllers.forEach((rc) => {
|
||||
answer = answer && checkoutOracleIsRunning(rc);
|
||||
inneedOracle.push({
|
||||
"name": getName(rc),
|
||||
"ip": getHost(rc.$pods[0]),
|
||||
"port": rc.$pods[0].spec.containers[0].ports[0].hostPort,
|
||||
"isTarget": false
|
||||
});
|
||||
});
|
||||
|
||||
if(answer){
|
||||
var data ={"name": targetOracle.id, "target": targetOracle, "inneed": inneedOracle};
|
||||
Configs.oracleInfoOperate($http, "/java/console/api/oracle", Configs.OperateType.EXTRACT, data);
|
||||
}else{
|
||||
alert("您选择的汇总数据库或需要汇总的数据库中存在未启动成功的数据库,导致汇总操作失败,请重新选择!");
|
||||
}
|
||||
}
|
||||
|
||||
export function checkoutOracleRCIsRunning(rc){
|
||||
if(rc.$podCounters.ready && rc.$oracleStatus == 2){
|
||||
export function checkoutOracleIsRunning(rc){
|
||||
if(rc.$podCounters.ready && rc.$oracleStatus == 2){
|
||||
return true
|
||||
}else{
|
||||
return false;
|
||||
|
|
|
@ -180,7 +180,7 @@ module Kubernetes {
|
|||
yes();
|
||||
}
|
||||
})
|
||||
.href(() => context)
|
||||
.href(() => UrlHelpers.join(context, "/namespace/default/replicationControllers"))
|
||||
.title(() => '服务集群')
|
||||
.tabs(controllers, pods, events)
|
||||
.build();
|
||||
|
|
|
@ -8,8 +8,7 @@ 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 log = Logger.get('kubernetes-file-uploader');
|
||||
|
||||
var uploader = $scope.uploader = <FileUpload.FileUploader> new FileUploader(<FileUpload.IOptions>{
|
||||
autoUpload: false,
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="kubernetesHelpers.ts"/>
|
||||
/// <reference path="kubernetesPlugin.ts"/>
|
||||
/// <reference path="kubernetesModel.ts"/>
|
||||
|
||||
module Kubernetes {
|
||||
|
||||
export var ReplicationControllers = controller("ReplicationControllers",
|
||||
["$scope", "KubernetesModel", "KubernetesReplicationControllers", "KubernetesPods", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesReplicationControllers:ng.resource.IResourceClass<any>, KubernetesPods:ng.resource.IResourceClass<any>, KubernetesState,
|
||||
["$scope", "KubernetesModel", "KubernetesReplicationControllers", "KubernetesPods", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesReplicationControllers:ng.resource.IResourceClass<any>, KubernetesPods:ng.resource.IResourceClass<any>, ConfigsModel, KubernetesState,
|
||||
$templateCache, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
|
||||
|
||||
$scope.kubernetes = KubernetesState;
|
||||
$scope.model = KubernetesModel;
|
||||
$scope.filterReplicationControllers = $scope.model.filterReplicationcontrollers;
|
||||
$scope.configs = ConfigsModel;
|
||||
$scope.model = KubernetesModel;
|
||||
|
||||
$scope.tableConfig = {
|
||||
data: 'model.replicationControllers',
|
||||
|
@ -68,7 +69,7 @@ module Kubernetes {
|
|||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
|
||||
|
||||
$scope.deletePrompt = (selected) => {
|
||||
|
@ -105,10 +106,11 @@ module Kubernetes {
|
|||
title: '是否需要删除oracle服务?',
|
||||
action: '以下的oracle服务将会被删除:',
|
||||
okText: '删除',
|
||||
okClass: 'btn-danger',
|
||||
okClass: 'btn-danger sj_btn_cir',
|
||||
custom: "该服务删除后将会清除oracle对应服务的端口等资源占用,但不删除数据文件,是否删除,请确认!",
|
||||
customClass: "alert alert-warning",
|
||||
cancelText: "取消"
|
||||
customClass: "alert alert-warning sj_alert-warning",
|
||||
cancelText: "取消",
|
||||
cancelClass: 'sj_btn_grey'
|
||||
}).open();
|
||||
}
|
||||
|
||||
|
@ -153,10 +155,11 @@ module Kubernetes {
|
|||
title: '是否需要停止oracle服务?',
|
||||
action: '以下的oracle服务将会被停止:',
|
||||
okText: '停止',
|
||||
okClass: 'btn-danger',
|
||||
okClass: 'btn-danger sj_btn_cir',
|
||||
custom: "该服务停止后将无法继续提供连接访问服务,但可通过启动按钮重新启动该服务以进行访问。是否停止,请确认",
|
||||
customClass: "alert alert-warning",
|
||||
cancelText: "取消"
|
||||
customClass: "alert alert-warning sj_alert-warning",
|
||||
cancelText: "取消",
|
||||
cancelClass: 'sj_btn_grey'
|
||||
}).open();
|
||||
};
|
||||
|
||||
|
@ -174,28 +177,28 @@ module Kubernetes {
|
|||
startSelected(selected, selected.shift());
|
||||
};
|
||||
|
||||
$scope.extractData = {
|
||||
items: null,
|
||||
selectedItem: $scope.filterReplicationControllers[0] || "",
|
||||
dialog: new UI.Dialog(),
|
||||
onOk: () => {
|
||||
var extractData = $scope.extractData;
|
||||
extractData.dialog.close();
|
||||
var filterReplicationController = extractData.selectedItem;
|
||||
Kubernetes.extractDataToOracle($http, extractData.items, filterReplicationController);
|
||||
extractData.selectedItem = $scope.filterReplicationControllers[0] || "";
|
||||
},
|
||||
open: (selected) => {
|
||||
var extractData = $scope.extractData;
|
||||
extractData.dialog.open();
|
||||
extractData.selectedItem = $scope.filterReplicationControllers[0] || "";
|
||||
extractData.items = selected;
|
||||
$timeout(() => {
|
||||
$('#newDataName').focus();
|
||||
}, 50);
|
||||
$scope.extractClick = {
|
||||
items: null,
|
||||
selectedItem: $scope.configs.oracleParam[0] || {name: "当前没有可用的汇总库"},
|
||||
dialog: new UI.Dialog(),
|
||||
onOk: () => {
|
||||
var extractClick = $scope.extractClick;
|
||||
extractClick.items = $scope.tableConfig.selectedItems;
|
||||
Kubernetes.extractDataToOracle($http, extractClick.items, extractClick.selectedItem);
|
||||
//extractClick.selectedItem = $scope.filterReplicationControllers[0] || "";
|
||||
extractClick.dialog.close();
|
||||
},
|
||||
open: (selected) => {
|
||||
var extractClick = $scope.extractClick;
|
||||
extractClick.dialog.open();
|
||||
/*extractData.selectedItem = $scope.filterReplicationControllers[0] || "";
|
||||
extractData.items = selected;*/
|
||||
$timeout(() => {
|
||||
$('#newDataName').focus();
|
||||
}, 50);
|
||||
},
|
||||
close: () => {
|
||||
$scope.extractData.dialog.close();
|
||||
$scope.extractClick.dialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module Kubernetes {
|
|||
});
|
||||
_.forEach(self.listeners, (listener:(ObjectMap) => void) => {
|
||||
listener(objects);
|
||||
});
|
||||
});
|
||||
};
|
||||
var debouncedUpdate = _.debounce(updateFunction, 75, { trailing: true });
|
||||
|
||||
|
|
Loading…
Reference in New Issue