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.
110 lines
2.8 KiB
110 lines
2.8 KiB
/// <reference path="../../includes.ts"/>
|
|
/// <reference path="configPlugin.ts"/>
|
|
/// <reference path="configsDataService.ts"/>
|
|
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;
|
|
}
|
|
}
|
|
}]);
|
|
|
|
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
|
|
var model = $scope.ngDialogData;
|
|
//处理年月
|
|
}]);
|
|
|
|
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
|
|
$scope.content = "";
|
|
getSqlContent();
|
|
function getSqlContent(){
|
|
$http({
|
|
url: "/java/console/api/filePackage/readSqlFile",
|
|
method:'POST',
|
|
params: {type: $scope.ngDialogData.type},
|
|
data: JSON.stringify($scope.ngDialogData.item)
|
|
}).success(function(data,header,config,status){
|
|
|
|
//响应成功
|
|
}).error(function(data,header,config,status){
|
|
//处理响应失败
|
|
});
|
|
}
|
|
|
|
$scope.sqlUpload = (file) => {
|
|
if(typeof FileReader == 'undefined'){
|
|
throw "浏览器不支持FileReader读取文件"
|
|
}else{
|
|
var fr = new FileReader();
|
|
fr.onloadend = (e) => {
|
|
console.log(e.target.result);
|
|
}
|
|
fr.readAsText(file[0],"UTF-8");
|
|
}
|
|
}
|
|
}]);
|
|
} |