///
///
///
module Configs{
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity)=>{
$scope.$emit('editRow', entity);
}
$scope.deleteRowOne ={
show: false,
item: null,
open: (entity) => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = true;
deleteRowOne.item = entity;
},
onOk: () => {
var deleteRowOne = $scope.deleteRowOne;
$scope.$emit('deleteRow', deleteRowOne.item);
},
onCancel: () => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = false;
deleteRowOne.item = null;
}
}
}]);
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.submitted = false;
$scope.status = $scope.ngDialogData.status;
$scope. cancel = () =>{
$scope.closeThisDialog();
$scope.submitted = false;
}
$scope.deleteBrock = (volume:volume, brock) => {
if(volume.brick.length>1)
deleteBrock(volume, brock);
else
$scope.showMessage = true;
}
$scope.addBrock = (volume) => {
var block = {
ip: "", //存储块的机器ip地址
path: "", //存储块路径
status: false, //存储块的状态
editable:true
};
addBrock(volume, block);
$scope.showMessage = false;
}
$scope.stopVolume = (volume) =>{
volume.status = false;
}
$scope.startVolume = (volume) =>{
volume.status = true;
}
$scope.onSubmit = (entity) => {
if($scope.volumeForm.$valid){
$scope.$emit('update', entity);
$scope.closeThisDialog();
}else{
$scope.submitted = true;
}
}
}]);
}