+
-
+
添加
diff --git a/plugins/configs/html/kubeForm.html b/plugins/configs/html/kubeForm.html
new file mode 100644
index 00000000..5305d1d5
--- /dev/null
+++ b/plugins/configs/html/kubeForm.html
@@ -0,0 +1,21 @@
+
diff --git a/plugins/configs/html/shareLayout.html b/plugins/configs/html/shareLayout.html
new file mode 100644
index 00000000..e73a40f8
--- /dev/null
+++ b/plugins/configs/html/shareLayout.html
@@ -0,0 +1,18 @@
+
+
+
diff --git a/plugins/configs/ts/configsDataService.ts b/plugins/configs/ts/configsDataService.ts
new file mode 100644
index 00000000..d9c6617e
--- /dev/null
+++ b/plugins/configs/ts/configsDataService.ts
@@ -0,0 +1,70 @@
+///
+///
+module Configs{
+
+ export interface Block{
+ ip:string; //存储块的机器ip地址
+ path: string; //路径
+ }
+
+ export interface oracleParam{
+ name: string
+ ip: string;
+ port: string;
+ serviceName: string;
+ tableName: string;
+ status: string;
+ }
+
+ export interface volume{
+ name: string; //volume的名字
+ totalSize: number; //volume空间大小
+ usedSize: number; // volume已使用空间大小
+ block: Block; //volume中的存储块
+ folder?: Array
; //volume的文件
+ }
+
+ //字节大小转换成字符大小
+ function getStringSize(size: number){
+ var result = size;
+ var suffix =["B", "KB" ,"MB", "GB", "GB", "TB"];
+ var count=1;
+ while(result > 1024){
+ result = result/1024;
+ count ++;
+ }
+ return result + suffix[count];
+ }
+
+
+ export class ConfigsModelService{
+ public cluster: Array=[];
+ public oracleParam: Array;
+
+ public updateVolumeData($scope: ConfigsModelService, $http){
+ console.log($scope);
+ $http({
+ method: "POST",
+ url: "/java/console/api/volume/list"
+ }).success(function(data, status, headers, config) {
+ $scope.cluster.push(data);
+ }).error(function(data, status, headers, config) {
+ //$scope.voume=data;
+ });
+ }
+
+ public getFolderByVolumeName(name: string){
+ if(this.cluster===null)
+ return null;
+ for(var i=0; i< this.cluster.length; i++){
+ if(this.cluster[i].name === name)
+ return this.cluster[i].folder;
+ }
+ }
+ }
+
+ _module.factory('ConfigsModel', ['$rootScope', '$http', '$location', '$resource', ($rootScope, $http, $location, $resource) =>{
+ var $scope = new ConfigsModelService();
+ return $scope;
+ }]);
+}
\ No newline at end of file
diff --git a/plugins/configs/ts/configsUtils.ts b/plugins/configs/ts/configsUtils.ts
new file mode 100644
index 00000000..719b88fe
--- /dev/null
+++ b/plugins/configs/ts/configsUtils.ts
@@ -0,0 +1,27 @@
+///
+
+module Configs{
+ export function removeElementByValue(array:Array ,value:any, key?:string ){
+ if(key){
+ for(var i=0; i, elements:Array){
+ angular.forEach(elements, (element) =>{
+ removeElementByValue(array, element.value, element.key);
+ });
+ }
+}
\ No newline at end of file
diff --git a/plugins/configs/ts/kubeClusterSetting.ts b/plugins/configs/ts/kubeClusterSetting.ts
new file mode 100644
index 00000000..6ead5770
--- /dev/null
+++ b/plugins/configs/ts/kubeClusterSetting.ts
@@ -0,0 +1,109 @@
+///
+///
+///
+///
+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");
+ }) ;
+ }]);
+}
\ No newline at end of file
diff --git a/plugins/configs/ts/shareController.ts b/plugins/configs/ts/shareController.ts
new file mode 100644
index 00000000..e4b39341
--- /dev/null
+++ b/plugins/configs/ts/shareController.ts
@@ -0,0 +1,13 @@
+///
+///
+module Configs{
+ export var EableEdit = controller('EableEdit', ['$scope', ($scope) => {
+ $scope.editRow = (entity)=>{
+ $scope.$emit('editRow', entity);
+ }
+
+ $scope.deleteRow = (entity) =>{
+ $scope.$emit('deleteRow', entity);
+ }
+ }]);
+}
\ No newline at end of file
diff --git a/plugins/developer/html/workspaces.html b/plugins/developer/html/workspaces.html
index 59a174d5..733f1e50 100644
--- a/plugins/developer/html/workspaces.html
+++ b/plugins/developer/html/workspaces.html
@@ -65,10 +65,10 @@
请选择迁移集群
-
+
-
+
{{node.name}}
diff --git a/plugins/developer/ts/workspaces.ts b/plugins/developer/ts/workspaces.ts
index 027b72ee..b10c6e29 100644
--- a/plugins/developer/ts/workspaces.ts
+++ b/plugins/developer/ts/workspaces.ts
@@ -1,22 +1,25 @@
///
///
///
+///
///
///
///
///
module Developer {
- export var WorkspacesController = controller("WorkspacesController", ["$scope", "KubernetesModel", "DataModel","KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "$element",
- ($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element) => {
- init($scope, $location, $routeParams);
-
- console.log($location.url());
+ export var WorkspacesController = controller("WorkspacesController", ["$scope", "KubernetesModel", "DataModel", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "$element",
+ ($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, ConfigsModel:Configs.ConfigsModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element) => {
+ init($scope, $location, $routeParams);
$scope.model=DataModel;
+ $scope.configs = ConfigsModel;
$scope.model.initParamOptions();
$scope.options = DataModel.paramOptions;
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
$scope.options.dataType = getDataType($location);
+
+
+ console.log($scope.volumes);
$scope.model.updateModel();
@@ -34,21 +37,6 @@ module Developer {
labelSelected: "a8"
}
}
- $scope.dataForTheTree =
- [
- { "name" : "Joe", "age" : "21", "children" : [
- { "name" : "Smith", "age" : "42", "children" : [] },
- { "name" : "Gary", "age" : "21", "children" : [
- { "name" : "Jenifer", "age" : "23", "children" : [
- { "name" : "Dani", "age" : "32", "children" : [] },
- { "name" : "Max", "age" : "34", "children" : [] }
- ]}
- ]}
- ]},
- { "name" : "Albert", "age" : "33", "children" : [] },
- { "name" : "Ron", "age" : "29", "children" : [] }
- ];
-
//配置数据表格需要显示的内容及显示格式
$scope.tableConfig = {
@@ -181,16 +169,8 @@ module Developer {
open: (selected) =>{
var migrationClick = $scope.migrationClick;
migrationClick.dialog.open();
- $http({
- url: "/java/console/api/getFolder",
- method:'POST',
- params:{oracleName: selected}
- }).success(function(data,header,config,status){
- $scope.treeData = data;
- console.log("success");
- }).error(function(data,header,config,status){
- //log.warn("Failed to connect " + connectParam + " " + data + " " + status);
- });
+ console.log("===================");
+ console.log(selected);
},
close: () => {
$scope.migrationClick.dialog.close();
@@ -199,7 +179,7 @@ module Developer {
$scope.createOracleService = (items) =>{
console.log(items);
- /*angular.forEach(items,(item)=>{
+ angular.forEach(items,(item)=>{
console.log(item);
Kubernetes.createRC({
name: item._key,
@@ -218,11 +198,12 @@ module Developer {
}, (rc) =>{
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0);
});
- });*/
+ });
}
function init($scope,$location,$routeParams){
//创建二级菜单
+ ConfigsModel.updateVolumeData($scope.configs, $http);
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope.navbarItems =[{
herf: "",
diff --git a/plugins/kubernetes/ts/kubernetesPlugin.ts b/plugins/kubernetes/ts/kubernetesPlugin.ts
index e0a43e4b..636c65e2 100644
--- a/plugins/kubernetes/ts/kubernetesPlugin.ts
+++ b/plugins/kubernetes/ts/kubernetesPlugin.ts
@@ -1,6 +1,7 @@
///
///
+
declare var OSOAuthConfig:any;
declare var GoogleOAuthConfig:any;
declare var KeycloakConfig:any;
diff --git a/plugins/kubernetes/ts/kubernetesTopLevel.ts b/plugins/kubernetes/ts/kubernetesTopLevel.ts
index 280d854e..46b3e76c 100644
--- a/plugins/kubernetes/ts/kubernetesTopLevel.ts
+++ b/plugins/kubernetes/ts/kubernetesTopLevel.ts
@@ -2,12 +2,14 @@
///
///
///
+///
module Kubernetes {
export var FileDropController = controller("FileDropController", ["$scope", "KubernetesModel", "FileUploader", '$http', ($scope, model:KubernetesModelService, FileUploader, $http:ng.IHttpService) => {
var log = Logger.get('kubernetes-file-uploader');
+ console.log("---------------------------");
var uploader = $scope.uploader =
new FileUploader({
autoUpload: false,