You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/02/17 04:43:22 UTC
[3/5] ignite git commit: IGNITE-843 Refactor serve to es6.
IGNITE-843 Refactor serve to es6.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9f3c4c0f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9f3c4c0f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9f3c4c0f
Branch: refs/heads/ignite-843-rc3
Commit: 9f3c4c0f8d5320cbfd5df014afec46e916bb704b
Parents: acf54cf
Author: Andrey <an...@gridgain.com>
Authored: Wed Feb 17 10:34:06 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Wed Feb 17 10:34:06 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/caches.js | 9 +++++----
.../src/main/js/serve/routes/clusters.js | 12 ++++++------
2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9f3c4c0f/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 855d2fc..e5f82ce 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
@@ -39,11 +39,12 @@ module.exports.factory = function(_, express, mongo) {
let spaceIds = [];
// Get owned space and all accessed space.
- mongo.spaceIds(req.currentUserId())
- .then((_spaceIds) => {
- spaceIds = _spaceIds;
+ mongo.spaces(req.currentUserId())
+ .then((spaces) => {
+ result.spaces = spaces;
+ spaceIds = spaces.map((space) => space._id);
- mongo.Cluster.find({space: {$in: _spaceIds}}).sort('name').lean().exec()
+ mongo.Cluster.find({space: {$in: spaceIds}}).sort('name').lean().exec()
})
.then((clusters) => {
result.clusters = clusters;
http://git-wip-us.apache.org/repos/asf/ignite/blob/9f3c4c0f/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 469eae7..d05002d 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
@@ -36,15 +36,15 @@ module.exports.factory = function(_, express, mongo) {
*/
router.post('/list', (req, res) => {
const result = {};
- let spacesIds = [];
+ let spaceIds = [];
let domains = {};
mongo.spaces(req.currentUserId())
.then((spaces) => {
result.spaces = spaces;
- spacesIds = spaces.map((space) => space._id);
+ spaceIds = spaces.map((space) => space._id);
- return mongo.DomainModel.find({space: {$in: spacesIds}}).sort('valueType').lean().exec();
+ return mongo.DomainModel.find({space: {$in: spaceIds}}).sort('valueType').lean().exec();
})
.then((_domains) => {
domains = _domains.reduce((map, obj) => {
@@ -53,7 +53,7 @@ module.exports.factory = function(_, express, mongo) {
return map;
}, {});
- return mongo.Cache.find({space: {$in: spacesIds}}).sort('name').lean().exec();
+ return mongo.Cache.find({space: {$in: spaceIds}}).sort('name').lean().exec();
})
.then((caches) => {
_.forEach(caches, (cache) => {
@@ -62,12 +62,12 @@ module.exports.factory = function(_, express, mongo) {
result.caches = caches;
- return mongo.Igfs.find({space: {$in: spacesIds}}).sort('name').lean().exec();
+ return mongo.Igfs.find({space: {$in: spaceIds}}).sort('name').lean().exec();
})
.then((igfss) => {
result.igfss = igfss;
- return mongo.Cluster.find({space: {$in: spacesIds}}).sort('name').deepPopulate(mongo.ClusterDefaultPopulate).lean().exec();
+ return mongo.Cluster.find({space: {$in: spaceIds}}).sort('name').deepPopulate(mongo.ClusterDefaultPopulate).lean().exec();
})
.then((clusters) => {
result.clusters = clusters;