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 Fixed eslint warnings.
Date Fri, 12 Feb 2016 03:33:07 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 a4a0ebdc5 -> 0a7ac460f


IGNITE-843 Fixed eslint warnings.


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

Branch: refs/heads/ignite-843-rc2
Commit: 0a7ac460fa0eae77767e552f4aabfd8da700ec97
Parents: a4a0ebd
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Feb 12 10:33:21 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Feb 12 10:33:21 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/serve/mongo.js                  |  5 +-
 .../src/main/js/serve/routes/admin.js           | 28 +++----
 .../src/main/js/serve/routes/agent.js           | 42 +++++------
 .../src/main/js/serve/routes/caches.js          | 70 +++++++++---------
 .../src/main/js/serve/routes/clusters.js        | 60 +++++++--------
 .../src/main/js/serve/routes/domains.js         | 78 ++++++++++----------
 .../src/main/js/serve/routes/igfs.js            | 48 ++++++------
 .../src/main/js/serve/routes/notebooks.js       | 36 ++++-----
 .../src/main/js/serve/routes/profile.js         | 20 ++---
 .../src/main/js/serve/routes/public.js          | 48 ++++++------
 .../src/main/js/serve/settings.js               |  4 +-
 11 files changed, 220 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/mongo.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/mongo.js b/modules/control-center-web/src/main/js/serve/mongo.js
index d423098..f31267d 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -31,8 +31,9 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
     // Connect to mongoDB database.
     mongoose.connect(settings.mongoUrl, {server: {poolSize: 4}});
 
-    const Schema = mongoose.Schema, ObjectId = mongoose.Schema.Types.ObjectId,
-        result = { connection: mongoose.connection };
+    const Schema = mongoose.Schema;
+    const ObjectId = mongoose.Schema.Types.ObjectId;
+    const result = { connection: mongoose.connection };
 
     // Define Account schema.
     const AccountSchema = new Schema({

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/admin.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/admin.js b/modules/control-center-web/src/main/js/serve/routes/admin.js
index 013ae5f..09e6c21 100644
--- a/modules/control-center-web/src/main/js/serve/routes/admin.js
+++ b/modules/control-center-web/src/main/js/serve/routes/admin.js
@@ -22,15 +22,15 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'require(nodemailer)', 'settings', 'mongo']
 };
 
-module.exports.factory = function (_, express, nodemailer, settings, mongo) {
+module.exports.factory = function(_, express, nodemailer, settings, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
 
         /**
          * Get list of user accounts.
          */
-        router.post('/list', function (req, res) {
-            mongo.Account.find({}).sort('username').exec(function (err, users) {
+        router.post('/list', function(req, res) {
+            mongo.Account.find({}).sort('username').exec(function(err, users) {
                 if (err)
                     return res.status(500).send(err.message);
 
@@ -39,15 +39,15 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
         });
 
         // Remove user.
-        router.post('/remove', function (req, res) {
+        router.post('/remove', function(req, res) {
             var userId = req.body.userId;
 
-            mongo.Account.findByIdAndRemove(userId, function (err, user) {
+            mongo.Account.findByIdAndRemove(userId, function(err, user) {
                 if (err)
                     return res.status(500).send(err.message);
 
-                mongo.Space.find({owner: userId}, function (err, spaces) {
-                    _.forEach(spaces, function (space) {
+                mongo.Space.find({owner: userId}, function(err, spaces) {
+                    _.forEach(spaces, function(space) {
                         mongo.Cluster.remove({space: space._id}).exec();
                         mongo.Cache.remove({space: space._id}).exec();
                         mongo.DomainModel.remove({space: space._id}).exec();
@@ -64,7 +64,7 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
                     }
                 };
 
-                if (transporter.service != '' || transporter.auth.user != '' || transporter.auth.pass != '') {
+                if (transporter.service !== '' || transporter.auth.user !== '' || transporter.auth.pass !== '') {
                     var mailer = nodemailer.createTransport(transporter);
 
                     var mailOptions = {
@@ -76,7 +76,7 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
                         'Apache Ignite Web Console http://' + req.headers.host + '\n'
                     };
 
-                    mailer.sendMail(mailOptions, function (err) {
+                    mailer.sendMail(mailOptions, function(err) {
                         if (err)
                             return res.status(503).send('Account was removed, but failed to send e-mail notification to user!<br />' + err);
 
@@ -89,11 +89,11 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
         });
 
         // Save user.
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var userId = req.body.userId;
             var adminFlag = req.body.adminFlag;
 
-            mongo.Account.findByIdAndUpdate(userId, {admin: adminFlag}, function (err) {
+            mongo.Account.findByIdAndUpdate(userId, {admin: adminFlag}, function(err) {
                 if (err)
                     return res.status(500).send(err.message);
 
@@ -102,8 +102,8 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
         });
 
         // Become user.
-        router.get('/become', function (req, res) {
-            mongo.Account.findById(req.query.viewedUserId).exec(function (err, viewedUser) {
+        router.get('/become', function(req, res) {
+            mongo.Account.findById(req.query.viewedUserId).exec(function(err, viewedUser) {
                 if (err)
                     return res.sendStatus(404);
 
@@ -114,7 +114,7 @@ module.exports.factory = function (_, express, nodemailer, settings, mongo) {
         });
 
         // Become user.
-        router.get('/revert/identity', function (req, res) {
+        router.get('/revert/identity', function(req, res) {
             req.session.viewedUser = null;
 
             return res.sendStatus(200);

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/agent.js b/modules/control-center-web/src/main/js/serve/routes/agent.js
index ce38bfd..d98400f 100644
--- a/modules/control-center-web/src/main/js/serve/routes/agent.js
+++ b/modules/control-center-web/src/main/js/serve/routes/agent.js
@@ -32,14 +32,14 @@ module.exports = {
  * @param {AgentManager} agent
  * @returns {Promise}
  */
-module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings, agent) {
+module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings, agent) {
     return new Promise((resolve) => {
         const router = express.Router();
 
         const SqlFieldsQuery = apacheIgnite.SqlFieldsQuery, ScanQuery = apacheIgnite.ScanQuery;
 
         const _client = (userId) => {
-            return new Promise(function (resolve, reject) {
+            return new Promise(function(resolve, reject) {
                 var client = agent.findClient(userId);
 
                 if (client)
@@ -54,7 +54,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         };
 
         const _handleException = (res) => {
-            return function (error) {
+            return function(error) {
                 if (_.isObject(error))
                     return res.status(error.code).send(error.message);
 
@@ -63,17 +63,17 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         };
 
         /* Get grid topology. */
-        router.get('/download/zip', function (req, res) {
+        router.get('/download/zip', function(req, res) {
             var agentFld = settings.agent.file;
             var agentZip = agentFld + '.zip';
             var agentPathZip = 'public/agent/' + agentFld + '.zip';
 
-            fs.stat(agentPathZip, function (err, stats) {
+            fs.stat(agentPathZip, function(err, stats) {
                 if (err)
                     return res.download(agentPathZip, agentZip);
 
                 // Read a zip file.
-                fs.readFile(agentPathZip, function (err, data) {
+                fs.readFile(agentPathZip, function(err, data) {
                     if (err)
                         return res.download(agentPathZip, agentZip);
 
@@ -89,7 +89,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
                     prop.push('#node-uri=http://localhost:8080');
                     prop.push('#driver-folder=./jdbc-drivers');
                     prop.push('');
-                    prop.push("#Note: Don't change this auto generated line");
+                    prop.push('#Note: Do not change this auto generated line');
                     prop.push('rel-date=' + stats.birthtime.getTime());
 
                     zip.file(agentFld + '/default.properties', prop.join('\n'));
@@ -105,7 +105,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Get grid topology. */
-        router.post('/topology', function (req, res) {
+        router.post('/topology', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => client.ignite(req.body.demo).cluster(req.body.attr, req.body.mtr))
                 .then((clusters) => res.json(clusters))
@@ -113,7 +113,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Execute query. */
-        router.post('/query', function (req, res) {
+        router.post('/query', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     // Create sql query.
@@ -133,7 +133,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Execute query getAll. */
-        router.post('/query/getAll', function (req, res) {
+        router.post('/query/getAll', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     // Create sql query.
@@ -145,7 +145,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
                     // Get query cursor.
                     const cursor = client.ignite(req.body.demo).cache(req.body.cacheName).query(qry);
 
-                    return new Promise(function (resolve) {
+                    return new Promise(function(resolve) {
                         cursor.getAll().then(rows => resolve({meta: cursor.fieldsMetadata(), rows}))
                     });
                 })
@@ -154,7 +154,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Execute query. */
-        router.post('/scan', function (req, res) {
+        router.post('/scan', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     // Create sql query.
@@ -175,7 +175,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Get next query page. */
-        router.post('/query/fetch', function (req, res) {
+        router.post('/query/fetch', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
@@ -191,7 +191,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Close query cursor by id. */
-        router.post('/query/close', function (req, res) {
+        router.post('/query/close', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
@@ -203,14 +203,14 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Get metadata for cache. */
-        router.post('/cache/metadata', function (req, res) {
+        router.post('/cache/metadata', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => client.ignite(req.body.demo).cache(req.body.cacheName).metadata())
                 .then((caches) => {
                     var types = [];
 
                     for (var meta of caches) {
-                        var cacheTypes = meta.types.map(function (typeName) {
+                        var cacheTypes = meta.types.map(function(typeName) {
                             var fields = meta.fields[typeName];
 
                             var columns = [];
@@ -222,7 +222,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
                                     type: 'field',
                                     name: fieldName,
                                     clazz: fieldClass,
-                                    system: fieldName == "_KEY" || fieldName == "_VAL",
+                                    system: fieldName === "_KEY" || fieldName === "_VAL",
                                     cacheName: meta.cacheName,
                                     typeName: typeName
                                 });
@@ -283,14 +283,14 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /* Ping client. */
-        router.post('/ping', function (req, res) {
+        router.post('/ping', function(req, res) {
             _client(req.currentUserId())
                 .then(() => res.sendStatus(200))
                 .catch(_handleException(res));
         });
 
         /* Get JDBC drivers list. */
-        router.post('/drivers', function (req, res) {
+        router.post('/drivers', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => client.availableDrivers())
                 .then((arr) => res.json(arr))
@@ -298,7 +298,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /** Get database schemas. */
-        router.post('/schemas', function (req, res) {
+        router.post('/schemas', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     var args = req.body;
@@ -312,7 +312,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
         });
 
         /** Get database tables. */
-        router.post('/tables', function (req, res) {
+        router.post('/tables', function(req, res) {
             _client(req.currentUserId())
                 .then((client) => {
                     var args = req.body;

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/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 7d719e3..2ecbc54 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
@@ -22,7 +22,7 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'mongo']
 };
 
-module.exports.factory = function (_, express, mongo) {
+module.exports.factory = function(_, express, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
         
@@ -32,48 +32,48 @@ module.exports.factory = function (_, express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/list', function (req, res) {
+        router.post('/list', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
                     // Get all clusters for spaces.
-                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function (err, clusters) {
+                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function(err, clusters) {
                         if (mongo.processed(err, res)) {
                             // Get all domain models for spaces.
-                            mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function (err, domains) {
+                            mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function(err, domains) {
                                 if (mongo.processed(err, res)) {
                                     // Get all caches for spaces.
-                                    mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err, caches) {
+                                    mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function(err, caches) {
                                         if (mongo.processed(err, res)) {
-                                            _.forEach(clusters, function (cluster) {
-                                                cluster.caches = _.filter(cluster.caches, function (cacheId) {
+                                            _.forEach(clusters, function(cluster) {
+                                                cluster.caches = _.filter(cluster.caches, function(cacheId) {
                                                     return _.find(caches, {_id: cacheId});
                                                 });
                                             });
 
-                                            _.forEach(domains, function (domain) {
-                                                domain.caches = _.filter(domain.caches, function (cacheId) {
+                                            _.forEach(domains, function(domain) {
+                                                domain.caches = _.filter(domain.caches, function(cacheId) {
                                                     return _.find(caches, {_id: cacheId});
                                                 });
                                             });
 
-                                            _.forEach(caches, function (cache) {
+                                            _.forEach(caches, function(cache) {
                                                 // Remove deleted clusters.
-                                                cache.clusters = _.filter(cache.clusters, function (clusterId) {
-                                                    return _.findIndex(clusters, function (cluster) {
+                                                cache.clusters = _.filter(cache.clusters, function(clusterId) {
+                                                    return _.findIndex(clusters, function(cluster) {
                                                             return cluster._id.equals(clusterId);
                                                         }) >= 0;
                                                 });
 
                                                 // Remove deleted domain models.
-                                                cache.domains = _.filter(cache.domains, function (metaId) {
-                                                    return _.findIndex(domains, function (domain) {
+                                                cache.domains = _.filter(cache.domains, function(metaId) {
+                                                    return _.findIndex(domains, function(domain) {
                                                             return domain._id.equals(metaId);
                                                         }) >= 0;
                                                 });
@@ -81,7 +81,7 @@ module.exports.factory = function (_, express, mongo) {
 
                                             res.json({
                                                 spaces: spaces,
-                                                clusters: clusters.map(function (cluster) {
+                                                clusters: clusters.map(function(cluster) {
                                                     return {
                                                         value: cluster._id,
                                                         label: cluster.name,
@@ -104,22 +104,22 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Save cache.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var params = req.body;
             var cacheId = params._id;
             var clusters = params.clusters;
             var domains = params.domains;
 
             if (params._id) {
-                mongo.Cache.update({_id: cacheId}, params, {upsert: true}, function (err) {
+                mongo.Cache.update({_id: cacheId}, params, {upsert: true}, function(err) {
                     if (mongo.processed(err, res))
-                        mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
+                        mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
-                                mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {caches: cacheId}}, {multi: true}, function (err) {
+                                mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {caches: cacheId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
-                                        mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
+                                        mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
                                             if (mongo.processed(err, res))
-                                                mongo.DomainModel.update({_id: {$nin: domains}}, {$pull: {caches: cacheId}}, {multi: true}, function (err) {
+                                                mongo.DomainModel.update({_id: {$nin: domains}}, {$pull: {caches: cacheId}}, {multi: true}, function(err) {
                                                     if (mongo.processed(err, res))
                                                         res.send(params._id);
                                                 });
@@ -129,18 +129,18 @@ module.exports.factory = function (_, express, mongo) {
                 })
             }
             else
-                mongo.Cache.findOne({space: params.space, name: params.name}, function (err, cache) {
+                mongo.Cache.findOne({space: params.space, name: params.name}, function(err, cache) {
                     if (mongo.processed(err, res)) {
                         if (cache)
                             return res.status(500).send('Cache with name: "' + cache.name + '" already exist.');
 
-                        (new mongo.Cache(params)).save(function (err, cache) {
+                        (new mongo.Cache(params)).save(function(err, cache) {
                             if (mongo.processed(err, res)) {
                                 cacheId = cache._id;
 
-                                mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
+                                mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
-                                        mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
+                                        mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
                                             if (mongo.processed(err, res))
                                                 res.send(cacheId);
                                         });
@@ -154,8 +154,8 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove cache by ._id.
          */
-        router.post('/remove', function (req, res) {
-            mongo.Cache.remove(req.body, function (err) {
+        router.post('/remove', function(req, res) {
+            mongo.Cache.remove(req.body, function(err) {
                 if (mongo.processed(err, res))
                     res.sendStatus(200);
             })
@@ -164,23 +164,23 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove all caches.
          */
-        router.post('/remove/all', function (req, res) {
+        router.post('/remove/all', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
-                    mongo.Cache.remove({space: {$in: space_ids}}, function (err) {
+                    mongo.Cache.remove({space: {$in: space_ids}}, function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
-                        mongo.Cluster.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function (err) {
+                        mongo.Cluster.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
-                                mongo.DomainModel.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function (err) {
+                                mongo.DomainModel.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.sendStatus(200);
                                 });

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/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 b740c01..a3c2519 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
@@ -22,7 +22,7 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'mongo']
 };
 
-module.exports.factory = function (_, express, mongo) {
+module.exports.factory = function(_, express, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
         
@@ -32,48 +32,48 @@ module.exports.factory = function (_, express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/list', function (req, res) {
+        router.post('/list', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
                     // Get all caches for spaces.
-                    mongo.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec(function (err, caches) {
+                    mongo.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec(function(err, caches) {
                         if (mongo.processed(err, res)) {
                             // Get all IGFSs for spaces.
-                            mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function (err, igfss) {
+                            mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function(err, igfss) {
                                 if (mongo.processed(err, res))
                                 // Get all clusters for spaces.
-                                    mongo.Cluster.find({space: {$in: space_ids}}).sort('name').deepPopulate(mongo.ClusterDefaultPopulate).exec(function (err, clusters) {
+                                    mongo.Cluster.find({space: {$in: space_ids}}).sort('name').deepPopulate(mongo.ClusterDefaultPopulate).exec(function(err, clusters) {
                                         if (mongo.processed(err, res)) {
-                                            _.forEach(caches, function (cache) {
+                                            _.forEach(caches, function(cache) {
                                                 // Remove deleted caches.
-                                                cache.clusters = _.filter(cache.clusters, function (clusterId) {
+                                                cache.clusters = _.filter(cache.clusters, function(clusterId) {
                                                     return _.find(clusters, {_id: clusterId});
                                                 });
                                             });
 
-                                            _.forEach(igfss, function (igfs) {
+                                            _.forEach(igfss, function(igfs) {
                                                 // Remove deleted caches.
-                                                igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
+                                                igfs.clusters = _.filter(igfs.clusters, function(clusterId) {
                                                     return _.find(clusters, {_id: clusterId});
                                                 });
                                             });
 
-                                            _.forEach(clusters, function (cluster) {
+                                            _.forEach(clusters, function(cluster) {
                                                 // Remove deleted caches.
-                                                cluster.caches = _.filter(cluster.caches, function (cacheId) {
+                                                cluster.caches = _.filter(cluster.caches, function(cacheId) {
                                                     return _.find(caches, {_id: cacheId});
                                                 });
 
                                                 // Remove deleted IGFS.
-                                                cluster.igfss = _.filter(cluster.igfss, function (igfsId) {
-                                                    return _.findIndex(igfss, function (igfs) {
+                                                cluster.igfss = _.filter(cluster.igfss, function(igfsId) {
+                                                    return _.findIndex(igfss, function(igfs) {
                                                             return igfs._id.equals(igfsId);
                                                         }) >= 0;
                                                 });
@@ -97,17 +97,17 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Save cluster.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var params = req.body;
             var clusterId = params._id;
             var caches = params.caches;
 
             if (params._id)
-                mongo.Cluster.update({_id: params._id}, params, {upsert: true}, function (err) {
+                mongo.Cluster.update({_id: params._id}, params, {upsert: true}, function(err) {
                     if (mongo.processed(err, res))
-                        mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function (err) {
+                        mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function(err) {
                             if (mongo.processed(err, res)) {
-                                mongo.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}, function (err) {
+                                mongo.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.send(params._id);
                                 });
@@ -115,16 +115,16 @@ module.exports.factory = function (_, express, mongo) {
                         });
                 });
             else {
-                mongo.Cluster.findOne({space: params.space, name: params.name}, function (err, cluster) {
+                mongo.Cluster.findOne({space: params.space, name: params.name}, function(err, cluster) {
                     if (mongo.processed(err, res)) {
                         if (cluster)
                             return res.status(500).send('Cluster with name: "' + cluster.name + '" already exist.');
 
-                        (new mongo.Cluster(params)).save(function (err, cluster) {
+                        (new mongo.Cluster(params)).save(function(err, cluster) {
                             if (mongo.processed(err, res)) {
                                 clusterId = cluster._id;
 
-                                mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function (err) {
+                                mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.send(clusterId);
                                 });
@@ -138,8 +138,8 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove cluster by ._id.
          */
-        router.post('/remove', function (req, res) {
-            mongo.Cluster.remove(req.body, function (err) {
+        router.post('/remove', function(req, res) {
+            mongo.Cluster.remove(req.body, function(err) {
                 if (err)
                     return res.status(500).send(err.message);
 
@@ -150,23 +150,23 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove all clusters.
          */
-        router.post('/remove/all', function (req, res) {
+        router.post('/remove/all', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
-                    mongo.Cluster.remove({space: {$in: space_ids}}, function (err) {
+                    mongo.Cluster.remove({space: {$in: space_ids}}, function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
-                        mongo.Cache.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function (err) {
+                        mongo.Cache.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
-                                mongo.Igfs.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function (err) {
+                                mongo.Igfs.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.sendStatus(200);
                                 });

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/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 5e6e934..7cfb7d1 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
@@ -22,7 +22,7 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'require(async)', 'mongo']
 };
 
-module.exports.factory = function (_, express, async, mongo) {
+module.exports.factory = function(_, express, async, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
 
@@ -32,41 +32,41 @@ module.exports.factory = function (_, express, async, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/list', function (req, res) {
+        router.post('/list', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
                     // Get all clusters for spaces.
-                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function (err, clusters) {
+                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function(err, clusters) {
                         if (mongo.processed(err, res)) {
                             // Get all caches for spaces.
-                            mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err, caches) {
+                            mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function(err, caches) {
                                 if (mongo.processed(err, res)) {
                                     // Get all domain models for spaces.
-                                    mongo.DomainModel.find({space: {$in: space_ids}}).sort('valueType').exec(function (err, domains) {
+                                    mongo.DomainModel.find({space: {$in: space_ids}}).sort('valueType').exec(function(err, domains) {
                                         if (mongo.processed(err, res)) {
-                                            _.forEach(caches, function (cache) {
-                                                cache.domains = _.filter(cache.domains, function (metaId) {
+                                            _.forEach(caches, function(cache) {
+                                                cache.domains = _.filter(cache.domains, function(metaId) {
                                                     return _.find(domains, {_id: metaId});
                                                 });
                                             });
 
                                             // Remove deleted caches.
-                                            _.forEach(domains, function (domain) {
-                                                domain.caches = _.filter(domain.caches, function (cacheId) {
+                                            _.forEach(domains, function(domain) {
+                                                domain.caches = _.filter(domain.caches, function(cacheId) {
                                                     return _.find(caches, {_id: cacheId});
                                                 });
                                             });
 
                                             res.json({
                                                 spaces: spaces,
-                                                clusters: clusters.map(function (cluster) {
+                                                clusters: clusters.map(function(cluster) {
                                                     return {value: cluster._id, label: cluster.name};
                                                 }),
                                                 caches: caches,
@@ -89,15 +89,15 @@ module.exports.factory = function (_, express, async, mongo) {
             var cacheStoreChanges = domain.cacheStoreChanges;
 
             if (domainId)
-                mongo.DomainModel.update({_id: domain._id}, domain, {upsert: true}, function (err) {
+                mongo.DomainModel.update({_id: domain._id}, domain, {upsert: true}, function(err) {
                     if (err)
                         callback(err);
                     else
-                        mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function (err) {
+                        mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function(err) {
                             if (err)
                                 callback(err);
                             else
-                                mongo.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}, function (err) {
+                                mongo.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}, function(err) {
                                     if (err)
                                         callback(err);
                                     else {
@@ -109,19 +109,19 @@ module.exports.factory = function (_, express, async, mongo) {
                         });
                 });
             else
-                mongo.DomainModel.findOne({space: domain.space, valueType: domain.valueType}, function (err, found) {
+                mongo.DomainModel.findOne({space: domain.space, valueType: domain.valueType}, function(err, found) {
                     if (err)
                         callback(err);
                     else if (found)
                         return callback('Domain model with value type: "' + found.valueType + '" already exist.');
 
-                    (new mongo.DomainModel(domain)).save(function (err, domain) {
+                    (new mongo.DomainModel(domain)).save(function(err, domain) {
                         if (err)
                             callback(err);
                         else {
                             domainId = domain._id;
 
-                            mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function (err) {
+                            mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function(err) {
                                 if (err)
                                     callback(err);
                                 else {
@@ -137,8 +137,8 @@ module.exports.factory = function (_, express, async, mongo) {
 
         function _updateCacheStore(cacheStoreChanges, callback) {
             if (cacheStoreChanges && cacheStoreChanges.length > 0) {
-                async.forEachOf(cacheStoreChanges, function (change, idx, callback) {
-                    mongo.Cache.update({_id: {$eq: change.cacheId}}, change.change, {}, function (err) {
+                async.forEachOf(cacheStoreChanges, function(change, idx, callback) {
+                    mongo.Cache.update({_id: {$eq: change.cacheId}}, change.change, {}, function(err) {
                         if (err)
                             callback(err);
                         else
@@ -155,9 +155,9 @@ module.exports.factory = function (_, express, async, mongo) {
             var generatedCaches = [];
 
             if (domains && domains.length > 0)
-                async.forEachOf(domains, function (domain, idx, callback) {
+                async.forEachOf(domains, function(domain, idx, callback) {
                     if (domain.newCache) {
-                        mongo.Cache.findOne({space: domain.space, name: domain.newCache.name}, function (err, cache) {
+                        mongo.Cache.findOne({space: domain.space, name: domain.newCache.name}, function(err, cache) {
                             if (mongo.processed(err, res))
                                 if (cache) {
                                     // Cache already exists, just save domain model.
@@ -170,11 +170,11 @@ module.exports.factory = function (_, express, async, mongo) {
                                     var newCache = domain.newCache;
                                     newCache.space = domain.space;
 
-                                    (new mongo.Cache(newCache)).save(function (err, cache) {
+                                    (new mongo.Cache(newCache)).save(function(err, cache) {
                                         var cacheId = cache._id;
 
                                         if (mongo.processed(err, res)) {
-                                            mongo.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
+                                            mongo.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
                                                 if (mongo.processed(err, res)) {
                                                     domain.caches = [cacheId];
                                                     generatedCaches.push(cache);
@@ -189,7 +189,7 @@ module.exports.factory = function (_, express, async, mongo) {
                     }
                     else
                         _saveDomainModel(domain, savedDomains, callback);
-                }, function (err) {
+                }, function(err) {
                     if (err)
                         res.status(500).send(err.message);
                     else
@@ -202,22 +202,22 @@ module.exports.factory = function (_, express, async, mongo) {
         /**
          * Save domain model.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             _save([req.body], res);
         });
 
         /**
          * Batch save domain models.
          */
-        router.post('/save/batch', function (req, res) {
+        router.post('/save/batch', function(req, res) {
             _save(req.body, res);
         });
 
         /**
          * Remove domain model by ._id.
          */
-        router.post('/remove', function (req, res) {
-            mongo.DomainModel.remove(req.body, function (err) {
+        router.post('/remove', function(req, res) {
+            mongo.DomainModel.remove(req.body, function(err) {
                 if (mongo.processed(err, res))
                     res.sendStatus(200);
             })
@@ -226,21 +226,21 @@ module.exports.factory = function (_, express, async, mongo) {
         /**
          * Remove all domain models.
          */
-        router.post('/remove/all', function (req, res) {
+        router.post('/remove/all', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
-                    mongo.DomainModel.remove({space: {$in: space_ids}}, function (err) {
+                    mongo.DomainModel.remove({space: {$in: space_ids}}, function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
-                        mongo.Cache.update({space: {$in: space_ids}}, {domains: []}, {multi: true}, function (err) {
+                        mongo.Cache.update({space: {$in: space_ids}}, {domains: []}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
                                 res.sendStatus(200);
                         });
@@ -252,23 +252,23 @@ module.exports.factory = function (_, express, async, mongo) {
         /**
          * Remove all generated demo domain models and caches.
          */
-        router.post('/remove/demo', function (req, res) {
+        router.post('/remove/demo', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
                     // Remove all demo domain models.
-                    mongo.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function (err) {
+                    mongo.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
                         // Remove all demo caches.
-                        mongo.Cache.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function (err) {
+                        mongo.Cache.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function(err) {
                             if (err)
                                 return res.status(500).send(err.message);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/igfs.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/igfs.js b/modules/control-center-web/src/main/js/serve/routes/igfs.js
index cf312f5..f248531 100644
--- a/modules/control-center-web/src/main/js/serve/routes/igfs.js
+++ b/modules/control-center-web/src/main/js/serve/routes/igfs.js
@@ -22,7 +22,7 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'mongo']
 };
 
-module.exports.factory = function (_, express, mongo) {
+module.exports.factory = function(_, express, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
 
@@ -32,26 +32,26 @@ module.exports.factory = function (_, express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/list', function (req, res) {
+        router.post('/list', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
                     // Get all clusters for spaces.
-                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function (err, clusters) {
+                    mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function(err, clusters) {
                         if (mongo.processed(err, res)) {
                             // Get all IGFSs for spaces.
-                            mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function (err, igfss) {
+                            mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function(err, igfss) {
                                 if (mongo.processed(err, res)) {
-                                    _.forEach(igfss, function (igfs) {
+                                    _.forEach(igfss, function(igfs) {
                                         // Remove deleted clusters.
-                                        igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
-                                            return _.findIndex(clusters, function (cluster) {
+                                        igfs.clusters = _.filter(igfs.clusters, function(clusterId) {
+                                            return _.findIndex(clusters, function(cluster) {
                                                     return cluster._id.equals(clusterId);
                                                 }) >= 0;
                                         });
@@ -59,7 +59,7 @@ module.exports.factory = function (_, express, mongo) {
 
                                     res.json({
                                         spaces: spaces,
-                                        clusters: clusters.map(function (cluster) {
+                                        clusters: clusters.map(function(cluster) {
                                             return {value: cluster._id, label: cluster.name};
                                         }),
                                         igfss: igfss
@@ -75,17 +75,17 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Save IGFS.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var params = req.body;
             var igfsId = params._id;
             var clusters = params.clusters;
 
             if (params._id) {
-                mongo.Igfs.update({_id: igfsId}, params, {upsert: true}, function (err) {
+                mongo.Igfs.update({_id: igfsId}, params, {upsert: true}, function(err) {
                     if (mongo.processed(err, res))
-                        mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function (err) {
+                        mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
-                                mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}, function (err) {
+                                mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.send(params._id);
                                 });
@@ -93,16 +93,16 @@ module.exports.factory = function (_, express, mongo) {
                 })
             }
             else
-                mongo.Igfs.findOne({space: params.space, name: params.name}, function (err, igfs) {
+                mongo.Igfs.findOne({space: params.space, name: params.name}, function(err, igfs) {
                     if (mongo.processed(err, res)) {
                         if (igfs)
                             return res.status(500).send('IGFS with name: "' + igfs.name + '" already exist.');
 
-                        (new mongo.Igfs(params)).save(function (err, igfs) {
+                        (new mongo.Igfs(params)).save(function(err, igfs) {
                             if (mongo.processed(err, res)) {
                                 igfsId = igfs._id;
 
-                                mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function (err) {
+                                mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function(err) {
                                     if (mongo.processed(err, res))
                                         res.send(igfsId);
                                 });
@@ -115,8 +115,8 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove IGFS by ._id.
          */
-        router.post('/remove', function (req, res) {
-            mongo.Igfs.remove(req.body, function (err) {
+        router.post('/remove', function(req, res) {
+            mongo.Igfs.remove(req.body, function(err) {
                 if (mongo.processed(err, res))
                     res.sendStatus(200);
             })
@@ -125,21 +125,21 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Remove all IGFSs.
          */
-        router.post('/remove/all', function (req, res) {
+        router.post('/remove/all', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (mongo.processed(err, res)) {
-                    var space_ids = spaces.map(function (value) {
+                    var space_ids = spaces.map(function(value) {
                         return value._id;
                     });
 
-                    mongo.Igfs.remove({space: {$in: space_ids}}, function (err) {
+                    mongo.Igfs.remove({space: {$in: space_ids}}, function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
-                        mongo.Cluster.update({space: {$in: space_ids}}, {igfss: []}, {multi: true}, function (err) {
+                        mongo.Cluster.update({space: {$in: space_ids}}, {igfss: []}, {multi: true}, function(err) {
                             if (mongo.processed(err, res))
                                 res.sendStatus(200);
                         });

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/notebooks.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/notebooks.js b/modules/control-center-web/src/main/js/serve/routes/notebooks.js
index af272fd..e700921 100644
--- a/modules/control-center-web/src/main/js/serve/routes/notebooks.js
+++ b/modules/control-center-web/src/main/js/serve/routes/notebooks.js
@@ -22,7 +22,7 @@ module.exports = {
     inject: ['require(express)', 'mongo']
 };
 
-module.exports.factory = function (express, mongo) {
+module.exports.factory = function(express, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
 
@@ -32,20 +32,20 @@ module.exports.factory = function (express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/list', function (req, res) {
+        router.post('/list', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (err)
                     return res.status(500).send(err.message);
 
-                var space_ids = spaces.map(function (value) {
+                var space_ids = spaces.map(function(value) {
                     return value._id;
                 });
 
                 // Get all metadata for spaces.
-                mongo.Notebook.find({space: {$in: space_ids}}).select('_id name').sort('name').exec(function (err, notebooks) {
+                mongo.Notebook.find({space: {$in: space_ids}}).select('_id name').sort('name').exec(function(err, notebooks) {
                     if (err)
                         return res.status(500).send(err.message);
 
@@ -60,20 +60,20 @@ module.exports.factory = function (express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/get', function (req, res) {
+        router.post('/get', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
+            mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(err, spaces) {
                 if (err)
                     return res.status(500).send(err.message);
 
-                var space_ids = spaces.map(function (value) {
+                var space_ids = spaces.map(function(value) {
                     return value._id;
                 });
 
                 // Get all metadata for spaces.
-                mongo.Notebook.findOne({space: {$in: space_ids}, _id: req.body.noteId}).exec(function (err, notebook) {
+                mongo.Notebook.findOne({space: {$in: space_ids}, _id: req.body.noteId}).exec(function(err, notebook) {
                     if (err)
                         return res.status(500).send(err.message);
 
@@ -88,26 +88,26 @@ module.exports.factory = function (express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var note = req.body;
             var noteId = note._id;
 
             if (noteId)
-                mongo.Notebook.update({_id: noteId}, note, {upsert: true}, function (err) {
+                mongo.Notebook.update({_id: noteId}, note, {upsert: true}, function(err) {
                     if (err)
                         return res.status(500).send(err.message);
 
                     res.send(noteId);
                 });
             else
-                mongo.Notebook.findOne({space: note.space, name: note.name}, function (err, note) {
+                mongo.Notebook.findOne({space: note.space, name: note.name}, function(err, note) {
                     if (err)
                         return res.status(500).send(err.message);
 
                     if (note)
                         return res.status(500).send('Notebook with name: "' + note.name + '" already exist.');
 
-                    (new mongo.Notebook(req.body)).save(function (err, note) {
+                    (new mongo.Notebook(req.body)).save(function(err, note) {
                         if (err)
                             return res.status(500).send(err.message);
 
@@ -122,8 +122,8 @@ module.exports.factory = function (express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/remove', function (req, res) {
-            mongo.Notebook.remove(req.body, function (err) {
+        router.post('/remove', function(req, res) {
+            mongo.Notebook.remove(req.body, function(err) {
                 if (err)
                     return res.status(500).send(err.message);
 
@@ -137,15 +137,15 @@ module.exports.factory = function (express, mongo) {
          * @param req Request.
          * @param res Response.
          */
-        router.post('/new', function (req, res) {
+        router.post('/new', function(req, res) {
             var user_id = req.currentUserId();
 
             // Get owned space and all accessed space.
-            mongo.Space.findOne({owner: user_id}, function (err, space) {
+            mongo.Space.findOne({owner: user_id}, function(err, space) {
                 if (err)
                     return res.status(500).send(err.message);
 
-                (new mongo.Notebook({space: space.id, name: req.body.name})).save(function (err, note) {
+                (new mongo.Notebook({space: space.id, name: req.body.name})).save(function(err, note) {
                     if (err)
                         return res.status(500).send(err.message);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/profile.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/profile.js b/modules/control-center-web/src/main/js/serve/routes/profile.js
index 06db42a..2f63f12 100644
--- a/modules/control-center-web/src/main/js/serve/routes/profile.js
+++ b/modules/control-center-web/src/main/js/serve/routes/profile.js
@@ -22,12 +22,12 @@ module.exports = {
     inject: ['require(lodash)', 'require(express)', 'mongo']
 };
 
-module.exports.factory = function (_, express, mongo) {
+module.exports.factory = function(_, express, mongo) {
     return new Promise((resolve) => {
         const router = express.Router();
 
         function _updateUser(res, params) {
-            mongo.Account.update({_id: params._id}, params, {upsert: true}, function (err, user) {
+            mongo.Account.update({_id: params._id}, params, {upsert: true}, function(err, user) {
                 // TODO IGNITE-843 Send error to admin.
                 if (err)
                     return res.status(500).send('Failed to update profile!');
@@ -40,13 +40,13 @@ module.exports.factory = function (_, express, mongo) {
         }
 
         function _checkEmail(res, user, params) {
-            if (params.email && user.email != params.email) {
-                mongo.Account.findOne({email: params.email}, function (err, userForEmail) {
+            if (params.email && user.email !== params.email) {
+                mongo.Account.findOne({email: params.email}, function(err, userForEmail) {
                     // TODO send error to admin
                     if (err)
                         return res.status(500).send('Failed to check e-mail!');
 
-                    if (userForEmail && userForEmail._id != user._id)
+                    if (userForEmail && userForEmail._id !== user._id)
                         return res.status(500).send('User with this e-mail already registered!');
 
                     _updateUser(res, params);
@@ -59,10 +59,10 @@ module.exports.factory = function (_, express, mongo) {
         /**
          * Save user profile.
          */
-        router.post('/save', function (req, res) {
+        router.post('/save', function(req, res) {
             var params = req.body;
 
-            mongo.Account.findById(params._id, function (err, user) {
+            mongo.Account.findById(params._id, function(err, user) {
                 // TODO IGNITE-843 Send error to admin
                 if (err)
                     return res.status(500).send('Failed to find user!');
@@ -71,13 +71,13 @@ module.exports.factory = function (_, express, mongo) {
                     if (_.isEmpty(params.password))
                         return res.status(500).send('Wrong value for new password!');
 
-                    user.setPassword(params.password, function (err, user) {
+                    user.setPassword(params.password, function(err, user) {
                         if (err)
                             return res.status(500).send(err.message);
 
-                        user.save(function (err) {
+                        user.save(function(err) {
                             if (err)
-                                return res.status(500).send("Failed to change password!");
+                                return res.status(500).send('Failed to change password!');
 
                             _checkEmail(res, user, params);
                         });

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/routes/public.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/public.js b/modules/control-center-web/src/main/js/serve/routes/public.js
index 5d53639..1c78abd 100644
--- a/modules/control-center-web/src/main/js/serve/routes/public.js
+++ b/modules/control-center-web/src/main/js/serve/routes/public.js
@@ -24,8 +24,8 @@ module.exports = {
     inject: ['require(express)', 'require(passport)', 'require(nodemailer)', 'settings', 'mongo']
 };
 
-module.exports.factory = function (express, passport, nodemailer, settings, mongo) {
-    return new Promise(function (resolve) {
+module.exports.factory = function(express, passport, nodemailer, settings, mongo) {
+    return new Promise(function(resolve) {
         const router = express.Router();
 
         const _randomString = () => {
@@ -41,7 +41,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         };
 
         // GET user.
-        router.post('/user', function (req, res) {
+        router.post('/user', function(req, res) {
             var becomeUsed = req.session.viewedUser && req.user.admin;
 
             var user = req.user;
@@ -58,18 +58,18 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         /**
          * Register new account.
          */
-        router.post('/register', function (req, res) {
-            mongo.Account.count(function (err, cnt) {
+        router.post('/register', function(req, res) {
+            mongo.Account.count(function(err, cnt) {
                 if (err)
                     return res.status(401).send(err.message);
 
-                req.body.admin = cnt == 0;
+                req.body.admin = cnt === 0;
 
                 var account = new mongo.Account(req.body);
 
                 account.token = _randomString();
 
-                mongo.Account.register(account, req.body.password, function (err, account) {
+                mongo.Account.register(account, req.body.password, function(err, account) {
                     if (err)
                         return res.status(401).send(err.message);
 
@@ -78,7 +78,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
 
                     new mongo.Space({name: 'Personal space', owner: account._id}).save();
 
-                    req.logIn(account, {}, function (err) {
+                    req.logIn(account, {}, function(err) {
                         if (err)
                             return res.status(401).send(err.message);
 
@@ -91,15 +91,15 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         /**
          * Login in exist account.
          */
-        router.post('/login', function (req, res, next) {
-            passport.authenticate('local', function (err, user) {
+        router.post('/login', function(req, res, next) {
+            passport.authenticate('local', function(err, user) {
                 if (err)
                     return res.status(401).send(err.message);
 
                 if (!user)
                     return res.status(401).send('Invalid email or password');
 
-                req.logIn(user, {}, function (err) {
+                req.logIn(user, {}, function(err) {
                     if (err)
                         return res.status(401).send(err.message);
 
@@ -111,7 +111,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         /**
          * Logout.
          */
-        router.post('/logout', function (req, res) {
+        router.post('/logout', function(req, res) {
             req.logout();
 
             res.sendStatus(200);
@@ -120,7 +120,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         /**
          * Send e-mail to user with reset token.
          */
-        router.post('/password/forgot', function (req, res) {
+        router.post('/password/forgot', function(req, res) {
             var transporter = {
                 service: settings.smtp.service,
                 auth: {
@@ -129,12 +129,12 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
                 }
             };
 
-            if (transporter.service == '' || transporter.auth.user == '' || transporter.auth.pass == '')
+            if (transporter.service === '' || transporter.auth.user === '' || transporter.auth.pass === '')
                 return res.status(401).send('Can\'t send e-mail with instructions to reset password. Please ask webmaster to setup SMTP server!');
 
             var token = _randomString();
 
-            mongo.Account.findOne({email: req.body.email}, function (err, user) {
+            mongo.Account.findOne({email: req.body.email}, function(err, user) {
                 if (!user)
                     return res.status(401).send('No account with that email address exists!');
 
@@ -144,7 +144,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
 
                 user.resetPasswordToken = token;
 
-                user.save(function (err) {
+                user.save(function(err) {
                     // TODO IGNITE-843 Send email to admin
                     if (err)
                         return res.status(401).send('Failed to reset password!');
@@ -163,7 +163,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
                         settings.smtp.username + '\n'
                     };
 
-                    mailer.sendMail(mailOptions, function (err) {
+                    mailer.sendMail(mailOptions, function(err) {
                         if (err)
                             return res.status(401).send('Failed to send e-mail with reset link! ' + err);
 
@@ -176,8 +176,8 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         /**
          * Change password with given token.
          */
-        router.post('/password/reset', function (req, res) {
-            mongo.Account.findOne({resetPasswordToken: req.body.token}, function (err, user) {
+        router.post('/password/reset', function(req, res) {
+            mongo.Account.findOne({resetPasswordToken: req.body.token}, function(err, user) {
                 if (!user)
                     return res.status(500).send('Invalid token for password reset!');
 
@@ -185,13 +185,13 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
                 if (err)
                     return res.status(500).send('Failed to reset password!');
 
-                user.setPassword(req.body.password, function (err, updatedUser) {
+                user.setPassword(req.body.password, function(err, updatedUser) {
                     if (err)
                         return res.status(500).send(err.message);
 
                     updatedUser.resetPasswordToken = undefined;
 
-                    updatedUser.save(function (err) {
+                    updatedUser.save(function(err) {
                         if (err)
                             return res.status(500).send(err.message);
 
@@ -216,7 +216,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
                             'Apache Ignite Web Console\n'
                         };
 
-                        mailer.sendMail(mailOptions, function (err) {
+                        mailer.sendMail(mailOptions, function(err) {
                             if (err)
                                 return res.status(503).send('Password was changed, but failed to send confirmation e-mail!<br />' + err);
 
@@ -228,12 +228,12 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
         });
 
         /* GET reset password page. */
-        router.post('/validate/token', function (req, res) {
+        router.post('/validate/token', function(req, res) {
             var token = req.body.token;
 
             var data = {token: token};
 
-            mongo.Account.findOne({resetPasswordToken: token}, function (err, user) {
+            mongo.Account.findOne({resetPasswordToken: token}, function(err, user) {
                 if (!user)
                     data.error = 'Invalid token for password reset!';
                 else if (err)

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a7ac460/modules/control-center-web/src/main/js/serve/settings.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/settings.js b/modules/control-center-web/src/main/js/serve/settings.js
index b85b683..6e4b619 100644
--- a/modules/control-center-web/src/main/js/serve/settings.js
+++ b/modules/control-center-web/src/main/js/serve/settings.js
@@ -22,13 +22,13 @@ module.exports = {
     inject: ['require(nconf)', 'require(fs)']
 };
 
-module.exports.factory = function (nconf, fs) {
+module.exports.factory = function(nconf, fs) {
     nconf.file({'file': './serve/config/default.json'});
 
     /**
      * Normalize a port into a number, string, or false.
      */
-    const _normalizePort = function (val) {
+    const _normalizePort = function(val) {
         var port = parseInt(val, 10);
 
         // named pipe


Mime
View raw message