You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.7 KiB
96 lines
2.7 KiB
/// <reference path="../../includes.ts"/>
|
|
/// <reference path="configPlugin.ts"/>
|
|
/// <reference path="configsHelper.ts"/>
|
|
/// <reference path="configsUtils.ts"/>
|
|
/// <reference path="configsDataService.ts"/>
|
|
/// <reference path="../../kubernetes/ts/term.ts"/>
|
|
/// <reference path="shareController.ts"/>
|
|
module Configs{
|
|
|
|
export var GfsController = controller('GfsController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout", 'ConfigsModel', 'ngDialog',
|
|
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel, ngDialog) =>{
|
|
$scope.model = ConfigsModel;
|
|
$scope.volumes = ConfigsModel.cluster;
|
|
shareInit($scope, $location, $routeParams);
|
|
|
|
$scope.createGfs = () => {
|
|
ngDialog.open({
|
|
template: 'newDialog.html',
|
|
controller:'Configs.VolumeController',
|
|
width: 1005,
|
|
data: {
|
|
name: '',
|
|
path: '',
|
|
status: false,
|
|
brick: [{
|
|
ip: ["0", "0", "0", "0"],
|
|
path: '',
|
|
status: false,
|
|
editable: true
|
|
}],
|
|
editable: true
|
|
},
|
|
className: 'ngdialog-theme-default'
|
|
});
|
|
}
|
|
|
|
$scope.editRow = (volume) => {
|
|
var fVolume = formatVolume(volume);
|
|
ngDialog.open({
|
|
template: 'newDialog.html',
|
|
width: 1005,
|
|
data: fVolume,
|
|
className: 'ngdialog-theme-default',
|
|
controller: 'Configs.VolumeController'
|
|
});
|
|
}
|
|
|
|
$scope.showDeleteVolume = {
|
|
show: false,
|
|
item: null,
|
|
open: (entity) => {
|
|
var showDeleteVolume = $scope.showDeleteVolume;
|
|
showDeleteVolume.show = true;
|
|
showDeleteVolume.item = entity;
|
|
},
|
|
onOk: () => {
|
|
var showDeleteVolume = $scope.showDeleteVolume;
|
|
$timeout(() =>{
|
|
$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){
|
|
|
|
});
|
|
}, 100);
|
|
},
|
|
onCancel: () =>{
|
|
var showDeleteVolume = $scope.showDeleteVolume;
|
|
showDeleteVolume.show = false;
|
|
showDeleteVolume.item = null;
|
|
}
|
|
}
|
|
|
|
|
|
/* (volume) =>{
|
|
$http({
|
|
url: "/java/console/api/volume/delete",
|
|
method: 'POST',
|
|
data: volume
|
|
}).success(function(data,header,config,status){
|
|
/*
|
|
|
|
更新volume信息
|
|
|
|
|
|
}).error(function(data,header,config,status){
|
|
|
|
});
|
|
}*/
|
|
}]);
|
|
} |