|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
/// <reference path="configsUtils.ts"/>
|
|
|
|
|
/// <reference path="configsDataService.ts"/>
|
|
|
|
|
/// <reference path="../../kubernetes/ts/term.ts"/>
|
|
|
|
|
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
|
|
|
|
|
/// <reference path="shareController.ts"/>
|
|
|
|
|
module Configs{
|
|
|
|
|
|
|
|
|
@ -60,17 +61,53 @@ module Configs{
|
|
|
|
|
onOk: () => {
|
|
|
|
|
var showDeleteVolume = $scope.showDeleteVolume;
|
|
|
|
|
$timeout(() =>{
|
|
|
|
|
$http({
|
|
|
|
|
var spinner;
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "/java/console/api/volume/delete",
|
|
|
|
|
timeout: 8000,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
//async: false,
|
|
|
|
|
data: showDeleteVolume.item,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
beforeSend: () => {
|
|
|
|
|
Configs.create_mask(); //创建遮罩层
|
|
|
|
|
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
|
|
|
|
|
var target = document.getElementById('loading')
|
|
|
|
|
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
|
|
|
|
},
|
|
|
|
|
complete: (XMLHttpRequest, textStatus) => {
|
|
|
|
|
if(XMLHttpRequest.status == 200){
|
|
|
|
|
Kubernetes.createSuccessInfo("../../../new/images/msgbox_success.png", "更新成功!");
|
|
|
|
|
setTimeout("Kubernetes.removeMask()", 1500);
|
|
|
|
|
//$scope.model.updateVolumeData();
|
|
|
|
|
}else{
|
|
|
|
|
Kubernetes.createSuccessInfo("../../../new/images/msgbox_error.png", "更新失败!");
|
|
|
|
|
setTimeout("Kubernetes.removeMask()", 1500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
success: (data) => {
|
|
|
|
|
if(data){
|
|
|
|
|
ConfigsModel.cluster = data;
|
|
|
|
|
Configs.formatVolumes(ConfigsModel.cluster);
|
|
|
|
|
$scope.$apply(() =>{
|
|
|
|
|
$scope.volumes = ConfigsModel.cluster;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/*$http({
|
|
|
|
|
url: "/java/console/api/volume/delete",
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: showDeleteVolume.item
|
|
|
|
|
}).success(function(data,header,config,status){
|
|
|
|
|
/*
|
|
|
|
|
更新volume信息
|
|
|
|
|
*/
|
|
|
|
|
}).error(function(data,header,config,status){
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
/*$scope.model.updateVolumeData();
|
|
|
|
|
}).error(function(data,header,config,status){
|
|
|
|
|
Configs.customAlert("提示", "删除Volume失败!", '',null, 0, "error");
|
|
|
|
|
});*/
|
|
|
|
|
}, 100);
|
|
|
|
|
},
|
|
|
|
|
onCancel: () =>{
|
|
|
|
@ -90,24 +127,42 @@ module Configs{
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var spinner;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "/java/console/api/volume/update",
|
|
|
|
|
timeout: 8000,
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
//async: false,
|
|
|
|
|
data: JSON.stringify(data),
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
beforeSend: () => {
|
|
|
|
|
|
|
|
|
|
Configs.create_mask(); //创建遮罩层
|
|
|
|
|
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
|
|
|
|
|
var target = document.getElementById('loading')
|
|
|
|
|
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
|
|
|
|
},
|
|
|
|
|
complete: (XMLHttpRequest, textStatus) => {
|
|
|
|
|
if(XMLHttpRequest.status == 200){
|
|
|
|
|
Kubernetes.createSuccessInfo("../../../new/images/msgbox_success.png", "更新成功!");
|
|
|
|
|
setTimeout("Kubernetes.removeMask()", 1500);
|
|
|
|
|
//$scope.model.updateVolumeData();
|
|
|
|
|
}else{
|
|
|
|
|
Kubernetes.createSuccessInfo("../../../new/images/msgbox_error.png", "更新失败!");
|
|
|
|
|
setTimeout("Kubernetes.removeMask()", 1500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
complete: (XMLHttpRequest, textStatus) => {
|
|
|
|
|
if(XMLHttpRequest.status == 200)
|
|
|
|
|
console.log("成功");
|
|
|
|
|
else
|
|
|
|
|
console.log("失败");
|
|
|
|
|
success: (data) => {
|
|
|
|
|
if(data){
|
|
|
|
|
ConfigsModel.cluster = data;
|
|
|
|
|
Configs.formatVolumes(ConfigsModel.cluster);
|
|
|
|
|
$scope.$apply(() =>{
|
|
|
|
|
$scope.volumes = ConfigsModel.cluster;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*$http({
|
|
|
|
|
url: "/java/console/api/volume/update",
|
|
|
|
|