|
|
|
@ -117,9 +117,10 @@ module Developer {
|
|
|
|
|
|
|
|
|
|
$scope.first = () => {
|
|
|
|
|
var idx = $scope.model.getParamOption("currentPageNum");
|
|
|
|
|
if(idx >1)
|
|
|
|
|
if(idx >1){
|
|
|
|
|
$scope.model.updateParamOption("currentPageNum", 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.last = () =>{
|
|
|
|
|
var idx = $scope.model.getParamOption("currentPageNum");
|
|
|
|
@ -138,9 +139,11 @@ module Developer {
|
|
|
|
|
$scope.next = () =>{
|
|
|
|
|
var length =$scope.options.getPageSizeNum();
|
|
|
|
|
var idx = $scope.model.getParamOption("currentPageNum");
|
|
|
|
|
if(idx < length)
|
|
|
|
|
if(idx < length){
|
|
|
|
|
//Kubernetes.eliminateChechBoxClick();
|
|
|
|
|
$scope.model.updateParamOption("currentPageNum", idx+1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.$watch('options', (newValue, oldValue) => {
|
|
|
|
|
if(newValue){
|
|
|
|
@ -165,11 +168,11 @@ module Developer {
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
判断数据是否已挂载使用,返回已挂载使用的数据项列表,长度为0表示当前所选迁移数据项中任何数据文件都未被挂载使用。
|
|
|
|
|
判断数据是否已挂载使用和正在迁移。
|
|
|
|
|
*/
|
|
|
|
|
var exitedItems = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers,$scope.tableConfig.selectedItems);
|
|
|
|
|
if(exitedItems.length > 0){
|
|
|
|
|
Configs.customAlert("提示", "操作失败:正在使用的数据文件不能删除!", '',null, 0, "error");
|
|
|
|
|
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems);
|
|
|
|
|
if(message != ""){
|
|
|
|
|
Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '',null, 0, "error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,30 +240,16 @@ module Developer {
|
|
|
|
|
open: (selected) =>{
|
|
|
|
|
var migrationClick = $scope.migrationClick;
|
|
|
|
|
/*
|
|
|
|
|
判断数据是否已挂载使用,返回已挂载使用的数据项列表,长度为0表示当前所选迁移数据项中任何数据文件都未被挂载使用。
|
|
|
|
|
*/
|
|
|
|
|
var exitedItems = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers,$scope.tableConfig.selectedItems);
|
|
|
|
|
/*
|
|
|
|
|
判断数据是否已在当前目录,返回当前所选目录已存在的数据文件。
|
|
|
|
|
判断数据是否已挂载使用和正在迁移。
|
|
|
|
|
*/
|
|
|
|
|
var result = [];
|
|
|
|
|
angular.forEach($scope.tableConfig.selectedItem, (item) => {
|
|
|
|
|
if(item.dataPath == $scope.selectNode["path"])
|
|
|
|
|
result.push(item);
|
|
|
|
|
});
|
|
|
|
|
/*
|
|
|
|
|
数据不在当前所选目录,且未被挂载启动,执行迁移操作
|
|
|
|
|
*/
|
|
|
|
|
if(exitedItems.length == 0 && result.length == 0){
|
|
|
|
|
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems);
|
|
|
|
|
|
|
|
|
|
if(message == ""){
|
|
|
|
|
if($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0)
|
|
|
|
|
migrationClick.selectedItem = $scope.volumes[0];
|
|
|
|
|
migrationClick.dialog.open();
|
|
|
|
|
}else if(exitedItems.length == 0 && result.length >0){ //任何数据文件都未被挂载使用,当有部分数据文件已存在所选迁移目录
|
|
|
|
|
Configs.customAlert("提示", "操作失败: 部分数据文件已在当前目录存在!", '',null, 0, "error");
|
|
|
|
|
}else if(exitedItems.length > 0 && result.length == 0){
|
|
|
|
|
Configs.customAlert("提示", "操作失败:正在使用的数据文件不能被迁移!", '',null, 0, "error");
|
|
|
|
|
}else{
|
|
|
|
|
Configs.customAlert("提示", "操作失败:部分数据文件正被使用且有部分数据文件已在当前目录存在!", '',null, 0, "error");
|
|
|
|
|
Configs.customAlert("提示", "操作失败:" + message + ", 不能迁移!", '',null, 0, "error");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
close: () => {
|
|
|
|
@ -306,7 +295,6 @@ module Developer {
|
|
|
|
|
angular.forEach(exitedItems, (item) => {
|
|
|
|
|
name += item.name + "-" + item.systemName + ",";
|
|
|
|
|
});
|
|
|
|
|
console.log(exitedItems);
|
|
|
|
|
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能被启动!", '', null, 0, "error");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|