Web_Manager_Develope
Linda 8 years ago
commit 50163a76ac

@ -1,6 +1,7 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="configPlugin.d.ts" />
/// <reference path="../../developer/ts/developerNavigation.d.ts" />
/// <reference path="../../developer/ts/dataManagerHelper.d.ts" />
declare module Configs {
class OperateType {
static DELETE: string;

@ -2,6 +2,7 @@
/// <reference path="developerPlugin.d.ts" />
/// <reference path="dataManagerModel.d.ts" />
/// <reference path="dataManagerHelper.d.ts" />
/// <reference path="../../configs/ts/ConfigsHelper.d.ts" />
declare module Developer {
var KubeTaskController: ng.IModule;
}

@ -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;

Binary file not shown.

6
defs.d.ts vendored

@ -1,14 +1,14 @@
/// <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/developer/ts/developerHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerHelper.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/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/developerHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerHelper.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"/>
@ -34,6 +34,7 @@
/// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/apps.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -76,4 +77,3 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

@ -1,6 +1,7 @@
/// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.ts"/>
/// <reference path="../../developer/ts/developerNavigation.ts"/>
/// <reference path="../../developer/ts/dataManagerHelper.ts"/>
module Configs{
export class OperateType{
public static get DELETE():string {return "delete"}
@ -57,8 +58,7 @@ module Configs{
}
export function shareInit($scope, $location, $routeParams){
$scope.subTabConfig = createConfigBreadcrumbs($scope, $location, $routeParams);
$scope.model.updateAllData();
$scope. subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
}
export function createNewObejct(array:Array<any>, obj){
@ -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))

@ -2,11 +2,11 @@
/// <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","ConfigsModel",
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel) => {
$scope.model= ConfigsModel;
$scope.tableConfig={
data: 'model.oracleParam',

@ -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=" 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=" 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=" 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,8 +67,6 @@
</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">

@ -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"
}
} */
]);
}

@ -2,8 +2,9 @@
/// <reference path="developerPlugin.ts"/>
/// <reference path="dataManagerModel.ts"/>
/// <reference path="dataManagerHelper.ts"/>
/// <reference path="../../configs/ts/ConfigsHelper.ts"/>
module Developer {
export var KubeTaskController = controller("KubeTaskController", ["$scope", "$location", "$routeParams", "DataModel", "$templateCache", ($scope, $location, $routeParams, DataModel, $templateCache) => {
export var KubeTaskController = controller("KubeTaskController", ["$scope", "$http", "$location", "$routeParams", "DataModel", "$templateCache", ($scope, $http, $location, $routeParams, DataModel, $templateCache) => {
$scope.model = DataModel;
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope.model.data = [{_key: 2, name: "南京市-玄武区", labels:{system: 34, batch: 2}, status: 1, process:75},
@ -40,6 +41,14 @@ module Developer {
displayName: '数据标签',
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
},
{
field: "from",
displayName: '源集群',
},
{
field: "to",
displayName: '目的集群',
},
{
field: "status",
displayName: '迁移状态',
@ -59,7 +68,14 @@ module Developer {
$scope.$on("deleteRow", (event, data) =>{
console.log("删除任务");
if(data.status === 1)
console.log("无法删除");
else{
Configs.oracleInfoOperate($http, "/java/console/api/task", Configs.OperateType.DELETE, data, (data, status) =>{
if(status === 200)
console.log("删除成功");
});
}
});
}]);
}

@ -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);

@ -210,7 +210,7 @@
<script type="text/ng-template" id="taskEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskEdit">
<button class="btn sj_btn" ng-click="deleteRow(entity)">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;删除
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
</button>
</div>
</script>
@ -218,12 +218,10 @@
<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 sj_progress_bar " role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sr-only">{{entity.process}}</span>
<span class="sj_progress_font">20%</span>
<span class="sj_progress_font">{{entity.process}}%</span>
</div>
<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="sr-only">{{entity.process}}</span>
<span class="sj_progress_font">20%</span>
<span class="sj_progress_font">{{entity.process}}%</span>
</div>
</div>
</script>

@ -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()">

@ -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){

@ -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 = {

Loading…
Cancel
Save