修改连接oracle服务

This commit is contained in:
wu ming 2016-09-14 16:31:58 +08:00
commit 11d9143db2
16 changed files with 214 additions and 140 deletions

View File

@ -206,7 +206,7 @@ declare module Kubernetes {
function currentUserName(): any;
function createNamespace(ns: any, client?: any): void;
function createRC(obj: any, onCompleteFn?: any): void;
function connectOracle($http: any, $timeout: any, url: any, operation: any, rcName: any, delayTime: any): void;
function connectOracle($http: any, $timeout: any, url: any, operation: any, replicas: any, delayTime: any): void;
function getOracleStatus(labels: any): number;
function getExtractStatus(labels: any): number;
function getOracleName(name: string): string;

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ treecontrol.tree-classic li.tree-leaf i.tree-leaf-head { padding: 1px 15px; padd
treecontrol.tree-classic li .tree-selected{background-color: #e5f0fb; color: #333; }
treecontrol li{ line-height: 30px; padding-left: 25px;}
treecontrol li:hover{}
.sj_modal_body{ height: 210px; overflow: auto;padding-left: 0; padding-right: 0;}
.sj_modal_body{ height: 210px; overflow: auto;}
.modal{ width: 500px;}
.sj_modal-header{ height:42px; line-height: 42px; border-bottom: 1px solid #ddd; }
.sj_modal-header h4{ margin-top: 5px; font-weight: bold;}
@ -129,3 +129,12 @@ treecontrol li:hover{}
.sj_control-label{ padding:0; line-height:30px; }
.modal-footer{ margin-top: 0;}
.badge-info{ background-color: #3498db;}
.btn:focus {outline: none;outline-offset: 0; }
td > .progress:first-child:last-child{ margin-top:9px;}
.progress-bar-success{ background-color: #5cb85c;}
.progress-bar-danger { background-color: #d9534f;
.sj_progress_bar{ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); position: relative; }
.sj_progress_font{ position: absolute; right: 20px; top:0; }
.sj_table_border{ border: 1px solid #ccc; }
.sj_content_table .table-header{background-image:-webkit-linear-gradient(top, #f7f7f7,#dfdfdf);background-image:linear-gradient(top, #f7f7f7,#dfdfdf); border-bottom:1px solid #a6a6a6;}
.sj_c_green{ color: #58b358;}

View File

@ -7,26 +7,26 @@
</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()">
<div class="mb10">
<button class="btn sj_btn_green" style="color:#fff;" 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">
<table class="table table-bordered sj_content_table " >
<thead class="no-scope">
<tr>
<th class="sj_c_green simple-table-checkbox" style="padding:0 10px;color: #58b358;">已启用</th>
<th class="no-fade table-header">
<span class="">{{volume.name}}</span>
</th>
<th class="no-fade table-header">
<th class="no-fade table-header" colspan="2">
<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>
<span class="">已用&nbsp;{{volume.usedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{allSize}}</span>
</th>
<th class="no-fade table-header">
<button class="btn sj_btn" ng-click="editRow(volume)">
@ -34,7 +34,12 @@
</button>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in volume.brick track by $index" class="row.class">
<td>
<span class="glyphicon glyphicon-ok sj_c_green" style="padding:0 10px; color: #58b358;"></span>
</td>
<td >
<span class="">服务器{{$index+1}}</span>
</td>
@ -45,9 +50,11 @@
<span class="">存储路径:{{row.path}}</span>
</td>
<td >
<span class="">已用{{row.usedSize}}/共{{row.availableSize}}</span>
<span class="">已用&nbsp;{{row.usedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{row.availableSize}}</span>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@ -98,7 +98,14 @@ module Configs{
$http({
method: "POST",
url: RESTfulUrl,
params: resource
params: resource,
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
transformRequest: function(obj) {
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
}).success(function(data, status, headers, config) {
//成功之后做一些事情
if(angular.isFunction(fn))

View File

@ -2,7 +2,6 @@
<div hawtio-breadcrumbs></div>
<div hawtio-tabs></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">
@ -22,22 +21,17 @@
<div class=" fl">
<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" />
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>
<button ng-disabled="!id && tableConfig.selectedItems.length == 0"
class="btn btn-success pull-right sj_btn_grey"
ng-click="deletePrompt(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-trash"></i> 删除数据
<span class="pull-right">&nbsp;</span>
<button class="btn pull-right sj_btn_grey " ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="deletePrompt(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-trash"></i> 删除
</button>
<span class="pull-right">&nbsp;</span>
<button ng-disabled="!id && tableConfig.selectedItems.length == 0"
class="btn btn-success pull-right sj_btn_grey"
ng-click="migrationClick.open(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-export"></i> 迁移数据
<button class="btn pull-right sj_btn_grey " ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="migrationClick.open(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-export"></i> 迁移
</button>
<span class="pull-right">&nbsp;</span>
<button ng-disabled="!id && tableConfig.selectedItems.length == 0"
class="btn btn-success pull-right sj_btn_grey"
ng-click="createOracleService(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-play-circle"></i> 启动服务
<button class="btn pull-right sj_btn_grey " ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-play-circle"></i> 启动
</button>
</div>
<ul class="fr sj_table_bottom">
@ -73,10 +67,10 @@
</label>
<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 volumes " />
</div>
<div class="form-group">
<div class="col-sm-12 alert alert-warning" ng-show="!volumes || volumes.length == 0">
<span class="help-block">
当前没有可以迁移的集群,请在数据集群配置页面进行配置!
</span>
</div>

View File

@ -581,7 +581,7 @@ module Developer {
class: "fa fa-clone",
title: "View the Replicas for this project"
},
{
/*{
href: UrlHelpers.join(namespacesLink, ns, "events"),
label: "日志信息",
class: "fa fa-newspaper-o",
@ -593,7 +593,7 @@ module Developer {
label: "集群节点",
class: "fa fa-server",
title: "View the nodes for this project"
}
} */
]);
}

View File

@ -41,6 +41,14 @@ module Developer {
displayName: '数据标签',
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
},
{
field: "from",
displayName: '源集群',
},
{
field: "to",
displayName: '目的集群',
},
{
field: "status",
displayName: '迁移状态',

View File

@ -63,6 +63,10 @@ module Developer {
displayName: '数据标签',
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
},
{
field: "year",
displayName: '年度',
},
{
field: "collectingTime",
displayName: '采集时间'
@ -136,11 +140,21 @@ module Developer {
}, true);
$scope.deletePrompt = (items) =>{
$scope.deletePrompt = (selected) => {
if (angular.isString(selected)) {
selected = [{
id: selected
}];
}
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'id',
onClose: (result:boolean) => {
var idColl = [];
angular.forEach(items,(item) => {
idColl.push(item.id);
console.log(item.id);
if (result) {
angular.forEach(selected, (select) => {
idColl.push(select.id);
console.log(select.id);
});
$http({
method: "POST",
@ -153,6 +167,17 @@ module Developer {
});
}
},
title: '是否需要删除采集数据?',
action: '以下采集数据文件将会被删除:',
okText: '删除',
okClass: 'btn-danger sj_btn_cir',
custom: "该删除操作将会彻底删除数据文件,是否删除,请确认!",
customClass: "alert alert-warning sj_alert-warning",
cancelText: "取消",
cancelClass: 'sj_btn_grey'
}).open();
}
$scope.migrationClick = {
items:null,
@ -178,8 +203,6 @@ module Developer {
var migrationClick = $scope.migrationClick;
if($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0)
migrationClick.selectedItem = $scope.volumes[0];
console.log(migrationClick.selectedItem.folder.childNodes);
migrationClick.dialog.open();
},
close: () => {
@ -205,9 +228,10 @@ module Developer {
path: item.dataPath+"app/",
isTarget: "false"
}, (rc) =>{
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0);
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 0);
});
});
$timeout(() => {
$location.path('/kubernetes/namespace/default/replicationControllers');
}, 200);

View File

@ -217,11 +217,11 @@
<!-- 迁移进度条 -->
<script type="text/ng-template" id="taskProcess.html">
<div class="ngCellText progress" ng-init="entity=row.entity">
<div ng-show="entity.status!==3" class="progress-bar progress-bar-success active" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sr-only">{{entity.process}}</span>
<div ng-show="entity.status!==3" class="progress-bar progress-bar-success active sj_progress_bar " role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sj_progress_font">{{entity.process}}%</span>
</div>
<div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sr-only">{{entity.process}}</span>
<div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active sj_progress_bar" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sj_progress_font">{{entity.process}}%</span>
</div>
</div>
</script>

View File

@ -82,7 +82,6 @@
</div>
</div>
</div>
<ng-include src="'resizeDialog.html'"/>
<div modal="extractClick.dialog.show">
<form name="selectOracle" class="" ng-submit="extractClick.onOk()">

View File

@ -1749,12 +1749,12 @@ module Kubernetes {
});
}
export function connectOracle($http, $timeout, url, operation, rcName, delayTime){
export function connectOracle($http, $timeout, url, operation, replicas, delayTime){
$timeout(() => {
$http({
url: url,
method:'POST',
params:{oracleName: rcName, operation: operation}
params:{oracleName: getName(replicas), operation: operation},
}).success(function(data,header,config,status){
console.log("success");
}).error(function(data,header,config,status){

View File

@ -90,7 +90,7 @@ module Kubernetes {
id: getName(next)
}, undefined, () => {
if(next.metadata.labels.style === "oracle"){
Kubernetes.connectOracle($http, $timeout, "/java/console/api/cancelOracleConection", "delete", getName(next), 0);
Kubernetes.connectOracle($http, $timeout, "/java/console/api/cancelOracleConection", "delete", next, 0);
}
deleteSelected(selected, selected.shift());
}, (error) => {
@ -143,7 +143,7 @@ module Kubernetes {
if (next) {
Kubernetes.resizeController($http, KubernetesApiURL, next, 0, () => {
if(next.metadata.labels.style === "oracle"){
Kubernetes.connectOracle($http, $timeout, "/java/console/api/cancelOracleConection", "stop", getName(next), 0);
Kubernetes.connectOracle($http, $timeout, "/java/console/api/cancelOracleConection", "stop", next, 0);
}
stopSelected(selected, selected.shift());
});
@ -168,13 +168,13 @@ module Kubernetes {
if(next){
if(next.$replicas === 0)
Kubernetes.resizeController($http, KubernetesApiURL, next, 1, () => {
console.log("restart " + next.metadata.name);
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "reStart", getName(next), 0);
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "reStart", next, 200);
startSelected(selected, selected.shift());
});
}
}
startSelected(selected, selected.shift());
};
$scope.extractClick = {