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.
109 lines
3.3 KiB
109 lines
3.3 KiB
/// <reference path="../../includes.ts"/>
|
|
/// <reference path="configPlugin.ts"/>
|
|
/// <reference path="configsHelper.ts"/>
|
|
/// <reference path="configsUtils.ts"/>
|
|
module Configs{
|
|
|
|
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout",
|
|
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout) => {
|
|
|
|
$scope.model= [{
|
|
"name": "",
|
|
"status": "OK",
|
|
"ip": "10.188.2.3",
|
|
"_id": 1
|
|
},
|
|
{
|
|
"name": "camel-041",
|
|
"status": "OK",
|
|
"ip": "10.188.2.20",
|
|
"_id": 2
|
|
},
|
|
{
|
|
"name": "activemq-004",
|
|
"status": "failed",
|
|
"ip": "10.188.2.111",
|
|
"_id": 3
|
|
}];
|
|
|
|
$scope.tableConfig={
|
|
data: "model",
|
|
selectedItems: [{
|
|
name: "activemq-004",
|
|
status: "failed",
|
|
ip: "10.188.2.111",
|
|
_id: 2
|
|
}],
|
|
columnDefs: [{
|
|
field: "_id",
|
|
displayName: "序号"
|
|
},
|
|
{
|
|
field: "name",
|
|
displayName: "名称"
|
|
},
|
|
{
|
|
field: "ip",
|
|
displayName: "IP"
|
|
},
|
|
{
|
|
field: "port",
|
|
displayName: "端口号"
|
|
},
|
|
{
|
|
field: "userName",
|
|
displayName: "用户名"
|
|
},
|
|
{
|
|
field: "password",
|
|
displayName: "密码"
|
|
},
|
|
{
|
|
field: "serviceName",
|
|
displayName: "服务名"
|
|
},
|
|
{
|
|
field: "status",
|
|
displayName: "连接状态"
|
|
},
|
|
{
|
|
field: "entity",
|
|
displayName: "操作",
|
|
cellTemplate: $templateCache.get("tableEdit.html")
|
|
}],
|
|
enableRowClickSelection: true,
|
|
showSelectionCheckbox: false,
|
|
multiSelect: false,
|
|
sortInfo: {
|
|
sortBy: "_id",
|
|
ascending: true
|
|
}
|
|
}
|
|
|
|
shareInit($scope, $location, $routeParams);
|
|
|
|
$scope.create = () =>{
|
|
$scope.add= true;
|
|
$scope.edit = false;
|
|
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, null);
|
|
removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
|
}
|
|
|
|
$scope.onSubmit = () => {
|
|
$scope.edit = false;
|
|
$scope.add = false;
|
|
console.log($scope.tableForm);
|
|
}
|
|
|
|
$scope.$on("editRow", (event, data) =>{
|
|
$scope.edit = true;
|
|
$scope.add = false;
|
|
$scope.tableForm = createNewObejct($scope.tableConfig.columnDefs, data);
|
|
removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
|
}) ;
|
|
|
|
$scope.$on("deleteRow", (event, data) =>{
|
|
removeElementByValue($scope.model, data._id, "_id");
|
|
}) ;
|
|
}]);
|
|
} |