diff --git a/v2/assets/css/style.css b/v2/assets/css/style.css index a2c8ecf..249cfc9 100644 --- a/v2/assets/css/style.css +++ b/v2/assets/css/style.css @@ -313,3 +313,6 @@ div.center-align { .margin-right-5 { margin-right: 10px; } +.rounded-button { +border-radius: 4px !important; +} diff --git a/v2/index.html b/v2/index.html index 9bfbb51..b156728 100644 --- a/v2/index.html +++ b/v2/index.html @@ -16,9 +16,10 @@ - - - + + + + diff --git a/v2/src/app/appDev.js b/v2/src/app/appDev.js index fc0f32b..0bd671a 100644 --- a/v2/src/app/appDev.js +++ b/v2/src/app/appDev.js @@ -104,9 +104,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { var servers = [{ "machine_id": 10, "mac": "28.e5.ee.47.14.92", - "switch_ip": "172.29.8.1", - "vlan": "1", - "port": "1", + "switch_ip": "172.29.8.400", + "vlan": 1, + "port": 1, "name": "sv-1", "clusters": [{ "id": 1, @@ -123,9 +123,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 11, "mac": "28.e5.ee.47.a2.93", - "switch_ip": "172.29.8.11", - "vlan": "2", - "port": "2", + "switch_ip": "172.1.20.100", + "vlan": 2, + "port": 2, "name": "sv-2", "clusters": [], "os": "CentOS", @@ -136,9 +136,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 12, "mac": "28.e5.ee.47.ee.32", - "switch_ip": "172.29.8.10", - "vlan": "2", - "port": "3", + "switch_ip": "172.9.20.8", + "vlan": 2, + "port": 3, "name": "sv-3", "clusters": [{ "id": 1, @@ -152,9 +152,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 13, "mac": "28.e5.ee.47.33.66", - "switch_ip": "172.29.8.2", - "vlan": "2", - "port": "4", + "switch_ip": "172.29.8.40", + "vlan": 2, + "port": 4, "name": "sv-4", "clusters": [{ "id": 1, @@ -168,9 +168,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 14, "mac": "28.e5.ee.47.2c.22", - "switch_ip": "172.29.8.3", - "vlan": "2", - "port": "5", + "switch_ip": "172.29.8.40", + "vlan": 2, + "port": 5, "name": "sv-5", "clusters": [{ "id": 1, @@ -184,9 +184,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 15, "mac": "28.e5.ee.47.55.19", - "switch_ip": "172.4.8.40", - "vlan": "2", - "port": "6", + "switch_ip": "172.29.8.40", + "vlan": 2, + "port": 6, "name": "sv-6", "clusters": [{ "id": 1, @@ -200,9 +200,9 @@ compassAppDev.run(function($httpBackend, settings, $http) { }, { "machine_id": 16, "mac": "28.e5.ee.47.41.b2", - "switch_ip": "172.29.8.20", - "vlan": "2", - "port": "7", + "switch_ip": "172.29.7.41", + "vlan": 2, + "port": 7, "name": "sv-7", "clusters": [{ "id": 1, @@ -217,8 +217,8 @@ compassAppDev.run(function($httpBackend, settings, $http) { "machine_id": 17, "mac": "28.e5.ee.47.25.33", "switch_ip": "172.29.8.41", - "vlan": "8", - "port": "8", + "vlan": 8, + "port": 8, "name": "sv-8", "clusters": [{ "id": 1, @@ -233,8 +233,8 @@ compassAppDev.run(function($httpBackend, settings, $http) { "machine_id": 18, "mac": "28.e5.ee.47.5a.60", "switch_ip": "172.29.8.41", - "vlan": "9", - "port": "9", + "vlan": 9, + "port": 9, "name": "sv-9", "clusters": [], "os": "CentOS", @@ -246,8 +246,8 @@ compassAppDev.run(function($httpBackend, settings, $http) { "machine_id": 19, "mac": "28.e5.ee.47.c1.82", "switch_ip": "172.29.8.41", - "vlan": "10", - "port": "10", + "vlan": 10, + "port": 10, "name": "sv-10", "clusters": [], "os": "CentOS", diff --git a/v2/src/app/cluster/cluster-list.tpl.html b/v2/src/app/cluster/cluster-list.tpl.html index 915333a..d00aaad 100644 --- a/v2/src/app/cluster/cluster-list.tpl.html +++ b/v2/src/app/cluster/cluster-list.tpl.html @@ -1,5 +1,4 @@ + + diff --git a/v2/src/app/wizard/wizard.js b/v2/src/app/wizard/wizard.js index 6ef8b40..862edc8 100644 --- a/v2/src/app/wizard/wizard.js +++ b/v2/src/app/wizard/wizard.js @@ -3,7 +3,7 @@ angular.module('compass.wizard', [ 'ui.bootstrap', 'ngTable', 'compass.charts', - 'ngDragDrop' + 'ngDragDrop', ]) .config(function config($stateProvider) { @@ -691,12 +691,31 @@ angular.module('compass.wizard', [ }; }) -.controller('securityCtrl', function($scope, wizardFactory, dataService) { +.controller('securityCtrl', function($scope, $window, wizardFactory, dataService) { var cluster = wizardFactory.getClusterInfo(); $scope.server_credentials = wizardFactory.getServerCredentials(); $scope.service_credentials = wizardFactory.getServiceCredentials(); $scope.management_credentials = wizardFactory.getManagementCredentials(); + $scope.mSave = function() { + $scope.originalMangementData = angular.copy($scope.management_credentials); + } + $scope.sSave = function() { + $scope.originalServiceData = angular.copy($scope.service_credentials); + } + + $scope.mSave(); + $scope.sSave(); + + var keyLength_service_credentials = Object.keys($scope.service_credentials).length; + $scope.editServiceMode = []; + $scope.editServiceMode.length = keyLength_service_credentials; + + + var keyLength_management_credentials = Object.keys($scope.management_credentials).length; + $scope.editMgntMode = []; + $scope.editMgntMode.length = keyLength_management_credentials; + $scope.$watch(function() { return wizardFactory.getCommitState() }, function(newCommitState, oldCommitState) { @@ -707,6 +726,77 @@ angular.module('compass.wizard', [ } }); + $scope.mgmtAccordion = {}; + + $scope.$watch('mgmtAccordion', function(val) { + if ($scope.mgmtAccordion.open == true) { + $scope.mSave(); + } else if ($scope.mgmtAccordion.open == false) { + $scope.mReset(); + $scope.mcloseAll(); + } + }, true) + + $scope.mcloseAll = function() { + for (var i = 0; i < $scope.editMgntMode.length; i++) { + if ($scope.editMgntMode[i] == true) { + $scope.editMgntMode[i] = false; + } else {} + } + } + + $scope.mEdit = function(index) { + for (var i = 0; i < $scope.editMgntMode.length; i++) { + if (i != index) { + $scope.editMgntMode[i] = false; + } else { + $scope.editMgntMode[i] = true; + } + } + $scope.mReset(); + } + + + $scope.mReset = function() { + $scope.management_credentials = angular.copy($scope.originalMangementData); + } + + // Service Credentials + $scope.serverAccordion = {}; + + $scope.$watch('serverAccordion', function(val) { + console.info($scope.serverAccordion); + if ($scope.serverAccordion.open == true) { + $scope.sSave(); + } else if ($scope.serverAccordion.open == false) { + $scope.sReset(); + $scope.scloseAll(); + } + }, true) + + $scope.scloseAll = function() { + for (var i = 0; i < $scope.editServiceMode.length; i++) { + if ($scope.editServiceMode[i] == true) { + $scope.editServiceMode[i] = false; + } else {} + } + } + + $scope.sEdit = function(index) { + for (var i = 0; i < $scope.editServiceMode.length; i++) { + if (i != index) { + $scope.editServiceMode[i] = false; + } else { + $scope.editServiceMode[i] = true; + } + } + $scope.sReset(); + } + + $scope.sReset = function() { + $scope.service_credentials = angular.copy($scope.originalServiceData); + } + $scope.commit = function() { var securityData = { "os_config": { @@ -1086,5 +1176,7 @@ angular.module('compass.wizard', [ }).error(function(data) { console.warn("Review hosts error: ", data); }) + //TODO: error handling + }; })