---迁移任务分类

Web_Manager_Develope
wu ming 8 years ago
parent fdb373e0a9
commit b2e2df347b

@ -28,6 +28,8 @@ declare module Developer {
data: Array<any>;
paramOptions: OptionsParams;
transferTasks: Array<any>;
doneTask: Array<any>;
runningTask: Array<any>;
constructor();
protected getDataModel(paramOptions: any): any;
initParamOptions(): void;

@ -8,4 +8,5 @@ declare module Kubernetes {
var Status: ng.IModule;
var TaskEdit: ng.IModule;
var LoadMask: ng.IModule;
var TaskRecordEdit: ng.IModule;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -248,8 +248,8 @@ gulp.task('connect', ['watch'], function() {
targetPath: '/hawtio/git'
}, {
proto: "http",
port: "8080",
hostname: "192.168.0.181",
port: "8088",
hostname: "192.168.0.110",
path: '/java/console/api',
targetPath: "/"
}];

@ -6,10 +6,10 @@
<div hawtio-tabs></div>
</div>
<div class="container-content sj_fluid">
<div class="row align-center mb10" ng-hide="model.transferTasks.length">
<div class="row align-center mb10" ng-hide="flag">
<p class="alert alert-info">当前没有可以查看的任务列表!</p>
</div>
<div class="row mb10" ng-show="model.transferTasks.length" >
<div class="row mb10" ng-show="flag" >
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
</div>

@ -46,18 +46,18 @@ module Developer{
}]
},
{
href: UrlHelpers.join(context,"Overview/","task"),
href: UrlHelpers.join(context,"Overview/","task/done"),
label: "任务管理",
title: "任务查看",
items: [{
href: UrlHelpers.join(context,"Overview","hot/data-type/all"),
label: "全部",
title: "全部数据"
href: UrlHelpers.join(context,"Overview","task/done"),
label: "已完成的任务",
title: "已完成的迁移任务"
},
{
href: UrlHelpers.join(context,"Overview/","hot/data-type/social-security"),
label: "社保",
title: "社保数据"
href: UrlHelpers.join(context,"Overview/","task/running"),
label: "正在迁移的任务",
title: "正在迁移的任务"
}]
},
]);

@ -147,6 +147,8 @@ module Developer{
public data:Array<any> = [];
public paramOptions: OptionsParams = new OptionsParams();
public transferTasks: Array<any> = [];
public doneTask: Array<any> = [];
public runningTask: Array<any> = [];
constructor(){
this.updateModel();
@ -199,9 +201,11 @@ module Developer{
public startIntervalTask($interval, $http){
var result;
var timer = $interval(() => {
var timer = $interval(() => {
this.doneTask = [];
this.runningTask = [];
$.ajax({
async: false,
async: true,
type : "POST",
url : "/java/console/api/task/transfer/list",
success : function(data) {
@ -210,7 +214,13 @@ module Developer{
}
}
});
this.transferTasks = formatTask(result);
this.transferTasks = formatTask(result);
angular.forEach(this.transferTasks, (task) => {
if(task.completeStatus == 2)
this.doneTask.push(task);
else
this.runningTask.push(task);
})
},1500);
timer.then(() =>{
@ -225,6 +235,7 @@ module Developer{
//创建数据模型服务
_module.factory("DataModel", ['$rootScope', '$http', '$interval', '$location', '$resource', ($rootScope, $http, $interval, $location, $resource) => {
var webSocket = new WebSocket('ws://192.168.0.101:9000/java/console/api/transferTask');
var $scope = new DataModelService();
$scope.startIntervalTask($interval, $http);
return $scope;

@ -13,7 +13,8 @@ module Developer {
.when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/task'), route('fileMigrationTask.html', false))
.when(UrlHelpers.join(context, 'Overview/task/done'), route('fileMigrationTask.html', false))
.when(UrlHelpers.join(context, 'Overview/task/running'), route('fileMigrationTask.html', false))
.otherwise(context);
}]);

@ -6,10 +6,11 @@
module Developer {
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.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
init();
$scope.tableConfig = {
data: 'model.transferTasks',
data: $scope.dataString,
showSelectionCheckbox: false,
enableRowClickSelection: false,
multiSelect: true,
@ -50,24 +51,53 @@ module Developer {
displayName: '迁移状态',
cellTemplate: $templateCache.get("taskStatus.html")
},
{
field: "process",
displayName: '迁移进度',
cellTemplate: $templateCache.get("taskProcess.html")
},
{
field: "entity",
displayName: '操作',
cellTemplate: $templateCache.get("taskEdit.html")
cellTemplate: $templateCache.get($scope.template)
}
]};
$scope.$on("deleteRow", (event, data) =>{
Configs.oracleInfoOperate($http, "/java/console/api/task/transfer", Configs.OperateType.DELETE, data, (data, status) =>{
if(status === 200)
console.log("删除成功");
});
});
});
function init() {
var path = $location.path().split("/");
console.log(path[4]);
switch (path[4]) {
case "done":
if($scope.model.doneTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.doneTask';
$scope.template = "taskRecordEdit.html";
break;
case "running":
if($scope.model.runningTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.runningTask';
$scope.template = "taskEdit.html";
break;
default:
if($scope.model.doneTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.doneTask';
$scope.template = "taskRecordEdit.html";
break;
}
console.log($scope.template);
}
}]);
}

@ -233,6 +233,20 @@
</div>
</div>
</script>
<script type="text/ng-template" id="taskRecordEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskRecordEdit">
<button class="btn sj_btn" style="border:0;background:none;" ng-click="showDeleteOne.open(entity)" ng-disabled="entity.status == 1 || entity.status == 0">
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
</button>
<div hawtio-confirm-dialog="showDeleteOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteOne.onCancelled()" on-ok="showDeleteOne.onOk()">
<div class="dialog-body">
<p>
是否删除:{{entity.name}}-{{entity.systemName}} 记录?
</p>
</div>
</div>
</script>
<!-- 迁移进度条 -->
<script type="text/ng-template" id="taskProcess.html">
<!-- <div style="height:80%;" class="ngCellText progress" ng-init="entity=row.entity"> -->

@ -162,4 +162,26 @@ module Kubernetes {
export var LoadMask = controller('LoadMask', ['$scope', ($scope) => {
}]);
export var TaskRecordEdit = controller('TaskRecordEdit', ['$scope', ($scope) => {
$scope.showDeleteOne = {
show: false,
item: null,
open: (entity) => {
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = true;
showDeleteOne.item = entity;
},
onOk: () => {
var showDeleteOne = $scope.showDeleteOne;
$scope.$emit('deleteRow', showDeleteOne.item);
},
onCancel: ()=>{
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = false;
showDeleteOne.item = null;
}
}
}]);
}

Loading…
Cancel
Save