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.
aggregation-platform/plugins/configs/ts/kubeClusterSetting.ts

124 lines
4.2 KiB

/// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.ts"/>
/// <reference path="configsHelper.ts"/>
/// <reference path="configsUtils.ts"/>
8 years ago
module Configs{
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout","ConfigsModel",
8 years ago
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel) => {
$scope.model= ConfigsModel;
8 years ago
$scope.model.updateOracleParam();
$scope.submitted = false;
$scope.tableConfig={
data: 'model.oracleParam',
selectedItems: [],
columnDefs: [{
field: "name",
displayName: "名称"
},
{
field: "ip",
displayName: "IP"
},
{
field: "port",
displayName: "端口号"
},
{
field: "user",
displayName: "用户名"
},
{
field: "password",
displayName: "密码"
},
{
field: "databaseName",
displayName: "服务名"
},
{
field: "tableName",
displayName: "表空间名"
},
{
field: "suffix",
displayName: "表后缀"
},
{
field: "type",
displayName: "标准表汇总库",
cellTemplate: $templateCache.get("strandColumn.html")
},
{
field: "entity",
displayName: "操作",
cellTemplate: $templateCache.get("tableEdit.html")
}],
enableRowClickSelection: false,
showSelectionCheckbox: false,
multiSelect: false,
sortInfo: {
sortBy: "name",
ascending: true
}
}
shareInit($scope, $location, $routeParams);
$scope.create = () =>{
8 years ago
$scope.submitted = false;
$scope.add= true;
$scope.edit = false;
8 years ago
$scope.tableForm = {};
$scope.tableForm["id"]=0;
$scope.tableForm["type"]=0;
}
8 years ago
$scope.cancel = () => {
$scope.tableForm =null;
$scope.add = false;
$scope.edit = false;
8 years ago
$scope.submitted = false;
8 years ago
}
8 years ago
$scope.onSubmit = (oracle) => {
if($scope.validForm.$valid && $scope.validForm.$dirty){
$scope.edit = false;
$scope.add = false;
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, oracle, (result, status) => {
if(status===200){
$scope.model.updateOracleParam();
}else{
throw "资源请求失败";
}
});
}else{
$scope.submitted = true;
}
}
8 years ago
$scope.$on("editRow", (event, data) =>{
$scope.submitted = false;
$scope.tableForm = deepCopy(data);
$scope.edit = true;
$scope.add = false;
8 years ago
//$scope.rowId = data.id
//createNewObejct($scope.tableConfig.columnDefs, data);
//removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
}) ;
$scope.$on("deleteRow", (event, data) =>{
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
if(status===200){
console.log("准备更新");
$scope.model.updateOracleParam();
}else{
throw "资源请求失败";
}
});
//removeElementByValue($scope.model, data._id, "_id");
8 years ago
});
}]);
}