ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 WIP Rework server side to Promises.
Date Tue, 16 Feb 2016 04:05:00 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 63bd2c0a3 -> 3e9942e07


IGNITE-843 WIP Rework server side to Promises.


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

Branch: refs/heads/ignite-843-rc2
Commit: 3e9942e07368ab8a89bed4632feb4c83cee6cf18
Parents: 63bd2c0
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Tue Feb 16 11:05:18 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Feb 16 11:05:18 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/igfs-controller.js                | 7 ++++++-
 modules/control-center-web/src/main/js/serve/routes/caches.js | 2 +-
 .../control-center-web/src/main/js/serve/routes/clusters.js   | 4 ++--
 .../control-center-web/src/main/js/serve/routes/domains.js    | 7 ++++++-
 4 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3e9942e0/modules/control-center-web/src/main/js/controllers/igfs-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/igfs-controller.js b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
index 4644c3d..de45a55 100644
--- a/modules/control-center-web/src/main/js/controllers/igfs-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
@@ -167,7 +167,12 @@ consoleModule.controller('igfsController', [
                 .success(function (data) {
                     $scope.spaces = data.spaces;
                     $scope.igfss = data.igfss;
-                    $scope.clusters = data.clusters;
+                    $scope.clusters = _.map(data.clusters, function (cluster) {
+                        return {
+                            value: cluster._id,
+                            label: cluster.name
+                        };
+                    });
 
                     // Load page descriptor.
                     $http.get('/models/igfs.json')

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e9942e0/modules/control-center-web/src/main/js/serve/routes/caches.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/caches.js b/modules/control-center-web/src/main/js/serve/routes/caches.js
index 581b5f7..4411a61 100644
--- a/modules/control-center-web/src/main/js/serve/routes/caches.js
+++ b/modules/control-center-web/src/main/js/serve/routes/caches.js
@@ -44,7 +44,7 @@ module.exports.factory = function(_, express, mongo) {
                     result.spaces = spaces;
                     spacesIds = mongo.spacesIds(spaces);
 
-                    return mongo.Cluster.find({space: {$in: result.spacesIds}}).sort('name').exec();
+                    return mongo.Cluster.find({space: {$in: spacesIds}}).sort('name').exec();
                 })
                 .then((clusters) => {
                     result.clusters = clusters;

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e9942e0/modules/control-center-web/src/main/js/serve/routes/clusters.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/clusters.js b/modules/control-center-web/src/main/js/serve/routes/clusters.js
index a04844a..08d0051 100644
--- a/modules/control-center-web/src/main/js/serve/routes/clusters.js
+++ b/modules/control-center-web/src/main/js/serve/routes/clusters.js
@@ -138,10 +138,10 @@ module.exports.factory = function(_, express, mongo) {
                 .then((spaces) => {
                     spacesIds = mongo.spacesIds(spaces);
 
-                    return mongo.Cluster.remove({space: {$in: spacesIds}});
+                    return mongo.Cache.update({space: {$in: spacesIds}}, {clusters: []},
{multi: true}).exec();
                 })
-                .then(() => mongo.Cache.update({space: {$in: spacesIds}}, {clusters: []},
{multi: true}).exec())
                 .then(() => mongo.Igfs.update({space: {$in: spacesIds}}, {clusters: []},
{multi: true}).exec())
+                .then(() => mongo.Cluster.remove({space: {$in: spacesIds}}))
                 .then(() => res.sendStatus(200))
                 .catch((err) => mongo.handleError(res, err));
         });

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e9942e0/modules/control-center-web/src/main/js/serve/routes/domains.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/domains.js b/modules/control-center-web/src/main/js/serve/routes/domains.js
index f757910..3953665 100644
--- a/modules/control-center-web/src/main/js/serve/routes/domains.js
+++ b/modules/control-center-web/src/main/js/serve/routes/domains.js
@@ -176,7 +176,12 @@ module.exports.factory = function(_, express, mongo) {
          * Remove domain model by ._id.
          */
         router.post('/remove', (req, res) => {
-            mongo.DomainModel.remove(req.body)
+            const params = req.body;
+            const domainId = params._id;
+
+            mongo.DomainModel.findOne(params).exec()
+                .then((domain) => mongo.Cache.update({_id: {$in: domain.caches}}, {$pull:
{domain: domainId}}, {multi: true}).exec())
+                .then(() => mongo.DomainModel.remove(params))
                 .then(() => res.sendStatus(200))
                 .catch((err) => mongo.handleError(res, err));
         });


Mime
View raw message