ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/2] ignite git commit: IGNITE-1709 Select cluster\cache when creating new cache\metadata.
Date Tue, 20 Oct 2015 07:32:28 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 a362b8b7a -> a2e00c28c


IGNITE-1709 Select cluster\cache when creating new cache\metadata.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f234578c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f234578c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f234578c

Branch: refs/heads/ignite-843-rc1
Commit: f234578c581e8e6584a77b56dd8c2a36581b4565
Parents: a362b8b
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Oct 20 14:32:40 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Oct 20 14:32:40 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/caches-controller.js       | 12 ++++++------
 .../src/main/js/controllers/clusters-controller.js     | 10 +++++-----
 .../src/main/js/controllers/metadata-controller.js     | 13 ++++++++-----
 .../src/main/js/views/includes/controls.jade           |  2 +-
 4 files changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f234578c/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index 7d6824c..b4d7277 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -254,7 +254,7 @@ consoleModule.controller('cachesController', [
                             $scope.ui.addGroups(data.general, data.advanced);
 
                             if ($common.getQueryVariable('new'))
-                                $scope.createItem();
+                                $scope.createItem($common.getQueryVariable('id'));
                             else {
                                 var lastSelectedCache = angular.fromJson(sessionStorage.lastSelectedCache);
 
@@ -386,27 +386,27 @@ consoleModule.controller('cachesController', [
                     'Selected cache: ' + $scope.backupItem.name : 'New cache';
             };
 
-            function prepareNewItem() {
+            function prepareNewItem(id) {
                 return {
                     space: $scope.spaces[0]._id,
                     cacheMode: 'PARTITIONED',
                     atomicityMode: 'ATOMIC',
                     readFromBackup: true,
                     copyOnRead: true,
-                    clusters: [],
-                    metadatas: []
+                    clusters: id && _.find($scope.clusters, {value: id}) ? [id] :
[],
+                    metadatas: id && _.find($scope.metadatas, {value: id}) ? [id]
: []
                 }
             }
 
             // Add new cache.
-            $scope.createItem = function () {
+            $scope.createItem = function (id) {
                 $table.tableReset();
 
                 $timeout(function () {
                     $common.ensureActivePanel($scope.panels, 'general', 'cacheName');
                 });
 
-                $scope.selectItem(undefined, prepareNewItem());
+                $scope.selectItem(undefined, prepareNewItem(id));
             };
 
             // Check cache logical consistency.

http://git-wip-us.apache.org/repos/asf/ignite/blob/f234578c/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index dc717ce..dda0c13 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -194,7 +194,7 @@ consoleModule.controller('clustersController', [
                         $scope.ui.addGroups(data.general, data.advanced);
 
                         if ($common.getQueryVariable('new'))
-                            $scope.createItem();
+                            $scope.createItem($common.getQueryVariable('id'));
                         else {
                             var lastSelectedCluster = angular.fromJson(sessionStorage.lastSelectedCluster);
 
@@ -327,27 +327,27 @@ consoleModule.controller('clustersController', [
                 'Selected cluster: ' + $scope.backupItem.name : 'New cluster';
         };
 
-        function prepareNewItem() {
+        function prepareNewItem(cacheId) {
             var newItem = {
                 discovery: {kind: 'Multicast', Vm: {addresses: ['127.0.0.1:47500..47510']},
Multicast: {}},
                 deploymentMode: 'SHARED'
             };
 
-            newItem.caches = [];
+            newItem.caches = cacheId && _.find($scope.caches, {value: cacheId}) ?
[cacheId] : [];
             newItem.space = $scope.spaces[0]._id;
 
             return newItem;
         }
 
         // Add new cluster.
-        $scope.createItem = function () {
+        $scope.createItem = function(cacheId) {
             $table.tableReset();
 
             $timeout(function () {
                 $common.ensureActivePanel($scope.panels, "general", 'clusterName');
             });
 
-            $scope.selectItem(undefined, prepareNewItem());
+            $scope.selectItem(undefined, prepareNewItem(cacheId));
         };
 
         $scope.indexOfCache = function (cacheId) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/f234578c/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index 86eac18..c596af4 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -702,7 +702,7 @@ consoleModule.controller('metadataController', [
                             $scope.ui.groups = data.metadata;
 
                             if ($common.getQueryVariable('new'))
-                                $scope.createItem();
+                                $scope.createItem($common.getQueryVariable('id'));
                             else {
                                 var lastSelectedMetadata = angular.fromJson(sessionStorage.lastSelectedMetadata);
 
@@ -809,12 +809,15 @@ consoleModule.controller('metadataController', [
                     : 'New metadata';
             };
 
-            function prepareNewItem() {
-                return {space: $scope.spaces[0]._id, caches: []};
+            function prepareNewItem(cacheId) {
+                return {
+                    space: $scope.spaces[0]._id,
+                    caches: cacheId && _.find($scope.caches, {value: cacheId}) ?
[cacheId] : []
+                };
             }
 
             // Add new metadata.
-            $scope.createItem = function () {
+            $scope.createItem = function (cacheId) {
                 $table.tableReset();
 
                 $timeout(function () {
@@ -822,7 +825,7 @@ consoleModule.controller('metadataController', [
                     $common.ensureActivePanel($scope.panels, 'general', 'keyType');
                 });
 
-                $scope.selectItem(undefined, prepareNewItem());
+                $scope.selectItem(undefined, prepareNewItem(cacheId));
             };
 
             // Check metadata logical consistency.

http://git-wip-us.apache.org/repos/asf/ignite/blob/f234578c/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index 3ec2e84..85b3324 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -318,7 +318,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
         div(ng-switch-when='dropdown-multiple' ng-hide=fieldHide)
             dic(class=lblClasses)
                 label(ng-class=fieldRequiredClass) {{::field.label}}:
-                a.customize(ng-if='field.addLink' ng-href='{{field.addLink.ref}}') (add)
+                a.customize(ng-if='field.addLink' ng-href='{{field.addLink.ref}}&id={{backupItem._id}}')
(add)
             div(class=fieldClasses)
                 +tipField('field.tip')
                 .input-tip


Mime
View raw message