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/12 10:54:27 UTC
[01/29] ignite git commit: IGNITE-843 Fixed typo.
Repository: ignite
Updated Branches:
refs/heads/ignite-843-rc3 84207e6a2 -> bef0640a6
IGNITE-843 Fixed typo.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/07b4b853
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/07b4b853
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/07b4b853
Branch: refs/heads/ignite-843-rc3
Commit: 07b4b853560623b99abf56f3c5c0752bdb536886
Parents: 84207e6
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Feb 12 07:58:24 2016 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Feb 12 07:58:24 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/views/login.jade | 4 ++--
.../control-center-web/src/main/js/views/settings/profile.jade | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/07b4b853/modules/control-center-web/src/main/js/views/login.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/login.jade b/modules/control-center-web/src/main/js/views/login.jade
index 96e24ad..4908002 100644
--- a/modules/control-center-web/src/main/js/views/login.jade
+++ b/modules/control-center-web/src/main/js/views/login.jade
@@ -54,11 +54,11 @@ header#header.header
.settings-row(ng-show='action == "register"')
+lbl('Company:')
.col-xs-9.col-md-8
- input#company.form-control(enter-focus-next='country' type='text' ng-model='user_info.company' placeholder='You company name')
+ input#company.form-control(enter-focus-next='country' type='text' ng-model='user_info.company' placeholder='Your company name')
.settings-row(ng-show='action == "register"')
+lbl('Country:')
.col-xs-9.col-md-8
- button#country.select-toggle.form-control(bs-select bs-options='item for item in countries' enter-focus-next='user_password' type='text' ng-model='user_info.country' placeholder='Choose you country')
+ button#country.select-toggle.form-control(bs-select bs-options='item for item in countries' enter-focus-next='user_password' type='text' ng-model='user_info.country' placeholder='Choose your country')
.settings-row(ng-show='action != "password/forgot"')
+lblRequired('Password:')
.col-xs-9.col-md-8
http://git-wip-us.apache.org/repos/asf/ignite/blob/07b4b853/modules/control-center-web/src/main/js/views/settings/profile.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/settings/profile.jade b/modules/control-center-web/src/main/js/views/settings/profile.jade
index 9de1fa8..95c2a3e 100644
--- a/modules/control-center-web/src/main/js/views/settings/profile.jade
+++ b/modules/control-center-web/src/main/js/views/settings/profile.jade
@@ -36,11 +36,11 @@ mixin lbl(txt)
.details-row
label.col-sm-2.labelFormField Company:
.col-xs-5.col-sm-4
- input#profile-company.form-control(type='text' ng-model='user.company' placeholder='You company name')
+ input#profile-company.form-control(type='text' ng-model='user.company' placeholder='Your company name')
.details-row
label.col-sm-2.labelFormField Country:
.col-xs-5.col-sm-4
- button#profile-country.select-toggle.form-control(bs-select bs-options='item for item in countries' type='text' ng-model='user.country' placeholder='Choose you country')
+ button#profile-country.select-toggle.form-control(bs-select bs-options='item for item in countries' type='text' ng-model='user.country' placeholder='Choose your country')
.details-row
.advanced-options
i.fa(
[22/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/0ee811ce
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0ee811ce
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0ee811ce
Branch: refs/heads/ignite-843-rc3
Commit: 0ee811ce0ad6a32a9667076f312d67f83739ba91
Parents: 33061ca
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 16:22:09 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:22:09 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/clusters.js | 2 ++
modules/control-center-web/src/main/js/serve/routes/domains.js | 2 ++
2 files changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee811ce/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 0ca2fed..3115328 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee811ce/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 c2417a1..1e87b0f 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
[06/29] ignite git commit: IGNITE-843 Fixed buttons visibility in
case of filtration.
Posted by ak...@apache.org.
IGNITE-843 Fixed buttons visibility in case of filtration.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0569a4b0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0569a4b0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0569a4b0
Branch: refs/heads/ignite-843-rc3
Commit: 0569a4b0b3616908aeb55257c33122b92dd75606
Parents: 5d0fbe5
Author: vsisko <vs...@gridgain.com>
Authored: Fri Feb 12 09:46:56 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 09:46:56 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/clusters-controller.js | 6 ++++++
.../src/main/js/views/configuration/clusters.jade | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0569a4b0/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 41df7ab..7681a6e 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
@@ -46,6 +46,12 @@ consoleModule.controller('clustersController', function ($http, $timeout, $scope
$scope.widthIsSufficient = $common.widthIsSufficient;
$scope.saveBtnTipText = $common.saveBtnTipText;
+ $scope.contentVisible = function () {
+ var item = $scope.backupItem;
+
+ return item && (!item._id || _.find($scope.displayedRows, {_id: item._id}));
+ };
+
$scope.trustManagersConfigured = function() {
return $scope.backupItem.sslEnabled && $common.isDefined($scope.backupItem.sslContextFactory) &&
!$common.isEmptyArray($scope.backupItem.sslContextFactory.trustManagers);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0569a4b0/modules/control-center-web/src/main/js/views/configuration/clusters.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/clusters.jade b/modules/control-center-web/src/main/js/views/configuration/clusters.jade
index 3c3db82..da32e0d 100644
--- a/modules/control-center-web/src/main/js/views/configuration/clusters.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/clusters.jade
@@ -34,7 +34,7 @@ include ../includes/infos
-var cloneTip = '"Clone current ' + objectName + '"'
-var undoTip = '"Undo all changes for current ' + objectName + '"'
- div(ng-show='backupItem' style='display: inline-block;')
+ div(ng-show='contentVisible()' style='display: inline-block;')
.panel-tip-container(ng-hide='!backupItem || backupItem._id')
a.btn.btn-primary(ng-disabled='!ui.inputForm.$dirty' ng-click='ui.inputForm.$dirty && saveItem()' bs-tooltip='' data-title='{{saveBtnTipText(ui.inputForm.$dirty, "#{objectName}")}}' data-placement='bottom' data-trigger='hover') Save
.panel-tip-container(ng-show='backupItem._id')
@@ -50,7 +50,7 @@ include ../includes/infos
hr
.bs-affix-fix
div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels')
- form.form-horizontal(name='ui.inputForm' ng-show='backupItem && (!backupItem._id || _.find(displayedRows, {_id: backupItem._id}))' novalidate)
+ form.form-horizontal(name='ui.inputForm' ng-show='contentVisible()' novalidate)
.panel-group(ng-click='triggerDigest = true')
ignite-configuration-clusters-general
.advanced-options
[17/29] ignite git commit: IGNITE-843 Revert wrong changes.
Posted by ak...@apache.org.
IGNITE-843 Revert wrong changes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9a528f34
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9a528f34
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9a528f34
Branch: refs/heads/ignite-843-rc3
Commit: 9a528f34ecb7a288c07f0655edcddb6b257e5c23
Parents: f3a0a5e
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 14:26:30 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 14:26:30 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/domains-controller.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9a528f34/modules/control-center-web/src/main/js/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/domains-controller.js b/modules/control-center-web/src/main/js/controllers/domains-controller.js
index c04e4d5..03ebd97 100644
--- a/modules/control-center-web/src/main/js/controllers/domains-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/domains-controller.js
@@ -616,7 +616,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
preset.schemas = [];
- _.forEach($scope.importDomain.displayedSchemas, function (schema) {
+ _.forEach($scope.importDomain.schemas, function (schema) {
if (schema.use)
preset.schemas.push(schema.name);
});
@@ -807,7 +807,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
};
}
- _.forEach($scope.importDomain.displayedTables, function (table) {
+ _.forEach($scope.importDomain.tables, function (table) {
if (table.use) {
var qryFields = [];
var indexes = [];
@@ -1054,12 +1054,12 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
switch ($scope.importDomain.action) {
case 'schemas':
res = $common.isEmptyArray($scope.importDomain.schemas) ||
- _.find($scope.importDomain.displayedSchemas, {use: true});
+ _.find($scope.importDomain.schemas, {use: true});
break;
case 'tables':
- res = _.find($scope.importDomain.displayedTables, {use: true});
+ res = _.find($scope.importDomain.tables, {use: true});
break;
}
[29/29] ignite git commit: IGNITE-843 Minor ES6 style fixes.
Posted by ak...@apache.org.
IGNITE-843 Minor ES6 style fixes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bef0640a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bef0640a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bef0640a
Branch: refs/heads/ignite-843-rc3
Commit: bef0640a6d04f7c99fcf3d66e66eac8803988c33
Parents: 9e4a30c
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 16:52:51 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:52:51 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/caches.js | 4 +---
modules/control-center-web/src/main/js/serve/routes/igfs.js | 7 +------
.../src/main/js/views/configuration/domains-import.jade | 1 -
3 files changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bef0640a/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 be29633..074758c 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
@@ -176,9 +176,7 @@ module.exports.factory = function(_, express, mongo) {
// Get owned space and all accessed space.
mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
if (mongo.processed(errSpace, res)) {
- const space_ids = spaces.map((value) => {
- return value._id;
- });
+ const space_ids = spaces.map((value) => value._id);
mongo.Cache.remove({space: {$in: space_ids}}, (errCache) => {
if (errCache)
http://git-wip-us.apache.org/repos/asf/ignite/blob/bef0640a/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 f913b9b..76dde1f 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
@@ -57,12 +57,7 @@ module.exports.factory = function(_, express, mongo) {
res.json({
spaces,
- clusters: clusters.map((cluster) => {
- return {
- value: cluster._id,
- label: cluster.name
- };
- }),
+ clusters: clusters.map((cluster) => ({value: cluster._id, label: cluster.name})),
igfss
});
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bef0640a/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/domains-import.jade b/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
index 759eb9e..1bbfab9 100644
--- a/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
@@ -146,7 +146,6 @@ mixin td-ellipses-lbl(w, lbl)
div(style='display: flex' ng-if='table.edit')
button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' data-container='.modal-domain-import' bs-options='item.value as item.shortLabel for item in importActions')
button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in table.cachesOrTemplates')
- //- button.select-toggle.form-control(ng-if='table.action==2' style='width: 65%; margin-right: 0' bs-select ng-model='table.cache' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importCurrentCaches')
td
.settings-row
label Defaults to be applied for filtered tables
[08/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/eced3207
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eced3207
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eced3207
Branch: refs/heads/ignite-843-rc3
Commit: eced3207296a4e8e81cec27c19e6081e16cc3f8a
Parents: 11c6e0a
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 10:12:17 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 10:12:17 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/app/index.js | 2 +-
.../src/main/js/serve/agent.js | 129 +++++++++----------
2 files changed, 62 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/eced3207/modules/control-center-web/src/main/js/app/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/index.js b/modules/control-center-web/src/main/js/app/index.js
index 07ff05c..6e1b172 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -56,7 +56,7 @@ import 'angular-ui-grid/ui-grid.css!';
import 'angular-loading/angular-loading.css!';
import 'angular-motion/dist/angular-motion.css!';
-//import './decorator/select';
+// import './decorator/select';
import './modules/form/form.module';
import './modules/JavaTypes/JavaTypes.provider';
http://git-wip-us.apache.org/repos/asf/ignite/blob/eced3207/modules/control-center-web/src/main/js/serve/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/agent.js b/modules/control-center-web/src/main/js/serve/agent.js
index 36d6324..89497e7 100644
--- a/modules/control-center-web/src/main/js/serve/agent.js
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -22,7 +22,7 @@ module.exports = {
inject: ['require(fs)', 'require(ws)', 'require(apache-ignite)', 'mongo']
};
-module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
+module.exports.factory = function(fs, ws, apacheIgnite, mongo) {
/**
* @constructor
*/
@@ -33,7 +33,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
/**
*
*/
- AgentManager.prototype.listen = function (srv) {
+ AgentManager.prototype.listen = function(srv) {
if (this._server)
throw 'Agent server already started!';
@@ -41,27 +41,25 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
this._wss = new ws.Server({server: this._server});
- var self = this;
+ const self = this;
- this._wss.on('connection', function (ws) {
- new Client(ws, self);
- });
+ this._wss.on('connection', (_ws) => new Client(_ws, self));
};
/**
* @param userId
* @param {Client} client
*/
- AgentManager.prototype._removeClient = function (userId, client) {
- var connections = this._clients[userId];
+ AgentManager.prototype._removeClient = function(userId, client) {
+ const connections = this._clients[userId];
if (connections) {
- var idx;
+ let idx;
while ((idx = connections.indexOf(client)) !== -1)
connections.splice(idx, 1);
- if (connections.length == 0)
+ if (connections.length === 0)
delete this._clients[userId];
}
};
@@ -70,8 +68,8 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param userId
* @param {Client} client
*/
- AgentManager.prototype._addClient = function (userId, client) {
- var existingConnections = this._clients[userId];
+ AgentManager.prototype._addClient = function(userId, client) {
+ let existingConnections = this._clients[userId];
if (!existingConnections) {
existingConnections = [];
@@ -86,10 +84,10 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param userId
* @returns {Client}
*/
- AgentManager.prototype.findClient = function (userId) {
+ AgentManager.prototype.findClient = function(userId) {
const clientsList = this._clients[userId];
- if (!clientsList || clientsList.length == 0)
+ if (!clientsList || clientsList.length === 0)
return null;
return clientsList[0];
@@ -112,30 +110,30 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* Run http request
*
* @this {AgentServer}
- * @param {Command} cmd Command
+ * @param {cmd} cmd Command
* @param {callback} callback on finish
*/
- AgentServer.prototype.runCommand = function (cmd, callback) {
- var params = {cmd: cmd.name()};
+ AgentServer.prototype.runCommand = function(cmd, callback) {
+ const params = { cmd: cmd.name() };
for (var param of cmd._params)
params[param.key] = param.value;
- var body = undefined;
+ let body;
- var headers = undefined;
+ let headers;
- var method = 'GET';
+ let method = 'GET';
if (cmd._isPost()) {
body = cmd.postData();
method = 'POST';
- headers = {'JSONObject': 'application/json'};
+ headers = {JSONObject: 'application/json'};
}
- this._client.executeRest("ignite", params, this._demo, method, headers, body, callback);
+ this._client.executeRest('ignite', params, this._demo, method, headers, body, callback);
};
/**
@@ -144,19 +142,18 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param {WebSocket} ws
*/
function Client(ws, manager) {
- var self = this;
+ const self = this;
this._manager = manager;
this._ws = ws;
- ws.on('close', function () {
- if (self._user) {
+ ws.on('close', function() {
+ if (self._user)
self._manager._removeClient(self._user._id, self);
- }
});
- ws.on('message', function (msgStr) {
- var msg = JSON.parse(msgStr);
+ ws.on('message', function(msgStr) {
+ const msg = JSON.parse(msgStr);
self['_rmt' + msg.type](msg);
});
@@ -166,12 +163,12 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
this._cbMap = {};
}
- Client.prototype._runCommand = function (method, args) {
- var self = this;
+ Client.prototype._runCommand = function(method, args) {
+ const self = this;
- return new Promise(function (resolve, reject) {
- self._invokeRmtMethod(method, args, function (error, res) {
- if (error != null)
+ return new Promise(function(resolve, reject) {
+ self._invokeRmtMethod(method, args, function(error, res) {
+ if (error !== null)
return reject(error);
resolve(res);
@@ -188,17 +185,17 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param {String} [body]
* @param {callback} [callback] Callback. Take 3 arguments: {Number} successStatus, {String} error, {String} response.
*/
- Client.prototype.executeRest = function (uri, params, demo, method, headers, body, callback) {
- if (typeof(params) != 'object')
+ Client.prototype.executeRest = function(uri, params, demo, method, headers, body, callback) {
+ if (typeof (params) !== 'object')
throw '"params" argument must be an object';
- if (typeof(callback) != 'function')
+ if (typeof (callback) !== 'function')
throw 'callback must be a function';
- if (body && typeof(body) != 'string')
+ if (body && typeof (body) !== 'string')
throw 'body must be a string';
- if (headers && typeof(headers) != 'object')
+ if (headers && typeof (headers) !== 'object')
throw 'headers must be an object';
if (!method)
@@ -206,10 +203,10 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
else
method = method.toUpperCase();
- if (method != 'GET' && method != 'POST')
+ if (method !== 'GET' && method !== 'POST')
throw 'Unknown HTTP method: ' + method;
- const cb = function (error, restResult) {
+ const cb = function(error, restResult) {
if (error)
return callback(error);
@@ -222,16 +219,16 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
if (restCode !== 200) {
if (restCode === 401)
- return callback.call({code: restCode, message: "Failed to authenticate on node."});
+ return callback.call({code: restCode, message: 'Failed to authenticate on node.'});
return callback.call({
code: restCode,
- message: restError || "Failed connect to node and execute REST command."
+ message: restError || 'Failed connect to node and execute REST command.'
});
}
try {
- var nodeResponse = JSON.parse(restResult.response);
+ const nodeResponse = JSON.parse(restResult.response);
if (nodeResponse.successStatus === 0)
return callback(null, nodeResponse.response);
@@ -258,7 +255,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
/**
* @param {string} error
*/
- Client.prototype.authResult = function (error) {
+ Client.prototype.authResult = function(error) {
return this._runCommand('authResult', [].slice.call(arguments));
};
@@ -269,7 +266,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param {Object} info
* @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
*/
- Client.prototype.metadataSchemas = function (driverPath, driverClass, url, info) {
+ Client.prototype.metadataSchemas = function(driverPath, driverClass, url, info) {
return this._runCommand('schemas', [].slice.call(arguments));
};
@@ -282,14 +279,14 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param {Boolean} tablesOnly
* @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
*/
- Client.prototype.metadataTables = function (driverPath, driverClass, url, info, schemas, tablesOnly) {
+ Client.prototype.metadataTables = function(driverPath, driverClass, url, info, schemas, tablesOnly) {
return this._runCommand('metadata', [].slice.call(arguments));
};
/**
* @returns {Promise} Promise on list of jars from driver folder.
*/
- Client.prototype.availableDrivers = function () {
+ Client.prototype.availableDrivers = function() {
return this._runCommand('availableDrivers', [].slice.call(arguments));
};
@@ -301,35 +298,32 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
* @param {Array} args Command params.
* @param {Function} callback on finish
*/
- Client.prototype._invokeRmtMethod = function (method, args, callback) {
- if (this._ws.readyState != 1) {
+ Client.prototype._invokeRmtMethod = function(method, args, callback) {
+ if (this._ws.readyState !== 1) {
if (callback)
callback('org.apache.ignite.agent.AgentException: Connection is closed');
return;
}
- var msg = {
- method: method,
- args: args
- };
+ const msg = { method, args };
if (callback) {
- var reqId = this._reqCounter++;
+ const reqId = this._reqCounter++;
this._cbMap[reqId] = callback;
msg.reqId = reqId;
}
- this._ws.send(JSON.stringify(msg))
+ this._ws.send(JSON.stringify(msg));
};
- Client.prototype._rmtAuthMessage = function (msg) {
- var self = this;
+ Client.prototype._rmtAuthMessage = function(msg) {
+ const self = this;
- fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', function (err, stats) {
- var relDate = 0;
+ fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', function(err, stats) {
+ let relDate = 0;
if (!err)
relDate = stats.birthtime.getTime();
@@ -337,11 +331,9 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
if ((msg.relDate || 0) < relDate)
self.authResult('You are using an older version of the agent. Please reload agent archive');
- mongo.Account.findOne({token: msg.token}, function (err, account) {
- if (err) {
- self.authResult('Failed to authorize user');
- // TODO IGNITE-1379 send error to web master.
- }
+ mongo.Account.findOne({token: msg.token}, function(err, account) {
+ if (err)
+ self.authResult('Failed to authorize user'); // TODO IGNITE-1379 send error to web master.
else if (!account)
self.authResult('Invalid token, user not found');
else {
@@ -359,10 +351,11 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
});
};
- Client.prototype._rmtCallRes = function (msg) {
- var callback = this._cbMap[msg.reqId];
+ Client.prototype._rmtCallRes = function(msg) {
+ const callback = this._cbMap[msg.reqId];
- if (!callback) return;
+ if (!callback)
+ return;
delete this._cbMap[msg.reqId];
@@ -372,7 +365,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
/**
* @returns {Ignite}
*/
- Client.prototype.ignite = function (demo) {
+ Client.prototype.ignite = function(demo) {
return demo ? this._demo : this._cluster;
};
[18/29] ignite git commit: IGNITE-843 Minor.
Posted by ak...@apache.org.
IGNITE-843 Minor.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ca0730fa
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ca0730fa
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ca0730fa
Branch: refs/heads/ignite-843-rc3
Commit: ca0730fafdfe2d452bf36a9d98a05d7b2a822e94
Parents: 9a528f3
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 14:30:01 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 14:30:01 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/agent.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ca0730fa/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 39f9a88..51cebab 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
@@ -91,7 +91,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'));
[04/29] ignite git commit: IGNITE-843 Fixed docker generation.
Posted by ak...@apache.org.
IGNITE-843 Fixed docker generation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c16d4664
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c16d4664
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c16d4664
Branch: refs/heads/ignite-843-rc3
Commit: c16d46647b2a8a8727f0c6d253452f79945bdfea
Parents: 5d0fbe5
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 09:26:22 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 09:26:22 2016 +0700
----------------------------------------------------------------------
.../src/main/js/helpers/generator/generator-docker.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c16d4664/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
index ab4ca55..ca93feb 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
@@ -37,7 +37,7 @@ $generatorDocker.clusterDocker = function (cluster, version) {
' apt-get install -y maven\n\n' +
'# Append project to container.\n' +
'ADD . ' + cluster.name + '\n\n' +
- '# Build project in container container.\n' +
+ '# Build project in container.\n' +
'RUN mvn -f ' + cluster.name + '/pom.xml clean package -DskipTests\n\n' +
'# Copy project jars to node classpath.\n' +
'RUN mkdir $IGNITE_HOME/libs/' + cluster.name + ' && \\\n' +
[26/29] ignite git commit: IGNITE-843 Fixed missing pointer on sorted
table columns.
Posted by ak...@apache.org.
IGNITE-843 Fixed missing pointer on sorted table columns.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7f04fb2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7f04fb2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7f04fb2
Branch: refs/heads/ignite-843-rc3
Commit: a7f04fb227cd4b46ba90839b4f68aebc2b76f811
Parents: b97d412
Author: Dmitriyff <dm...@gmail.com>
Authored: Fri Feb 12 16:30:57 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:30:57 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/public/stylesheets/style.scss | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7f04fb2/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 4a7d26e..adbfa1b 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -1406,6 +1406,10 @@ a {
content: '\25BC';
}
+th[st-sort] {
+ cursor: pointer;
+}
+
.panel {
margin-bottom: 0;
}
[19/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/dfeb830a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dfeb830a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dfeb830a
Branch: refs/heads/ignite-843-rc3
Commit: dfeb830a8da67b784f14cc60a49e3c52c1a3829d
Parents: ca0730f
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 14:41:59 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 14:41:59 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/agent.js | 60 ++++++++++----------
.../src/main/js/serve/routes/caches.js | 8 +--
.../src/main/js/serve/routes/clusters.js | 6 +-
.../src/main/js/serve/routes/domains.js | 4 +-
4 files changed, 40 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/dfeb830a/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 51cebab..4582820 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
@@ -34,7 +34,7 @@ module.exports = {
* @param {AgentManager} agentMgr
* @returns {Promise}
*/
-module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings, agentMgr) {
+module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings, agentMgr) {
return new Promise((resolve) => {
const router = express.Router();
@@ -56,26 +56,26 @@ 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);
return res.status(500).send(error);
- }
+ };
};
/* 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);
@@ -107,7 +107,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))
@@ -115,7 +115,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.
@@ -124,7 +124,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
// Set page size for query.
qry.setPageSize(req.body.pageSize);
- return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
+ return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage();
})
.then((cursor) => res.json({
meta: cursor.fieldsMetadata(),
@@ -135,7 +135,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.
@@ -147,8 +147,8 @@ 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) {
- cursor.getAll().then(rows => resolve({meta: cursor.fieldsMetadata(), rows}))
+ return new Promise(function(resolve) {
+ cursor.getAll().then(rows => resolve({meta: cursor.fieldsMetadata(), rows}));
});
})
.then(response => res.json(response))
@@ -156,7 +156,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.
@@ -166,7 +166,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
qry.setPageSize(req.body.pageSize);
// Get query cursor.
- return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
+ return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage();
})
.then((cursor) => res.json({
meta: cursor.fieldsMetadata(),
@@ -177,7 +177,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);
@@ -193,26 +193,26 @@ 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);
- return cache.__createPromise(cache._createCommand('qrycls').addParam('qryId', req.body.queryId))
+ return cache.__createPromise(cache._createCommand('qrycls').addParam('qryId', req.body.queryId));
})
.then(() => res.sendStatus(200))
.catch(_handleException(res));
});
/* 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 = [];
@@ -224,7 +224,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
});
@@ -246,7 +246,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
});
}
- if (fields.length > 0)
+ if (fields.length > 0) {
indexes.push({
type: 'index',
name: index.name,
@@ -254,11 +254,12 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
cacheName: meta.cacheName,
typeName: typeName
});
+ }
}
columns = _.sortBy(columns, 'name');
- if (!_.isEmpty(indexes))
+ if (!_.isEmpty(indexes)) {
columns = columns.concat({
type: 'indexes',
name: 'Indexes',
@@ -266,11 +267,12 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
typeName: typeName,
children: indexes
});
+ }
return {
type: 'type',
- cacheName: meta.cacheName || "",
- typeName: typeName,
+ cacheName: meta.cacheName || '',
+ typeName,
children: columns
};
});
@@ -285,14 +287,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))
@@ -300,7 +302,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;
@@ -314,14 +316,14 @@ 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;
args.jdbcInfo = {user: args.user, password: args.password};
- return client.metadataTables(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo, args.schemas, args.tablesOnly)
+ return client.metadataTables(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo, args.schemas, args.tablesOnly);
})
.then((arr) => res.json(arr))
.catch(_handleException(res));
http://git-wip-us.apache.org/repos/asf/ignite/blob/dfeb830a/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 2ecbc54..3d3824a 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
@@ -25,7 +25,7 @@ module.exports = {
module.exports.factory = function(_, express, mongo) {
return new Promise((resolve) => {
const router = express.Router();
-
+
/**
* Get spaces and caches accessed for user account.
*
@@ -126,7 +126,7 @@ module.exports.factory = function(_, express, mongo) {
});
});
});
- })
+ });
}
else
mongo.Cache.findOne({space: params.space, name: params.name}, function(err, cache) {
@@ -158,7 +158,7 @@ module.exports.factory = function(_, express, mongo) {
mongo.Cache.remove(req.body, function(err) {
if (mongo.processed(err, res))
res.sendStatus(200);
- })
+ });
});
/**
@@ -185,7 +185,7 @@ module.exports.factory = function(_, express, mongo) {
res.sendStatus(200);
});
});
- })
+ });
}
});
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/dfeb830a/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 a3c2519..4c5a92e 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
@@ -25,7 +25,7 @@ module.exports = {
module.exports.factory = function(_, express, mongo) {
return new Promise((resolve) => {
const router = express.Router();
-
+
/**
* Get spaces and clusters accessed for user account.
*
@@ -144,7 +144,7 @@ module.exports.factory = function(_, express, mongo) {
return res.status(500).send(err.message);
res.sendStatus(200);
- })
+ });
});
/**
@@ -171,7 +171,7 @@ module.exports.factory = function(_, express, mongo) {
res.sendStatus(200);
});
});
- })
+ });
}
});
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/dfeb830a/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 7cfb7d1..43240ec 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
@@ -220,7 +220,7 @@ module.exports.factory = function(_, express, async, mongo) {
mongo.DomainModel.remove(req.body, function(err) {
if (mongo.processed(err, res))
res.sendStatus(200);
- })
+ });
});
/**
@@ -244,7 +244,7 @@ module.exports.factory = function(_, express, async, mongo) {
if (mongo.processed(err, res))
res.sendStatus(200);
});
- })
+ });
}
});
});
[24/29] ignite git commit: IGNITE-843 Fixed project structure file
duplicates.
Posted by ak...@apache.org.
IGNITE-843 Fixed project structure file duplicates.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/03916ab1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/03916ab1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/03916ab1
Branch: refs/heads/ignite-843-rc3
Commit: 03916ab1c829015cc8e6c793812abb855046156b
Parents: f44993e
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 16:27:42 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 16:27:42 2016 +0700
----------------------------------------------------------------------
.../states/configuration/summary/summary.controller.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/03916ab1/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
index 1e487a3..34cde53 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
@@ -166,12 +166,12 @@ export default [
function addClass(fullClsName) {
const path = fullClsName.split('.');
- const shortClsName = path.pop() + '.java';
-
const folder = getOrCreateFolder(javaFolder, path);
- if (!_.find(folder.children, {type: 'file', name: shortClsName}))
- folder.children.push({type: 'file', name: shortClsName});
+ const leaf = {type: 'file', name: path.pop() + '.java'};
+
+ if (!_.find(folder.children, leaf))
+ folder.children.push(leaf);
}
$scope.selectItem = (cluster) => {
[28/29] ignite git commit: IGNITE-843 Fixed missing pointer on sorted
table columns.
Posted by ak...@apache.org.
IGNITE-843 Fixed missing pointer on sorted table columns.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e4a30cb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e4a30cb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e4a30cb
Branch: refs/heads/ignite-843-rc3
Commit: 9e4a30cbb7759f0a0f53c66c0f839d9b3e672d1a
Parents: 8a7b7bb
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 16:38:56 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:38:56 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/admin.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e4a30cb/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 e57410d..9bef81498 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
@@ -48,7 +48,7 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
if (errAccount)
return res.status(500).send(errAccount.message);
- mongo.Space.find({owner: userId}, function(err, spaces) {
+ mongo.Space.find({owner: userId}, function(errSpace, spaces) {
_.forEach(spaces, (space) => {
mongo.Cluster.remove({space: space._id}).exec();
mongo.Cache.remove({space: space._id}).exec();
[20/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/da470874
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/da470874
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/da470874
Branch: refs/heads/ignite-843-rc3
Commit: da470874676fb33c9fc17a84042cc024b7a8c5ad
Parents: dfeb830
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 15:08:14 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 15:08:14 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/admin.js | 22 +++---
.../src/main/js/serve/routes/agent.js | 73 ++++++++++----------
.../src/main/js/serve/routes/caches.js | 59 ++++++++--------
3 files changed, 81 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/da470874/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 765b8e8..e57410d 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
@@ -42,9 +44,9 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
router.post('/remove', function(req, res) {
const userId = req.body.userId;
- mongo.Account.findByIdAndRemove(userId, function(err, user) {
- if (err)
- return res.status(500).send(err.message);
+ mongo.Account.findByIdAndRemove(userId, function(errAccount, user) {
+ if (errAccount)
+ return res.status(500).send(errAccount.message);
mongo.Space.find({owner: userId}, function(err, spaces) {
_.forEach(spaces, (space) => {
@@ -65,9 +67,9 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
};
if (transporter.service !== '' || transporter.auth.user !== '' || transporter.auth.pass !== '') {
- var mailer = nodemailer.createTransport(transporter);
+ const mailer = nodemailer.createTransport(transporter);
- var mailOptions = {
+ const mailOptions = {
from: settings.smtp.address(settings.smtp.username, settings.smtp.email),
to: settings.smtp.address(user.username, user.email),
subject: 'Your account was deleted',
@@ -76,9 +78,9 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
'Apache Ignite Web Console http://' + req.headers.host + '\n'
};
- 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);
+ mailer.sendMail(mailOptions, function(errMailer) {
+ if (errMailer)
+ return res.status(503).send('Account was removed, but failed to send e-mail notification to user!<br />' + errMailer);
res.sendStatus(200);
});
@@ -90,8 +92,8 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
// Save user.
router.post('/save', function(req, res) {
- var userId = req.body.userId;
- var adminFlag = req.body.adminFlag;
+ const userId = req.body.userId;
+ const adminFlag = req.body.adminFlag;
mongo.Account.findByIdAndUpdate(userId, {admin: adminFlag}, function(err) {
if (err)
http://git-wip-us.apache.org/repos/asf/ignite/blob/da470874/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 4582820..5fa0328 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
@@ -38,7 +38,8 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
return new Promise((resolve) => {
const router = express.Router();
- const SqlFieldsQuery = apacheIgnite.SqlFieldsQuery, ScanQuery = apacheIgnite.ScanQuery;
+ const SqlFieldsQuery = apacheIgnite.SqlFieldsQuery;
+ const ScanQuery = apacheIgnite.ScanQuery;
const _client = (userId) => {
return new Promise((resolve, reject) => {
@@ -66,24 +67,24 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
/* Get grid topology. */
router.get('/download/zip', function(req, res) {
- var agentFld = settings.agent.file;
- var agentZip = agentFld + '.zip';
- var agentPathZip = 'public/agent/' + agentFld + '.zip';
+ const agentFld = settings.agent.file;
+ const agentZip = agentFld + '.zip';
+ const agentPathZip = 'public/agent/' + agentFld + '.zip';
fs.stat(agentPathZip, function(err, stats) {
if (err)
return res.download(agentPathZip, agentZip);
// Read a zip file.
- fs.readFile(agentPathZip, function(err, data) {
- if (err)
+ fs.readFile(agentPathZip, function(errFs, data) {
+ if (errFs)
return res.download(agentPathZip, agentZip);
- var zip = new JSZip(data);
+ const zip = new JSZip(data);
- var prop = [];
+ const prop = [];
- var host = req.hostname.match(/:/g) ? req.hostname.slice(0, req.hostname.indexOf(':')) : req.hostname;
+ const host = req.hostname.match(/:/g) ? req.hostname.slice(0, req.hostname.indexOf(':')) : req.hostname;
prop.push('token=' + req.user.token);
prop.push('server-uri=wss://' + host + ':' + settings.agent.port);
@@ -96,7 +97,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
zip.file(agentFld + '/default.properties', prop.join('\n'));
- var buffer = zip.generate({type: 'nodebuffer', platform: 'UNIX'});
+ const buffer = zip.generate({type: 'nodebuffer', platform: 'UNIX'});
// Set the archive name.
res.attachment(agentZip);
@@ -119,7 +120,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
_client(req.currentUserId())
.then((client) => {
// Create sql query.
- var qry = new SqlFieldsQuery(req.body.query);
+ const qry = new SqlFieldsQuery(req.body.query);
// Set page size for query.
qry.setPageSize(req.body.pageSize);
@@ -148,10 +149,10 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
const cursor = client.ignite(req.body.demo).cache(req.body.cacheName).query(qry);
return new Promise(function(resolve) {
- cursor.getAll().then(rows => resolve({meta: cursor.fieldsMetadata(), rows}));
+ cursor.getAll().then((rows) => resolve({meta: cursor.fieldsMetadata(), rows}));
});
})
- .then(response => res.json(response))
+ .then((response) => res.json(response))
.catch(_handleException(res));
});
@@ -160,7 +161,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
_client(req.currentUserId())
.then((client) => {
// Create sql query.
- var qry = new ScanQuery();
+ const qry = new ScanQuery();
// Set page size for query.
qry.setPageSize(req.body.pageSize);
@@ -180,15 +181,15 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
router.post('/query/fetch', function(req, res) {
_client(req.currentUserId())
.then((client) => {
- var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
+ const cache = client.ignite(req.body.demo).cache(req.body.cacheName);
- var cmd = cache._createCommand('qryfetch')
+ const cmd = cache._createCommand('qryfetch')
.addParam('qryId', req.body.queryId)
.addParam('pageSize', req.body.pageSize);
return cache.__createPromise(cmd);
})
- .then((page) => res.json({rows: page['items'], last: page === null || page['last']}))
+ .then((page) => res.json({rows: page.items, last: page === null || page.last}))
.catch(_handleException(res));
});
@@ -196,7 +197,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
router.post('/query/close', function(req, res) {
_client(req.currentUserId())
.then((client) => {
- var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
+ const cache = client.ignite(req.body.demo).cache(req.body.cacheName);
return cache.__createPromise(cache._createCommand('qrycls').addParam('qryId', req.body.queryId));
})
@@ -209,40 +210,40 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
_client(req.currentUserId())
.then((client) => client.ignite(req.body.demo).cache(req.body.cacheName).metadata())
.then((caches) => {
- var types = [];
+ let types = [];
- for (var meta of caches) {
- var cacheTypes = meta.types.map(function(typeName) {
- var fields = meta.fields[typeName];
+ for (const meta of caches) {
+ const cacheTypes = meta.types.map(function(typeName) {
+ let fields = meta.fields[typeName];
- var columns = [];
+ let columns = [];
- for (var fieldName in fields) {
- var fieldClass = _compact(fields[fieldName]);
+ for (const fieldName in fields) {
+ const fieldClass = _compact(fields[fieldName]);
columns.push({
type: 'field',
name: fieldName,
clazz: fieldClass,
- system: fieldName === "_KEY" || fieldName === "_VAL",
+ system: fieldName === '_KEY' || fieldName === '_VAL',
cacheName: meta.cacheName,
- typeName: typeName
+ typeName
});
}
- var indexes = [];
+ const indexes = [];
- for (var index of meta.indexes[typeName]) {
+ for (const index of meta.indexes[typeName]) {
fields = [];
- for (var field of index.fields) {
+ for (const field of index.fields) {
fields.push({
type: 'index-field',
name: field,
order: index.descendings.indexOf(field) < 0,
unique: index.unique,
cacheName: meta.cacheName,
- typeName: typeName
+ typeName
});
}
@@ -252,7 +253,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
name: index.name,
children: fields,
cacheName: meta.cacheName,
- typeName: typeName
+ typeName
});
}
}
@@ -264,7 +265,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
type: 'indexes',
name: 'Indexes',
cacheName: meta.cacheName,
- typeName: typeName,
+ typeName,
children: indexes
});
}
@@ -305,11 +306,11 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
router.post('/schemas', function(req, res) {
_client(req.currentUserId())
.then((client) => {
- var args = req.body;
+ const args = req.body;
args.jdbcInfo = {user: args.user, password: args.password};
- return client.metadataSchemas(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo)
+ return client.metadataSchemas(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo);
})
.then((arr) => res.json(arr))
.catch(_handleException(res));
@@ -319,7 +320,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
router.post('/tables', function(req, res) {
_client(req.currentUserId())
.then((client) => {
- var args = req.body;
+ const args = req.body;
args.jdbcInfo = {user: args.user, password: args.password};
http://git-wip-us.apache.org/repos/asf/ignite/blob/da470874/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 3d3824a..bb7097a 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
@@ -33,21 +35,21 @@ module.exports.factory = function(_, express, mongo) {
* @param res Response.
*/
router.post('/list', function(req, res) {
- var user_id = req.currentUserId();
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(errSpace, spaces) {
+ if (mongo.processed(errSpace, res)) {
+ const 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) {
- if (mongo.processed(err, res)) {
+ mongo.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function(errCluster, clusters) {
+ if (mongo.processed(errCluster, res)) {
// Get all domain models for spaces.
- mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function(err, domains) {
- if (mongo.processed(err, res)) {
+ mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function(errDomainModel, domains) {
+ if (mongo.processed(errDomainModel, res)) {
// Get all caches for spaces.
mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function(err, caches) {
if (mongo.processed(err, res)) {
@@ -67,15 +69,15 @@ module.exports.factory = function(_, express, mongo) {
// Remove deleted clusters.
cache.clusters = _.filter(cache.clusters, function(clusterId) {
return _.findIndex(clusters, function(cluster) {
- return cluster._id.equals(clusterId);
- }) >= 0;
+ return cluster._id.equals(clusterId);
+ }) >= 0;
});
// Remove deleted domain models.
cache.domains = _.filter(cache.domains, function(metaId) {
return _.findIndex(domains, function(domain) {
- return domain._id.equals(metaId);
- }) >= 0;
+ return domain._id.equals(metaId);
+ }) >= 0;
});
});
@@ -88,8 +90,8 @@ module.exports.factory = function(_, express, mongo) {
caches: cluster.caches
};
}),
- domains: domains,
- caches: caches
+ domains,
+ caches
});
}
});
@@ -105,27 +107,30 @@ module.exports.factory = function(_, express, mongo) {
* Save cache.
*/
router.post('/save', function(req, res) {
- var params = req.body;
- var cacheId = params._id;
- var clusters = params.clusters;
- var domains = params.domains;
+ const params = req.body;
+ const clusters = params.clusters;
+ const domains = params.domains;
+ let cacheId = params._id;
if (params._id) {
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) {
- if (mongo.processed(err, res))
- 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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);
});
});
+ }
});
+ }
});
+ }
});
}
else
@@ -165,12 +170,12 @@ module.exports.factory = function(_, express, mongo) {
* Remove all caches.
*/
router.post('/remove/all', function(req, res) {
- var user_id = req.currentUserId();
+ const 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) {
if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
+ const space_ids = spaces.map(function(value) {
return value._id;
});
[12/29] ignite git commit: IGNITE-843 Refactor serve to es6.
Posted by ak...@apache.org.
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/0e11d410
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e11d410
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e11d410
Branch: refs/heads/ignite-843-rc3
Commit: 0e11d4109d72a3cb34ac7ff6b56e220e35c0502b
Parents: 0a7ac46
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 13:42:12 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 13:42:12 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/agent.js | 544 ++++++++++---------
.../control-center-web/src/main/js/serve/app.js | 4 +-
.../src/main/js/serve/configure.js | 23 +-
.../src/main/js/serve/mongo.js | 3 +-
.../src/main/js/serve/routes/agent.js | 52 +-
5 files changed, 318 insertions(+), 308 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e11d410/modules/control-center-web/src/main/js/serve/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/agent.js b/modules/control-center-web/src/main/js/serve/agent.js
index f750047..3470dfe 100644
--- a/modules/control-center-web/src/main/js/serve/agent.js
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -15,360 +15,368 @@
* limitations under the License.
*/
-// Fire me up!
'use strict';
+// Fire me up!
+
module.exports = {
implements: 'agent',
inject: ['require(fs)', 'require(ws)', 'require(apache-ignite)', 'mongo']
};
-module.exports.factory = function(fs, ws, apacheIgnite, mongo) {
- /**
- * @constructor
- */
- function AgentManager() {
- this._clients = {};
- }
-
- /**
- *
- */
- AgentManager.prototype.listen = function(srv) {
- if (this._server)
- throw 'Agent server already started!';
-
- this._server = srv;
+module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
+ class Agent {
+ /**
+ * @param {AgentManager} manager
+ * @param {WebSocket} _wsSrv
+ */
+ constructor(_wsSrv, manager) {
+ const self = this;
- this._wss = new ws.Server({server: this._server});
+ this._manager = manager;
- const self = this;
+ this._wsSrv = _wsSrv;
- this._wss.on('connection', (_ws) => new Client(_ws, self));
- };
-
- /**
- * @param userId
- * @param {Client} client
- */
- AgentManager.prototype._removeClient = function(userId, client) {
- const connections = this._clients[userId];
-
- if (connections) {
- let idx;
-
- while ((idx = connections.indexOf(client)) !== -1)
- connections.splice(idx, 1);
+ this._wsSrv.on('close', () => {
+ if (self._user)
+ self._manager._removeClient(self._user._id, self);
+ });
- if (connections.length === 0)
- delete this._clients[userId];
- }
- };
+ this._wsSrv.on('message', (msgStr) => {
+ const msg = JSON.parse(msgStr);
- /**
- * @param userId
- * @param {Client} client
- */
- AgentManager.prototype._addClient = function(userId, client) {
- let existingConnections = this._clients[userId];
+ self['_rmt' + msg.type](msg);
+ });
- if (!existingConnections) {
- existingConnections = [];
+ this._reqCounter = 0;
- this._clients[userId] = existingConnections;
+ this._cbMap = {};
}
- existingConnections.push(client);
- };
+ _runCommand(method, args) {
+ const self = this;
- /**
- * @param userId
- * @returns {Client}
- */
- AgentManager.prototype.findClient = function(userId) {
- const clientsList = this._clients[userId];
+ return new Promise((resolve, reject) =>
+ self._invokeRmtMethod(method, args, (error, res) => {
+ if (error)
+ return reject(error);
- if (!clientsList || clientsList.length === 0)
- return null;
+ resolve(res);
+ })
+ );
+ };
- return clientsList[0];
- };
+ /**
+ * @param {String} uri
+ * @param {Object} params
+ * @param {Boolean} demo
+ * @param {String} [method]
+ * @param {Object} [headers]
+ * @param {String} [body]
+ * @param {Function} [cb] Callback. Take 3 arguments: {Number} successStatus, {String} error, {String} response.
+ */
+ executeRest(uri, params, demo, method, headers, body, cb) {
+ if (typeof (params) !== 'object')
+ throw '"params" argument must be an object';
- /**
- * Creates an instance of server for Ignite
- *
- * @constructor
- * @this {AgentServer}
- * @param {Client} client Connected client
- * @param {Boolean} demo Use demo node for request
- */
- function AgentServer(client, demo) {
- this._client = client;
- this._demo = !!demo;
- }
+ if (typeof (cb) !== 'function')
+ throw 'callback must be a function';
- /**
- * Run http request
- *
- * @this {AgentServer}
- * @param {cmd} cmd Command
- * @param {callback} callback on finish
- */
- AgentServer.prototype.runCommand = function(cmd, callback) {
- const params = { cmd: cmd.name() };
+ if (body && typeof (body) !== 'string')
+ throw 'body must be a string';
- for (var param of cmd._params)
- params[param.key] = param.value;
+ if (headers && typeof (headers) !== 'object')
+ throw 'headers must be an object';
- let body;
+ if (!method)
+ method = 'GET';
+ else
+ method = method.toUpperCase();
- let headers;
+ if (method !== 'GET' && method !== 'POST')
+ throw 'Unknown HTTP method: ' + method;
- let method = 'GET';
+ const _cb = (error, restResult) => {
+ if (error)
+ return cb(error);
- if (cmd._isPost()) {
- body = cmd.postData();
+ const restError = restResult.error;
- method = 'POST';
+ if (restError)
+ return cb(restError);
- headers = {JSONObject: 'application/json'};
- }
+ const restCode = restResult.restCode;
- this._client.executeRest('ignite', params, this._demo, method, headers, body, callback);
- };
+ if (restCode !== 200) {
+ if (restCode === 401)
+ return cb.call({code: restCode, message: 'Failed to authenticate on node.'});
- /**
- * @constructor
- * @param {AgentManager} manager
- * @param {WebSocket} ws
- */
- function Client(ws, manager) {
- const self = this;
+ return cb.call({
+ code: restCode,
+ message: restError || 'Failed connect to node and execute REST command.'
+ });
+ }
- this._manager = manager;
- this._ws = ws;
+ try {
+ const nodeResponse = JSON.parse(restResult.response);
+
+ if (nodeResponse.successStatus === 0)
+ return cb(null, nodeResponse.response);
+
+ switch (nodeResponse.successStatus) {
+ case 1:
+ return cb({code: 500, message: nodeResponse.error});
+ case 2:
+ return cb({code: 401, message: nodeResponse.error});
+ case 3:
+ return cb({code: 403, message: nodeResponse.error});
+ default:
+ return cb(nodeResponse.error);
+ }
+ }
+ catch (e) {
+ return cb(e);
+ }
+ };
- ws.on('close', function() {
- if (self._user)
- self._manager._removeClient(self._user._id, self);
- });
+ this._invokeRmtMethod('executeRest', [uri, params, demo, method, headers, body], _cb);
+ };
- ws.on('message', function(msgStr) {
- const msg = JSON.parse(msgStr);
+ /**
+ * @param {?String} error
+ */
+ authResult(error) {
+ return this._runCommand('authResult', [error]);
+ }
- self['_rmt' + msg.type](msg);
- });
+ /**
+ * @param {String} driverPath
+ * @param {String} driverClass
+ * @param {String} url
+ * @param {Object} info
+ * @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
+ */
+ metadataSchemas(driverPath, driverClass, url, info) {
+ return this._runCommand('schemas', [driverPath, driverClass, url, info]);
+ }
- this._reqCounter = 0;
+ /**
+ * @param {String} driverPath
+ * @param {String} driverClass
+ * @param {String} url
+ * @param {Object} info
+ * @param {Array} schemas
+ * @param {Boolean} tablesOnly
+ * @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
+ */
+ metadataTables(driverPath, driverClass, url, info, schemas, tablesOnly) {
+ return this._runCommand('metadata', [driverPath, driverClass, url, info, schemas, tablesOnly]);
+ }
- this._cbMap = {};
- }
+ /**
+ * @returns {Promise} Promise on list of jars from driver folder.
+ */
+ availableDrivers() {
+ return this._runCommand('availableDrivers', []);
+ };
- Client.prototype._runCommand = function(method, args) {
- const self = this;
+ /**
+ * Run http request
+ *
+ * @this {AgentServer}
+ * @param {String} method Command name.
+ * @param {Array} args Command params.
+ * @param {Function} callback on finish
+ */
+ _invokeRmtMethod(method, args, callback) {
+ if (this._wsSrv.readyState !== 1) {
+ if (callback)
+ callback('org.apache.ignite.agent.AgentException: Connection is closed');
+
+ return;
+ }
- return new Promise(function(resolve, reject) {
- self._invokeRmtMethod(method, args, function(error, res) {
- if (error !== null)
- return reject(error);
+ const msg = {method, args};
- resolve(res);
- });
- });
- };
+ if (callback) {
+ const reqId = this._reqCounter++;
- /**
- * @param {String} uri
- * @param {Object} params
- * @param {Boolean} demo
- * @param {String} [method]
- * @param {Object} [headers]
- * @param {String} [body]
- * @param {callback} [callback] Callback. Take 3 arguments: {Number} successStatus, {String} error, {String} response.
- */
- Client.prototype.executeRest = function(uri, params, demo, method, headers, body, callback) {
- if (typeof (params) !== 'object')
- throw '"params" argument must be an object';
+ this._cbMap[reqId] = callback;
- if (typeof (callback) !== 'function')
- throw 'callback must be a function';
+ msg.reqId = reqId;
+ }
- if (body && typeof (body) !== 'string')
- throw 'body must be a string';
+ this._wsSrv.send(JSON.stringify(msg));
+ };
- if (headers && typeof (headers) !== 'object')
- throw 'headers must be an object';
+ _rmtAuthMessage(msg) {
+ const self = this;
- if (!method)
- method = 'GET';
- else
- method = method.toUpperCase();
+ fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', (errFs, stats) => {
+ let relDate = 0;
- if (method !== 'GET' && method !== 'POST')
- throw 'Unknown HTTP method: ' + method;
+ if (!errFs)
+ relDate = stats.birthtime.getTime();
- const cb = function(error, restResult) {
- if (error)
- return callback(error);
+ if ((msg.relDate || 0) < relDate)
+ self.authResult('You are using an older version of the agent. Please reload agent archive');
- const restError = restResult.error;
+ mongo.Account.findOne({token: msg.token}, (err, account) => {
+ // TODO IGNITE-1379 send error to web master.
+ if (err)
+ self.authResult('Failed to authorize user');
+ else if (!account)
+ self.authResult('Invalid token, user not found');
+ else {
+ self.authResult(null);
- if (restError)
- return callback(restError);
+ self._user = account;
- const restCode = restResult.restCode;
+ self._manager._addAgent(account._id, self);
- if (restCode !== 200) {
- if (restCode === 401)
- return callback.call({code: restCode, message: 'Failed to authenticate on node.'});
+ self._cluster = new apacheIgnite.Ignite(new AgentServer(self));
- return callback.call({
- code: restCode,
- message: restError || 'Failed connect to node and execute REST command.'
+ self._demo = new apacheIgnite.Ignite(new AgentServer(self, true));
+ }
});
- }
+ });
+ };
- try {
- const nodeResponse = JSON.parse(restResult.response);
+ _rmtCallRes(msg) {
+ const callback = this._cbMap[msg.reqId];
- if (nodeResponse.successStatus === 0)
- return callback(null, nodeResponse.response);
+ if (!callback)
+ return;
- switch (nodeResponse.successStatus) {
- case 1:
- return callback({code: 500, message: nodeResponse.error});
- case 2:
- return callback({code: 401, message: nodeResponse.error});
- case 3:
- return callback({code: 403, message: nodeResponse.error});
- }
+ delete this._cbMap[msg.reqId];
- callback(nodeResponse.error);
- }
- catch (e) {
- callback(e);
- }
+ callback(msg.error, msg.response);
};
- this._invokeRmtMethod('executeRest', [uri, params, demo, method, headers, body], cb);
- };
+ /**
+ * @returns {Ignite}
+ */
+ ignite(demo) {
+ return demo ? this._demo : this._cluster;
+ };
+ }
/**
- * @param {string} error
+ * Creates an instance of server for Ignite.
*/
- Client.prototype.authResult = function(error) {
- return this._runCommand('authResult', [].slice.call(arguments));
- };
+ class AgentServer {
+ /**
+ * @this {AgentServer}
+ * @param {Agent} agent Connected agent
+ * @param {Boolean} demo Use demo node for request
+ */
+ constructor(agent, demo) {
+ this._agent = agent;
+ this._demo = !!demo;
+ }
- /**
- * @param {String} driverPath
- * @param {String} driverClass
- * @param {String} url
- * @param {Object} info
- * @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
- */
- Client.prototype.metadataSchemas = function(driverPath, driverClass, url, info) {
- return this._runCommand('schemas', [].slice.call(arguments));
- };
+ /**
+ * Run http request
+ *
+ * @this {AgentServer}
+ * @param {cmd} cmd Command
+ * @param {callback} callback on finish
+ */
+ runCommand(cmd, callback) {
+ const params = {cmd: cmd.name()};
- /**
- * @param {String} driverPath
- * @param {String} driverClass
- * @param {String} url
- * @param {Object} info
- * @param {Array} schemas
- * @param {Boolean} tablesOnly
- * @returns {Promise} Promise on list of tables (see org.apache.ignite.schema.parser.DbTable java class)
- */
- Client.prototype.metadataTables = function(driverPath, driverClass, url, info, schemas, tablesOnly) {
- return this._runCommand('metadata', [].slice.call(arguments));
- };
+ for (const param of cmd._params)
+ params[param.key] = param.value;
- /**
- * @returns {Promise} Promise on list of jars from driver folder.
- */
- Client.prototype.availableDrivers = function() {
- return this._runCommand('availableDrivers', [].slice.call(arguments));
- };
+ let body;
- /**
- * Run http request
- *
- * @this {AgentServer}
- * @param {String} method Command name.
- * @param {Array} args Command params.
- * @param {Function} callback on finish
- */
- Client.prototype._invokeRmtMethod = function(method, args, callback) {
- if (this._ws.readyState !== 1) {
- if (callback)
- callback('org.apache.ignite.agent.AgentException: Connection is closed');
+ let headers;
- return;
- }
+ let method = 'GET';
+
+ if (cmd._isPost()) {
+ body = cmd.postData();
- const msg = { method, args };
+ method = 'POST';
- if (callback) {
- const reqId = this._reqCounter++;
+ headers = {JSONObject: 'application/json'};
+ }
- this._cbMap[reqId] = callback;
+ this._agent.executeRest('ignite', params, this._demo, method, headers, body, callback);
+ };
+ }
- msg.reqId = reqId;
+ class AgentManager {
+ /**
+ * @constructor
+ */
+ constructor() {
+ this._agents = {};
}
- this._ws.send(JSON.stringify(msg));
- };
+ /**
+ *
+ */
+ listen(srv) {
+ if (this._server)
+ throw 'Agent server already started!';
- Client.prototype._rmtAuthMessage = function(msg) {
- const self = this;
+ this._server = srv;
- fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', function(err, stats) {
- let relDate = 0;
+ this._wsSrv = new ws.Server({server: this._server});
- if (!err)
- relDate = stats.birthtime.getTime();
+ const self = this;
+
+ this._wsSrv.on('connection', (_wsSrv) => new Agent(_wsSrv, self));
+ };
- if ((msg.relDate || 0) < relDate)
- self.authResult('You are using an older version of the agent. Please reload agent archive');
+ /**
+ * @param userId
+ * @param {Agent} client
+ */
+ _removeClient(userId, client) {
+ const agents = this._agents[userId];
- mongo.Account.findOne({token: msg.token}, function(err, account) {
- if (err)
- self.authResult('Failed to authorize user'); // TODO IGNITE-1379 send error to web master.
- else if (!account)
- self.authResult('Invalid token, user not found');
- else {
- self.authResult(null);
+ if (agents) {
+ let idx;
- self._user = account;
+ while ((idx = agents.indexOf(client)) !== -1)
+ agents.splice(idx, 1);
- self._manager._addClient(account._id, self);
+ if (agents.length === 0)
+ delete this._agents[userId];
+ }
+ };
- self._cluster = new apacheIgnite.Ignite(new AgentServer(self));
+ /**
+ * @param {ObjectId} userId
+ * @param {Agent} agent
+ */
+ _addAgent(userId, agent) {
+ let agents = this._agents[userId];
- self._demo = new apacheIgnite.Ignite(new AgentServer(self, true));
- }
- });
- });
- };
+ if (!agents) {
+ agents = [];
- Client.prototype._rmtCallRes = function(msg) {
- const callback = this._cbMap[msg.reqId];
+ this._agents[userId] = agents;
+ }
- if (!callback)
- return;
+ agents.push(agent);
+ };
- delete this._cbMap[msg.reqId];
+ /**
+ * @param {ObjectId} userId
+ * @returns {Agent}
+ */
+ findClient(userId) {
+ const agents = this._agents[userId];
- callback(msg.error, msg.response);
- };
+ if (!agents || agents.length === 0)
+ return null;
- /**
- * @returns {Ignite}
- */
- Client.prototype.ignite = function(demo) {
- return demo ? this._demo : this._cluster;
- };
+ return agents[0];
+ };
+ }
return new AgentManager();
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e11d410/modules/control-center-web/src/main/js/serve/app.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/app.js b/modules/control-center-web/src/main/js/serve/app.js
index cc93ed9..6d19b44 100644
--- a/modules/control-center-web/src/main/js/serve/app.js
+++ b/modules/control-center-web/src/main/js/serve/app.js
@@ -22,8 +22,8 @@ module.exports = {
inject: ['require(express)', 'configure', 'routes']
};
-module.exports.factory = function(express, configure, routes) {
- const app = new express();
+module.exports.factory = function(Express, configure, routes) {
+ const app = new Express();
configure(app);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e11d410/modules/control-center-web/src/main/js/serve/configure.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/configure.js b/modules/control-center-web/src/main/js/serve/configure.js
index ea8a484..9d8b1d3 100644
--- a/modules/control-center-web/src/main/js/serve/configure.js
+++ b/modules/control-center-web/src/main/js/serve/configure.js
@@ -15,21 +15,20 @@
* limitations under the License.
*/
-// Fire me up!
'use strict';
+// Fire me up!
+
module.exports = {
implements: 'configure',
inject: ['require(morgan)', 'require(cookie-parser)', 'require(body-parser)', 'require(express-force-ssl)',
'require(express-session)', 'require(connect-mongo)', 'require(passport)', 'settings', 'mongo']
};
-module.exports.factory = function(logger, cookieParser, bodyParser, forceSSL, session, connectMongo, passport, settings, mongo) {
+module.exports.factory = function(logger, cookieParser, bodyParser, forceSSL, session, connectMongo, Passport, settings, mongo) {
return (app) => {
app.use(logger('dev', {
- skip: function(req, res) {
- return res.statusCode < 400;
- }
+ skip: (req, res) => res.statusCode < 400
}));
app.use(cookieParser(settings.sessionSecret));
@@ -37,7 +36,7 @@ module.exports.factory = function(logger, cookieParser, bodyParser, forceSSL, se
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
- const mongoStore = connectMongo(session);
+ const MongoStore = connectMongo(session);
app.use(session({
secret: settings.sessionSecret,
@@ -47,16 +46,16 @@ module.exports.factory = function(logger, cookieParser, bodyParser, forceSSL, se
expires: new Date(Date.now() + settings.cookieTTL),
maxAge: settings.cookieTTL
},
- store: new mongoStore({mongooseConnection: mongo.connection})
+ store: new MongoStore({mongooseConnection: mongo.connection})
}));
- app.use(passport.initialize());
- app.use(passport.session());
+ app.use(Passport.initialize());
+ app.use(Passport.session());
- passport.serializeUser(mongo.Account.serializeUser());
- passport.deserializeUser(mongo.Account.deserializeUser());
+ Passport.serializeUser(mongo.Account.serializeUser());
+ Passport.deserializeUser(mongo.Account.deserializeUser());
- passport.use(mongo.Account.createStrategy());
+ Passport.use(mongo.Account.createStrategy());
if (settings.SSLOptions) {
app.set('forceSSLOptions', settings.SSLOptions);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e11d410/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 f31267d..3768e77 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -15,9 +15,10 @@
* limitations under the License.
*/
-// Fire me up!
'use strict';
+// Fire me up!
+
module.exports = {
implements: 'mongo',
inject: ['require(mongoose-deep-populate)', 'require(passport-local-mongoose)', 'settings', 'ignite_modules/mongo:*']
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e11d410/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 d98400f..39f9a88 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
@@ -29,21 +31,21 @@ module.exports = {
* @param fs
* @param JSZip
* @param settings
- * @param {AgentManager} agent
+ * @param {AgentManager} agentMgr
* @returns {Promise}
*/
-module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings, agent) {
+module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings, agentMgr) {
return new Promise((resolve) => {
const router = express.Router();
const SqlFieldsQuery = apacheIgnite.SqlFieldsQuery, ScanQuery = apacheIgnite.ScanQuery;
const _client = (userId) => {
- return new Promise(function(resolve, reject) {
- var client = agent.findClient(userId);
+ return new Promise((resolve, reject) => {
+ const agent = agentMgr.findClient(userId);
- if (client)
- return resolve(client);
+ if (agent)
+ return resolve(agent);
reject({code: 503, message: 'Connection to Ignite Web Agent is not established'});
});
@@ -54,7 +56,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 +65,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 +91,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: Do not change this auto generated line');
+ prop.push("#Note: Don't change this auto generated line");
prop.push('rel-date=' + stats.birthtime.getTime());
zip.file(agentFld + '/default.properties', prop.join('\n'));
@@ -105,7 +107,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 +115,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 +135,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 +147,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 +156,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 +177,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 +193,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 +205,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 +224,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 +285,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 +300,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 +314,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;
[09/29] ignite git commit: IGNITE-843 Fixed profile save.
Posted by ak...@apache.org.
IGNITE-843 Fixed profile save.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c0d808b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c0d808b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c0d808b
Branch: refs/heads/ignite-843-rc3
Commit: 9c0d808b33241e536d6d6aedfa9f177b261976ae
Parents: eced320
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 10:14:34 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 10:14:34 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/routes.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9c0d808b/modules/control-center-web/src/main/js/serve/routes/routes.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/routes/routes.js b/modules/control-center-web/src/main/js/serve/routes/routes.js
index 9c7e7c9..1572261 100644
--- a/modules/control-center-web/src/main/js/serve/routes/routes.js
+++ b/modules/control-center-web/src/main/js/serve/routes/routes.js
@@ -60,7 +60,7 @@ module.exports.factory = function(publicRoutes, adminRoutes, profileRoutes, clus
// Registering the standard routes
app.use('/', publicRoutes);
app.use('/admin', _mustAuthenticated, _adminOnly, adminRoutes);
- app.use('/profile', _mustAuthenticated, adminRoutes);
+ app.use('/profile', _mustAuthenticated, profileRoutes);
app.all('/configuration/*', _mustAuthenticated);
[27/29] ignite git commit: IGNITE-843 Refactor serve to es6.
Posted by ak...@apache.org.
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/8a7b7bb5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8a7b7bb5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8a7b7bb5
Branch: refs/heads/ignite-843-rc3
Commit: 8a7b7bb5a7e276d4817e007ac764fe708be01d3e
Parents: a7f04fb
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 16:35:23 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 16:35:23 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/agent.js | 96 ++++++++++----------
1 file changed, 50 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a7b7bb5/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 5fa0328..68a86d1 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
@@ -35,7 +35,7 @@ module.exports = {
* @returns {Promise}
*/
module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings, agentMgr) {
- return new Promise((resolve) => {
+ return new Promise((resolveFactory) => {
const router = express.Router();
const SqlFieldsQuery = apacheIgnite.SqlFieldsQuery;
@@ -212,13 +212,13 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
.then((caches) => {
let types = [];
- for (const meta of caches) {
- const cacheTypes = meta.types.map(function(typeName) {
- let fields = meta.fields[typeName];
+ const _typeMapper = (meta, typeName) => {
+ let fields = meta.fields[typeName];
- let columns = [];
+ let columns = [];
- for (const fieldName in fields) {
+ for (const fieldName in fields) {
+ if (fields.hasOwnProperty(fieldName)) {
const fieldClass = _compact(fields[fieldName]);
columns.push({
@@ -230,53 +230,57 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
typeName
});
}
+ }
- const indexes = [];
-
- for (const index of meta.indexes[typeName]) {
- fields = [];
-
- for (const field of index.fields) {
- fields.push({
- type: 'index-field',
- name: field,
- order: index.descendings.indexOf(field) < 0,
- unique: index.unique,
- cacheName: meta.cacheName,
- typeName
- });
- }
-
- if (fields.length > 0) {
- indexes.push({
- type: 'index',
- name: index.name,
- children: fields,
- cacheName: meta.cacheName,
- typeName
- });
- }
- }
+ const indexes = [];
- columns = _.sortBy(columns, 'name');
+ for (const index of meta.indexes[typeName]) {
+ fields = [];
- if (!_.isEmpty(indexes)) {
- columns = columns.concat({
- type: 'indexes',
- name: 'Indexes',
+ for (const field of index.fields) {
+ fields.push({
+ type: 'index-field',
+ name: field,
+ order: index.descendings.indexOf(field) < 0,
+ unique: index.unique,
cacheName: meta.cacheName,
- typeName,
- children: indexes
+ typeName
});
}
- return {
- type: 'type',
- cacheName: meta.cacheName || '',
+ if (fields.length > 0) {
+ indexes.push({
+ type: 'index',
+ name: index.name,
+ children: fields,
+ cacheName: meta.cacheName,
+ typeName
+ });
+ }
+ }
+
+ columns = _.sortBy(columns, 'name');
+
+ if (!_.isEmpty(indexes)) {
+ columns = columns.concat({
+ type: 'indexes',
+ name: 'Indexes',
+ cacheName: meta.cacheName,
typeName,
- children: columns
- };
- });
+ children: indexes
+ });
+ }
+
+ return {
+ type: 'type',
+ cacheName: meta.cacheName || '',
+ typeName,
+ children: columns
+ };
+ };
+
+ for (const meta of caches) {
+ const cacheTypes = meta.types.map(_typeMapper.bind(null, meta));
if (!_.isEmpty(cacheTypes))
types = types.concat(cacheTypes);
@@ -330,7 +334,7 @@ module.exports.factory = function(_, express, apacheIgnite, fs, JSZip, settings,
.catch(_handleException(res));
});
- resolve(router);
+ resolveFactory(router);
});
};
[21/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/33061ca9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/33061ca9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/33061ca9
Branch: refs/heads/ignite-843-rc3
Commit: 33061ca97f322abe0907cb6fbb885c5c06e24d9b
Parents: da47087
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 16:15:56 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:15:56 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/caches.js | 112 ++++++-----
.../src/main/js/serve/routes/clusters.js | 131 ++++++------
.../src/main/js/serve/routes/domains.js | 200 +++++++++----------
3 files changed, 219 insertions(+), 224 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/33061ca9/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 bb7097a..be29633 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
@@ -34,56 +34,54 @@ module.exports.factory = function(_, express, mongo) {
* @param req Request.
* @param res Response.
*/
- router.post('/list', function(req, res) {
+ router.post('/list', (req, res) => {
const user_id = req.currentUserId();
// Get owned space and all accessed space.
- mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function(errSpace, spaces) {
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
if (mongo.processed(errSpace, res)) {
- const space_ids = spaces.map(function(value) {
- return value._id;
- });
+ const space_ids = spaces.map((value) => value._id);
// Get all clusters for spaces.
- mongo.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function(errCluster, clusters) {
+ mongo.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec((errCluster, clusters) => {
if (mongo.processed(errCluster, res)) {
// Get all domain models for spaces.
- mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function(errDomainModel, domains) {
+ mongo.DomainModel.find({space: {$in: space_ids}}).sort('name').exec((errDomainModel, domains) => {
if (mongo.processed(errDomainModel, 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((err, caches) => {
if (mongo.processed(err, res)) {
- _.forEach(clusters, function(cluster) {
- cluster.caches = _.filter(cluster.caches, function(cacheId) {
+ _.forEach(clusters, (cluster) => {
+ cluster.caches = _.filter(cluster.caches, (cacheId) => {
return _.find(caches, {_id: cacheId});
});
});
- _.forEach(domains, function(domain) {
- domain.caches = _.filter(domain.caches, function(cacheId) {
+ _.forEach(domains, (domain) => {
+ domain.caches = _.filter(domain.caches, (cacheId) => {
return _.find(caches, {_id: cacheId});
});
});
- _.forEach(caches, function(cache) {
+ _.forEach(caches, (cache) => {
// Remove deleted clusters.
- cache.clusters = _.filter(cache.clusters, function(clusterId) {
- return _.findIndex(clusters, function(cluster) {
+ cache.clusters = _.filter(cache.clusters, (clusterId) => {
+ return _.findIndex(clusters, (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, (metaId) => {
+ return _.findIndex(domains, (domain) => {
return domain._id.equals(metaId);
}) >= 0;
});
});
res.json({
- spaces: spaces,
- clusters: clusters.map(function(cluster) {
+ spaces,
+ clusters: clusters.map((cluster) => {
return {
value: cluster._id,
label: cluster.name,
@@ -106,25 +104,26 @@ module.exports.factory = function(_, express, mongo) {
/**
* Save cache.
*/
- router.post('/save', function(req, res) {
+ router.post('/save', (req, res) => {
const params = req.body;
const clusters = params.clusters;
const domains = params.domains;
let cacheId = params._id;
if (params._id) {
- 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) {
- if (mongo.processed(err, res)) {
- 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) {
- if (mongo.processed(err, res))
- mongo.DomainModel.update({_id: {$nin: domains}}, {$pull: {caches: cacheId}}, {multi: true}, function (err) {
- if (mongo.processed(err, res))
+ mongo.Cache.update({_id: cacheId}, params, {upsert: true}, (errCache) => {
+ if (mongo.processed(errCache, res)) {
+ mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, (errClusterAdd) => {
+ if (mongo.processed(errClusterAdd, res)) {
+ mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {caches: cacheId}}, {multi: true}, (errClusterPull) => {
+ if (mongo.processed(errClusterPull, res)) {
+ mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, (errDomainModelAdd) => {
+ if (mongo.processed(errDomainModelAdd, res)) {
+ mongo.DomainModel.update({_id: {$nin: domains}}, {$pull: {caches: cacheId}}, {multi: true}, (errDomainModelPull) => {
+ if (mongo.processed(errDomainModelPull, res))
res.send(params._id);
});
+ }
});
}
});
@@ -133,34 +132,36 @@ module.exports.factory = function(_, express, mongo) {
}
});
}
- else
- 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) {
- if (mongo.processed(err, res)) {
+ else {
+ mongo.Cache.findOne({space: params.space, name: params.name}, (errCacheFind, cacheFound) => {
+ if (mongo.processed(errCacheFind, res)) {
+ if (cacheFound)
+ return res.status(500).send('Cache with name: "' + cacheFound.name + '" already exist.');
+
+ (new mongo.Cache(params)).save((errCacheSave, cache) => {
+ if (mongo.processed(errCacheSave, res)) {
cacheId = cache._id;
- 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) {
- if (mongo.processed(err, res))
+ mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res)) {
+ mongo.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, (errDomainModel) => {
+ if (mongo.processed(errDomainModel, res))
res.send(cacheId);
});
+ }
});
}
});
}
});
+ }
});
/**
* Remove cache by ._id.
*/
- router.post('/remove', function(req, res) {
- mongo.Cache.remove(req.body, function(err) {
+ router.post('/remove', (req, res) => {
+ mongo.Cache.remove(req.body, (err) => {
if (mongo.processed(err, res))
res.sendStatus(200);
});
@@ -169,26 +170,27 @@ module.exports.factory = function(_, express, mongo) {
/**
* Remove all caches.
*/
- router.post('/remove/all', function(req, res) {
+ router.post('/remove/all', (req, res) => {
const 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) {
- if (mongo.processed(err, res)) {
- const space_ids = spaces.map(function(value) {
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => {
return value._id;
});
- mongo.Cache.remove({space: {$in: space_ids}}, function(err) {
- if (err)
- return res.status(500).send(err.message);
+ mongo.Cache.remove({space: {$in: space_ids}}, (errCache) => {
+ if (errCache)
+ return res.status(500).send(errCache.message);
- 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) {
- if (mongo.processed(err, res))
+ mongo.Cluster.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res)) {
+ mongo.DomainModel.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, (errDomainModel) => {
+ if (mongo.processed(errDomainModel, res))
res.sendStatus(200);
});
+ }
});
});
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/33061ca9/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 4c5a92e..0ca2fed 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
@@ -32,61 +32,55 @@ module.exports.factory = function(_, express, mongo) {
* @param req Request.
* @param res Response.
*/
- router.post('/list', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/list', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
// Get all caches for spaces.
- mongo.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec(function(err, caches) {
- if (mongo.processed(err, res)) {
+ mongo.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec((errCache, caches) => {
+ if (mongo.processed(errCache, res)) {
// Get all IGFSs for spaces.
- 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) {
- if (mongo.processed(err, res)) {
- _.forEach(caches, function(cache) {
+ mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec((errIgfs, igfss) => {
+ if (mongo.processed(errIgfs, res)) {
+ // Get all clusters for spaces.
+ mongo.Cluster.find({space: {$in: space_ids}}).sort('name').deepPopulate(mongo.ClusterDefaultPopulate).exec((errCluster, clusters) => {
+ if (mongo.processed(errCluster, res)) {
+ _.forEach(caches, (cache) => {
// Remove deleted caches.
- cache.clusters = _.filter(cache.clusters, function(clusterId) {
+ cache.clusters = _.filter(cache.clusters, (clusterId) => {
return _.find(clusters, {_id: clusterId});
});
});
- _.forEach(igfss, function(igfs) {
+ _.forEach(igfss, (igfs) => {
// Remove deleted caches.
- igfs.clusters = _.filter(igfs.clusters, function(clusterId) {
+ igfs.clusters = _.filter(igfs.clusters, (clusterId) => {
return _.find(clusters, {_id: clusterId});
});
});
- _.forEach(clusters, function(cluster) {
+ _.forEach(clusters, (cluster) => {
// Remove deleted caches.
- cluster.caches = _.filter(cluster.caches, function(cacheId) {
+ cluster.caches = _.filter(cluster.caches, (cacheId) => {
return _.find(caches, {_id: cacheId});
});
// Remove deleted IGFS.
- cluster.igfss = _.filter(cluster.igfss, function(igfsId) {
- return _.findIndex(igfss, function(igfs) {
- return igfs._id.equals(igfsId);
- }) >= 0;
+ cluster.igfss = _.filter(cluster.igfss, (igfsId) => {
+ return _.findIndex(igfss, (igfs) => {
+ return igfs._id.equals(igfsId);
+ }) >= 0;
});
});
- res.json({
- spaces: spaces,
- caches: caches,
- igfss: igfss,
- clusters: clusters
- });
+ res.json({ spaces, caches, igfss, clusters });
}
});
+ }
});
}
});
@@ -97,35 +91,37 @@ module.exports.factory = function(_, express, mongo) {
/**
* Save cluster.
*/
- 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) {
- if (mongo.processed(err, res))
- 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) {
- if (mongo.processed(err, res))
+ router.post('/save', (req, res) => {
+ const params = req.body;
+ const caches = params.caches;
+ let clusterId = params._id;
+
+ if (params._id) {
+ mongo.Cluster.update({_id: params._id}, params, {upsert: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res)) {
+ mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, (errCacheAdd) => {
+ if (mongo.processed(errCacheAdd, res)) {
+ mongo.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}, (errCachePull) => {
+ if (mongo.processed(errCachePull, res))
res.send(params._id);
});
}
});
+ }
});
+ }
else {
- 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.');
+ mongo.Cluster.findOne({space: params.space, name: params.name}, (errClusterFound, clusterFound) => {
+ if (mongo.processed(errClusterFound, res)) {
+ if (clusterFound)
+ return res.status(500).send('Cluster with name: "' + clusterFound.name + '" already exist.');
- (new mongo.Cluster(params)).save(function(err, cluster) {
- if (mongo.processed(err, res)) {
+ (new mongo.Cluster(params)).save((errCluster, cluster) => {
+ if (mongo.processed(errCluster, res)) {
clusterId = cluster._id;
- mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function(err) {
- if (mongo.processed(err, res))
+ mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, (errCacheAdd) => {
+ if (mongo.processed(errCacheAdd, res))
res.send(clusterId);
});
}
@@ -138,8 +134,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', (req, res) => {
+ mongo.Cluster.remove(req.body, (err) => {
if (err)
return res.status(500).send(err.message);
@@ -150,26 +146,25 @@ module.exports.factory = function(_, express, mongo) {
/**
* Remove all clusters.
*/
- router.post('/remove/all', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/remove/all', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
-
- 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) {
- if (mongo.processed(err, res))
- mongo.Igfs.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function(err) {
- if (mongo.processed(err, res))
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
+
+ mongo.Cluster.remove({space: {$in: space_ids}}, (errCluster) => {
+ if (errCluster)
+ return res.status(500).send(errCluster.message);
+
+ mongo.Cache.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, (errCache) => {
+ if (mongo.processed(errCache, res)) {
+ mongo.Igfs.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, (errIgfs) => {
+ if (mongo.processed(errIgfs, res))
res.sendStatus(200);
});
+ }
});
});
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/33061ca9/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 43240ec..c2417a1 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
@@ -32,45 +32,41 @@ module.exports.factory = function(_, express, async, mongo) {
* @param req Request.
* @param res Response.
*/
- router.post('/list', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/list', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
// Get all clusters for spaces.
- mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function(err, clusters) {
- if (mongo.processed(err, res)) {
+ mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec((errCluster, clusters) => {
+ if (mongo.processed(errCluster, res)) {
// Get all caches for spaces.
- mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec(function(err, caches) {
- if (mongo.processed(err, res)) {
+ mongo.Cache.find({space: {$in: space_ids}}).sort('name').exec((errCache, caches) => {
+ if (mongo.processed(errCache, res)) {
// Get all domain models for spaces.
- 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) {
+ mongo.DomainModel.find({space: {$in: space_ids}}).sort('valueType').exec((errDomainModel, domains) => {
+ if (mongo.processed(errDomainModel, res)) {
+ _.forEach(caches, (cache) => {
+ cache.domains = _.filter(cache.domains, (metaId) => {
return _.find(domains, {_id: metaId});
});
});
// Remove deleted caches.
- _.forEach(domains, function(domain) {
- domain.caches = _.filter(domain.caches, function(cacheId) {
+ _.forEach(domains, (domain) => {
+ domain.caches = _.filter(domain.caches, (cacheId) => {
return _.find(caches, {_id: cacheId});
});
});
res.json({
- spaces: spaces,
- clusters: clusters.map(function(cluster) {
- return {value: cluster._id, label: cluster.name};
- }),
- caches: caches,
- domains: domains
+ spaces,
+ clusters: clusters.map((cluster) => ({value: cluster._id, label: cluster.name})),
+ caches,
+ domains
});
}
});
@@ -83,49 +79,52 @@ module.exports.factory = function(_, express, async, mongo) {
});
function _saveDomainModel(domain, savedDomains, callback) {
- var domainId = domain._id;
- var caches = domain.caches;
-
- var cacheStoreChanges = domain.cacheStoreChanges;
-
- if (domainId)
- 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) {
- if (err)
- callback(err);
- else
- mongo.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}, function(err) {
- if (err)
- callback(err);
+ const caches = domain.caches;
+ let domainId = domain._id;
+
+ const cacheStoreChanges = domain.cacheStoreChanges;
+
+ if (domainId) {
+ mongo.DomainModel.update({_id: domain._id}, domain, {upsert: true}, (errDomainModel) => {
+ if (errDomainModel)
+ callback(errDomainModel);
+ else {
+ mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, (errCacheAdd) => {
+ if (errCacheAdd)
+ callback(errCacheAdd);
+ else {
+ mongo.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}, (errCachePull) => {
+ if (errCachePull)
+ callback(errCachePull);
else {
savedDomains.push(domain);
_updateCacheStore(cacheStoreChanges, callback);
}
});
+ }
});
+ }
});
- else
- mongo.DomainModel.findOne({space: domain.space, valueType: domain.valueType}, function(err, found) {
- if (err)
- callback(err);
+ }
+ else {
+ mongo.DomainModel.findOne({space: domain.space, valueType: domain.valueType}, (errDomainModelFind, found) => {
+ if (errDomainModelFind)
+ callback(errDomainModelFind);
else if (found)
return callback('Domain model with value type: "' + found.valueType + '" already exist.');
- (new mongo.DomainModel(domain)).save(function(err, domain) {
- if (err)
- callback(err);
+ (new mongo.DomainModel(domain)).save((errDomainModel, domainSaved) => {
+ if (errDomainModel)
+ callback(errDomainModel);
else {
- domainId = domain._id;
+ domainId = domainSaved._id;
- mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function(err) {
- if (err)
- callback(err);
+ mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, (errCache) => {
+ if (errCache)
+ callback(errCache);
else {
- savedDomains.push(domain);
+ savedDomains.push(domainSaved);
_updateCacheStore(cacheStoreChanges, callback);
}
@@ -133,16 +132,17 @@ 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, (change, idx, cb) => {
+ mongo.Cache.update({_id: {$eq: change.cacheId}}, change.change, {}, (err) => {
if (err)
- callback(err);
+ cb(err);
else
- callback();
+ cb();
});
}, callback);
}
@@ -151,31 +151,31 @@ module.exports.factory = function(_, express, async, mongo) {
}
function _save(domains, res) {
- var savedDomains = [];
- var generatedCaches = [];
+ const savedDomains = [];
+ const generatedCaches = [];
- if (domains && domains.length > 0)
- async.forEachOf(domains, function(domain, idx, callback) {
+ if (domains && domains.length > 0) {
+ async.forEachOf(domains, (domain, idx, callback) => {
if (domain.newCache) {
- mongo.Cache.findOne({space: domain.space, name: domain.newCache.name}, function(err, cache) {
- if (mongo.processed(err, res))
- if (cache) {
+ mongo.Cache.findOne({space: domain.space, name: domain.newCache.name}, (errCacheFind, cacheFound) => {
+ if (mongo.processed(errCacheFind, res)) {
+ if (cacheFound) {
// Cache already exists, just save domain model.
- domain.caches = [cache._id];
+ domain.caches = [cacheFound._id];
_saveDomainModel(domain, savedDomains, callback);
}
else {
// If cache not found, then create it and associate with domain model.
- var newCache = domain.newCache;
+ const newCache = domain.newCache;
newCache.space = domain.space;
- (new mongo.Cache(newCache)).save(function(err, cache) {
- var cacheId = cache._id;
+ (new mongo.Cache(newCache)).save((errCache, cache) => {
+ const cacheId = cache._id;
- if (mongo.processed(err, res)) {
- mongo.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function(err) {
- if (mongo.processed(err, res)) {
+ if (mongo.processed(errCache, res)) {
+ mongo.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res)) {
domain.caches = [cacheId];
generatedCaches.push(cache);
@@ -185,16 +185,18 @@ module.exports.factory = function(_, express, async, mongo) {
}
});
}
+ }
});
}
else
_saveDomainModel(domain, savedDomains, callback);
- }, function(err) {
+ }, (err) => {
if (err)
res.status(500).send(err.message);
else
- res.send({savedDomains: savedDomains, generatedCaches: generatedCaches});
+ res.send({savedDomains, generatedCaches});
});
+ }
else
res.status(500).send('Nothing to save!');
}
@@ -202,22 +204,22 @@ module.exports.factory = function(_, express, async, mongo) {
/**
* Save domain model.
*/
- router.post('/save', function(req, res) {
+ router.post('/save', (req, res) => {
_save([req.body], res);
});
/**
* Batch save domain models.
*/
- router.post('/save/batch', function(req, res) {
+ router.post('/save/batch', (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', (req, res) => {
+ mongo.DomainModel.remove(req.body, (err) => {
if (mongo.processed(err, res))
res.sendStatus(200);
});
@@ -226,22 +228,20 @@ module.exports.factory = function(_, express, async, mongo) {
/**
* Remove all domain models.
*/
- router.post('/remove/all', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/remove/all', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
- mongo.DomainModel.remove({space: {$in: space_ids}}, function(err) {
- if (err)
- return res.status(500).send(err.message);
+ mongo.DomainModel.remove({space: {$in: space_ids}}, (errDomainModel) => {
+ if (errDomainModel)
+ return res.status(500).send(errDomainModel.message);
- mongo.Cache.update({space: {$in: space_ids}}, {domains: []}, {multi: true}, function(err) {
- if (mongo.processed(err, res))
+ mongo.Cache.update({space: {$in: space_ids}}, {domains: []}, {multi: true}, (errCache) => {
+ if (mongo.processed(errCache, res))
res.sendStatus(200);
});
});
@@ -252,25 +252,23 @@ module.exports.factory = function(_, express, async, mongo) {
/**
* Remove all generated demo domain models and caches.
*/
- router.post('/remove/demo', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/remove/demo', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
// Remove all demo domain models.
- mongo.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function(err) {
- if (err)
- return res.status(500).send(err.message);
+ mongo.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, (errDomainModel) => {
+ if (errDomainModel)
+ return res.status(500).send(errDomainModel.message);
// Remove all demo caches.
- mongo.Cache.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function(err) {
- if (err)
- return res.status(500).send(err.message);
+ mongo.Cache.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, (errCache) => {
+ if (errCache)
+ return res.status(500).send(errCache.message);
res.sendStatus(200);
});
[14/29] ignite git commit: IGNITE-843 Refactor serve to es6.
Posted by ak...@apache.org.
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/fdf9ddc4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fdf9ddc4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fdf9ddc4
Branch: refs/heads/ignite-843-rc3
Commit: fdf9ddc4e3a05bbf1e7e4d7a4fb676cc00866c93
Parents: 2023470
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 13:51:08 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 13:51:08 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/agent.js | 112 +++++++++----------
.../src/main/js/serve/settings.js | 8 +-
2 files changed, 61 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdf9ddc4/modules/control-center-web/src/main/js/serve/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/agent.js b/modules/control-center-web/src/main/js/serve/agent.js
index 3470dfe..6c54ae1 100644
--- a/modules/control-center-web/src/main/js/serve/agent.js
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -24,7 +24,52 @@ module.exports = {
inject: ['require(fs)', 'require(ws)', 'require(apache-ignite)', 'mongo']
};
-module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
+module.exports.factory = function(fs, ws, apacheIgnite, mongo) {
+ /**
+ * Creates an instance of server for Ignite.
+ */
+ class AgentServer {
+ /**
+ * @this {AgentServer}
+ * @param {Agent} agent Connected agent
+ * @param {Boolean} demo Use demo node for request
+ */
+ constructor(agent, demo) {
+ this._agent = agent;
+ this._demo = !!demo;
+ }
+
+ /**
+ * Run http request
+ *
+ * @this {AgentServer}
+ * @param {cmd} cmd Command
+ * @param {callback} callback on finish
+ */
+ runCommand(cmd, callback) {
+ const params = {cmd: cmd.name()};
+
+ for (const param of cmd._params)
+ params[param.key] = param.value;
+
+ let body;
+
+ let headers;
+
+ let method = 'GET';
+
+ if (cmd._isPost()) {
+ body = cmd.postData();
+
+ method = 'POST';
+
+ headers = {JSONObject: 'application/json'};
+ }
+
+ this._agent.executeRest('ignite', params, this._demo, method, headers, body, callback);
+ }
+ }
+
class Agent {
/**
* @param {AgentManager} manager
@@ -64,7 +109,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
resolve(res);
})
);
- };
+ }
/**
* @param {String} uri
@@ -140,7 +185,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
};
this._invokeRmtMethod('executeRest', [uri, params, demo, method, headers, body], _cb);
- };
+ }
/**
* @param {?String} error
@@ -178,7 +223,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
*/
availableDrivers() {
return this._runCommand('availableDrivers', []);
- };
+ }
/**
* Run http request
@@ -207,7 +252,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
}
this._wsSrv.send(JSON.stringify(msg));
- };
+ }
_rmtAuthMessage(msg) {
const self = this;
@@ -240,7 +285,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
}
});
});
- };
+ }
_rmtCallRes(msg) {
const callback = this._cbMap[msg.reqId];
@@ -251,59 +296,14 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
delete this._cbMap[msg.reqId];
callback(msg.error, msg.response);
- };
+ }
/**
* @returns {Ignite}
*/
ignite(demo) {
return demo ? this._demo : this._cluster;
- };
- }
-
- /**
- * Creates an instance of server for Ignite.
- */
- class AgentServer {
- /**
- * @this {AgentServer}
- * @param {Agent} agent Connected agent
- * @param {Boolean} demo Use demo node for request
- */
- constructor(agent, demo) {
- this._agent = agent;
- this._demo = !!demo;
}
-
- /**
- * Run http request
- *
- * @this {AgentServer}
- * @param {cmd} cmd Command
- * @param {callback} callback on finish
- */
- runCommand(cmd, callback) {
- const params = {cmd: cmd.name()};
-
- for (const param of cmd._params)
- params[param.key] = param.value;
-
- let body;
-
- let headers;
-
- let method = 'GET';
-
- if (cmd._isPost()) {
- body = cmd.postData();
-
- method = 'POST';
-
- headers = {JSONObject: 'application/json'};
- }
-
- this._agent.executeRest('ignite', params, this._demo, method, headers, body, callback);
- };
}
class AgentManager {
@@ -328,7 +328,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
const self = this;
this._wsSrv.on('connection', (_wsSrv) => new Agent(_wsSrv, self));
- };
+ }
/**
* @param userId
@@ -346,7 +346,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
if (agents.length === 0)
delete this._agents[userId];
}
- };
+ }
/**
* @param {ObjectId} userId
@@ -362,7 +362,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
}
agents.push(agent);
- };
+ }
/**
* @param {ObjectId} userId
@@ -375,7 +375,7 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
return null;
return agents[0];
- };
+ }
}
return new AgentManager();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdf9ddc4/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 6e4b619..f3d19d9 100644
--- a/modules/control-center-web/src/main/js/serve/settings.js
+++ b/modules/control-center-web/src/main/js/serve/settings.js
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
@@ -23,13 +25,13 @@ module.exports = {
};
module.exports.factory = function(nconf, fs) {
- nconf.file({'file': './serve/config/default.json'});
+ nconf.file({file: './serve/config/default.json'});
/**
* Normalize a port into a number, string, or false.
*/
const _normalizePort = function(val) {
- var port = parseInt(val, 10);
+ const port = parseInt(val, 10);
// named pipe
if (isNaN(port))
@@ -52,7 +54,7 @@ module.exports.factory = function(nconf, fs) {
passphrase: nconf.get('agent-server:keyPassphrase')
}
},
- server : {
+ server: {
port: _normalizePort(nconf.get('server:port') || 80),
SSLOptions: nconf.get('server:ssl') && {
enable301Redirects: true,
[03/29] ignite git commit: IGNITE-2287 Import data only for selected
filtered objects.
Posted by ak...@apache.org.
IGNITE-2287 Import data only for selected filtered objects.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5d0fbe56
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5d0fbe56
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5d0fbe56
Branch: refs/heads/ignite-843-rc3
Commit: 5d0fbe56128fce239ff30df11ec653aad5139749
Parents: 0ea9dbe
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Fri Feb 12 08:47:15 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 08:47:15 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/domains-controller.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5d0fbe56/modules/control-center-web/src/main/js/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/domains-controller.js b/modules/control-center-web/src/main/js/controllers/domains-controller.js
index cc7ed92..c04e4d5 100644
--- a/modules/control-center-web/src/main/js/controllers/domains-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/domains-controller.js
@@ -616,7 +616,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
preset.schemas = [];
- _.forEach($scope.importDomain.schemas, function (schema) {
+ _.forEach($scope.importDomain.displayedSchemas, function (schema) {
if (schema.use)
preset.schemas.push(schema.name);
});
@@ -807,7 +807,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
};
}
- _.forEach($scope.importDomain.tables, function (table) {
+ _.forEach($scope.importDomain.displayedTables, function (table) {
if (table.use) {
var qryFields = [];
var indexes = [];
[10/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/a4a0ebdc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4a0ebdc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4a0ebdc
Branch: refs/heads/ignite-843-rc3
Commit: a4a0ebdc55577786a05e069b02d9dd066ddf22c0
Parents: 9c0d808
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 10:20:16 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 10:20:16 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/agent.js | 1 +
.../src/main/js/serve/configure.js | 12 ++++-----
.../src/main/js/serve/mongo.js | 26 +++++++++++---------
3 files changed, 21 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a4a0ebdc/modules/control-center-web/src/main/js/serve/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/agent.js b/modules/control-center-web/src/main/js/serve/agent.js
index 89497e7..f750047 100644
--- a/modules/control-center-web/src/main/js/serve/agent.js
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -16,6 +16,7 @@
*/
// Fire me up!
+'use strict';
module.exports = {
implements: 'agent',
http://git-wip-us.apache.org/repos/asf/ignite/blob/a4a0ebdc/modules/control-center-web/src/main/js/serve/configure.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/configure.js b/modules/control-center-web/src/main/js/serve/configure.js
index c16b516..ea8a484 100644
--- a/modules/control-center-web/src/main/js/serve/configure.js
+++ b/modules/control-center-web/src/main/js/serve/configure.js
@@ -16,6 +16,7 @@
*/
// Fire me up!
+'use strict';
module.exports = {
implements: 'configure',
@@ -23,11 +24,10 @@ module.exports = {
'require(express-session)', 'require(connect-mongo)', 'require(passport)', 'settings', 'mongo']
};
-module.exports.factory = function (logger, cookieParser, bodyParser, forceSSL, session, connectMongo, passport,
- settings, mongo) {
+module.exports.factory = function(logger, cookieParser, bodyParser, forceSSL, session, connectMongo, passport, settings, mongo) {
return (app) => {
app.use(logger('dev', {
- skip: function (req, res) {
+ skip: function(req, res) {
return res.statusCode < 400;
}
}));
@@ -37,7 +37,7 @@ module.exports.factory = function (logger, cookieParser, bodyParser, forceSSL, s
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
- var mongoStore = connectMongo(session);
+ const mongoStore = connectMongo(session);
app.use(session({
secret: settings.sessionSecret,
@@ -46,8 +46,8 @@ module.exports.factory = function (logger, cookieParser, bodyParser, forceSSL, s
cookie: {
expires: new Date(Date.now() + settings.cookieTTL),
maxAge: settings.cookieTTL
- }
- , store: new mongoStore({mongooseConnection: mongo.connection})
+ },
+ store: new mongoStore({mongooseConnection: mongo.connection})
}));
app.use(passport.initialize());
http://git-wip-us.apache.org/repos/asf/ignite/blob/a4a0ebdc/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 26cccd8..d423098 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -16,14 +16,15 @@
*/
// Fire me up!
+'use strict';
module.exports = {
implements: 'mongo',
inject: ['require(mongoose-deep-populate)', 'require(passport-local-mongoose)', 'settings', 'ignite_modules/mongo:*']
};
-module.exports.factory = function (deepPopulatePlugin, passportMongo, settings, pluginMongo) {
- var mongoose = require('mongoose');
+module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, pluginMongo) {
+ const mongoose = require('mongoose');
const deepPopulate = deepPopulatePlugin(mongoose);
@@ -34,7 +35,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
result = { connection: mongoose.connection };
// Define Account schema.
- var AccountSchema = new Schema({
+ const AccountSchema = new Schema({
username: String,
email: String,
company: String,
@@ -53,7 +54,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
// Configure transformation to JSON.
AccountSchema.set('toJSON', {
- transform: function (doc, ret) {
+ transform: function(doc, ret) {
return {
_id: ret._id,
email: ret.email,
@@ -81,7 +82,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
}));
// Define Domain model schema.
- var DomainModelSchema = new Schema({
+ const DomainModelSchema = new Schema({
space: {type: ObjectId, ref: 'Space'},
caches: [{type: ObjectId, ref: 'Cache'}],
queryMetadata: {type: String, enum: ['Annotations', 'Configuration']},
@@ -116,7 +117,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
result.DomainModel = mongoose.model('DomainModel', DomainModelSchema);
// Define Cache schema.
- var CacheSchema = new Schema({
+ const CacheSchema = new Schema({
space: {type: ObjectId, ref: 'Space'},
name: String,
clusters: [{type: ObjectId, ref: 'Cluster'}],
@@ -249,7 +250,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
// Define Cache model.
result.Cache = mongoose.model('Cache', CacheSchema);
- var IgfsSchema = new Schema({
+ const IgfsSchema = new Schema({
space: {type: ObjectId, ref: 'Space'},
name: String,
clusters: [{type: ObjectId, ref: 'Cluster'}],
@@ -295,7 +296,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
result.Igfs = mongoose.model('Igfs', IgfsSchema);
// Define Cluster schema.
- var ClusterSchema = new Schema({
+ const ClusterSchema = new Schema({
space: {type: ObjectId, ref: 'Space'},
name: String,
localHost: String,
@@ -497,7 +498,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
result.ClusterDefaultPopulate = '';
// Define Notebook schema.
- var NotebookSchema = new Schema({
+ const NotebookSchema = new Schema({
space: {type: ObjectId, ref: 'Space'},
name: String,
expandedParagraphs: [Number],
@@ -521,9 +522,9 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
// Define Notebook model.
result.Notebook = mongoose.model('Notebook', NotebookSchema);
- result.upsert = function (model, data, cb) {
+ result.upsert = function(model, data, cb) {
if (data._id) {
- var id = data._id;
+ const id = data._id;
delete data._id;
@@ -544,9 +545,10 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
};
// Registering the routes of all plugin modules
- for (var name in pluginMongo)
+ for (var name in pluginMongo) {
if (pluginMongo.hasOwnProperty(name))
pluginMongo[name].register(mongoose, deepPopulate, result);
+ }
return result;
};
[07/29] ignite git commit: Merge remote-tracking branch
'origin/ignite-843-rc2' into ignite-843-rc2
Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/ignite-843-rc2' into ignite-843-rc2
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/11c6e0a1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/11c6e0a1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/11c6e0a1
Branch: refs/heads/ignite-843-rc3
Commit: 11c6e0a1c60c2534b6dad3697877c8ea26f8077e
Parents: 0569a4b f7beeac
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 09:47:31 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 09:47:31 2016 +0700
----------------------------------------------------------------------
.../src/main/js/helpers/generator/generator-docker.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[05/29] ignite git commit: IGNITE-843 Fixed docker generation.
Posted by ak...@apache.org.
IGNITE-843 Fixed docker generation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f7beeac9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f7beeac9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f7beeac9
Branch: refs/heads/ignite-843-rc3
Commit: f7beeac9620a0bdcaf850d8e8f9dc3b587b10fd1
Parents: c16d466
Author: Andrey <an...@gridgain.com>
Authored: Fri Feb 12 09:26:53 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 09:26:53 2016 +0700
----------------------------------------------------------------------
.../src/main/js/helpers/generator/generator-docker.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f7beeac9/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
index ca93feb..7e9721c 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
@@ -41,8 +41,8 @@ $generatorDocker.clusterDocker = function (cluster, version) {
'RUN mvn -f ' + cluster.name + '/pom.xml clean package -DskipTests\n\n' +
'# Copy project jars to node classpath.\n' +
'RUN mkdir $IGNITE_HOME/libs/' + cluster.name + ' && \\\n' +
- 'find ' + cluster.name + '/target -name "*.jar" -type f -exec cp {} $IGNITE_HOME/libs/' + cluster.name + ' \\; && \\\n' +
- 'cp -r ' + cluster.name + '/config/* $IGNITE_HOME/config\n'
+ ' find ' + cluster.name + '/target -name "*.jar" -type f -exec cp {} $IGNITE_HOME/libs/' + cluster.name + ' \\; && \\\n' +
+ ' cp -r ' + cluster.name + '/config/* $IGNITE_HOME/config\n'
};
[16/29] ignite git commit: IGNITE-843 Fixed dropdown container
binding to proper modal.
Posted by ak...@apache.org.
IGNITE-843 Fixed dropdown container binding to proper modal.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f3a0a5e9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f3a0a5e9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f3a0a5e9
Branch: refs/heads/ignite-843-rc3
Commit: f3a0a5e9f4e21bbdd5de2f56df7dbff19a30b5c3
Parents: 4f79a2d
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 14:19:28 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 14:19:28 2016 +0700
----------------------------------------------------------------------
.../main/js/views/configuration/domains-import.jade | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f3a0a5e9/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/domains-import.jade b/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
index d1877bd..759eb9e 100644
--- a/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/domains-import.jade
@@ -23,7 +23,7 @@ mixin td-ellipses-lbl(w, lbl)
td.td-ellipsis(width='#{w}' style='min-width: #{w}; max-width: #{w}')
label #{lbl}
-.modal.center(role='dialog')
+.modal.modal-domain-import.center(role='dialog')
.modal-dialog
.modal-content(dw-loading='importDomainFromDb' dw-loading-options='importDomain.loadingOptions')
#errors-container.modal-header.header
@@ -58,7 +58,7 @@ mixin td-ellipses-lbl(w, lbl)
.col-xs-8.col-sm-10.col-md-10
i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Select appropriate JAR with JDBC driver<br> To add another driver you need to place it into "/jdbc-drivers" folder of Ignite Web Agent<br> Refer to Ignite Web Agent README.txt for for more information')
.input-tip
- button.select-toggle.form-control(id='jdbcDriverJar' bs-select data-container='.modal' ng-model='ui.selectedJdbcDriverJar' ng-class='{placeholder: !(jdbcDriverJars && jdbcDriverJars.length > 0)}' placeholder='Choose JDBC driver' bs-options='item.value as item.label for item in jdbcDriverJars')
+ button.select-toggle.form-control(id='jdbcDriverJar' bs-select data-container='.modal-domain-import' ng-model='ui.selectedJdbcDriverJar' ng-class='{placeholder: !(jdbcDriverJars && jdbcDriverJars.length > 0)}' placeholder='Choose JDBC driver' bs-options='item.value as item.label for item in jdbcDriverJars')
.settings-row
label.col-xs-4.col-sm-2.col-md-2 JDBC Driver:
.col-xs-8.col-sm-10.col-md-10
@@ -144,9 +144,9 @@ mixin td-ellipses-lbl(w, lbl)
div.td-ellipsis
a(ng-if='!table.edit' ng-click='startEditDbTableCache(table)') {{tableActionView(table)}}
div(style='display: flex' ng-if='table.edit')
- button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' data-container='.modal' bs-options='item.value as item.shortLabel for item in importActions')
- button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' data-container='.modal' bs-options='item.value as item.label for item in table.cachesOrTemplates')
- //- button.select-toggle.form-control(ng-if='table.action==2' style='width: 65%; margin-right: 0' bs-select ng-model='table.cache' data-container='.modal' bs-options='item.value as item.label for item in importCurrentCaches')
+ button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' data-container='.modal-domain-import' bs-options='item.value as item.shortLabel for item in importActions')
+ button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in table.cachesOrTemplates')
+ //- button.select-toggle.form-control(ng-if='table.action==2' style='width: 65%; margin-right: 0' bs-select ng-model='table.cache' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importCurrentCaches')
td
.settings-row
label Defaults to be applied for filtered tables
@@ -154,9 +154,9 @@ mixin td-ellipses-lbl(w, lbl)
.settings-row
.col-sm-11
.col-sm-6(style='padding-right: 5px')
- button.select-toggle.form-control(bs-select ng-model='importCommon.action' data-container='.modal' bs-options='item.value as item.label for item in importActions')
+ button.select-toggle.form-control(bs-select ng-model='importCommon.action' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importActions')
.col-sm-6(style='padding-left: 5px; padding-right: 5px')
- button.select-toggle.form-control(bs-select ng-model='importCommon.cacheOrTemplate' data-container='.modal' bs-options='item.value as item.label for item in importCommon.cachesOrTemplates')
+ button.select-toggle.form-control(bs-select ng-model='importCommon.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importCommon.cachesOrTemplates')
.col-sm-1(style='padding-left: 5px')
button.btn.btn-primary(ng-click='applyDefaults()') Apply
.import-domain-model-wizard-page(ng-show='importDomain.action == "options"' style='margin-bottom: 176px')
@@ -186,7 +186,7 @@ mixin td-ellipses-lbl(w, lbl)
.col-xs-9.col-sm-10.col-md-10
i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Choose clusters that will be associated with generated caches')
.input-tip
- button.select-toggle.form-control(id='generatedCachesClusters' bs-select ng-model='ui.generatedCachesClusters' ng-class='{placeholder: !(ui.generatedCachesClusters && ui.generatedCachesClusters.length > 0)}' data-container='.modal' data-multiple='1' placeholder='Choose clusters for generated caches' bs-options='item.value as item.label for item in clusters')
+ button.select-toggle.form-control(id='generatedCachesClusters' bs-select ng-model='ui.generatedCachesClusters' ng-class='{placeholder: !(ui.generatedCachesClusters && ui.generatedCachesClusters.length > 0)}' data-container='.modal-domain-import' data-multiple='1' placeholder='Choose clusters for generated caches' bs-options='item.value as item.label for item in clusters')
.modal-footer
label(ng-hide='importDomain.action == "drivers" || (importDomain.action == "connect" && importDomain.demo)').labelField {{importDomain.info}}
a.btn.btn-primary(ng-hide='importDomain.action == "drivers" || importDomain.action == "connect"' ng-click='importDomainPrev()' bs-tooltip='' data-title='{{prevTooltipText()}}' data-placement='bottom') Prev
[25/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/b97d4121
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b97d4121
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b97d4121
Branch: refs/heads/ignite-843-rc3
Commit: b97d412104b49140304fcf0220eeead640c88129
Parents: 03916ab
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 16:30:05 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 16:30:05 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/routes/public.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b97d4121/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 1c78abd..476ded2 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
@@ -231,7 +231,7 @@ module.exports.factory = function(express, passport, nodemailer, settings, mongo
router.post('/validate/token', function(req, res) {
var token = req.body.token;
- var data = {token: token};
+ var data = {token};
mongo.Account.findOne({resetPasswordToken: token}, function(err, user) {
if (!user)
[15/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/4f79a2df
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f79a2df
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f79a2df
Branch: refs/heads/ignite-843-rc3
Commit: 4f79a2df23dc21ab7c3364ac33ff825e07a9e7a9
Parents: fdf9ddc
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 14:18:36 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 14:18:36 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/.eslintrc | 2 +-
modules/control-center-web/src/main/js/serve/mongo.js | 10 +++++-----
.../control-center-web/src/main/js/serve/routes/admin.js | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f79a2df/modules/control-center-web/src/main/js/.eslintrc
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/.eslintrc b/modules/control-center-web/src/main/js/.eslintrc
index b18ff6d..9174e14 100644
--- a/modules/control-center-web/src/main/js/.eslintrc
+++ b/modules/control-center-web/src/main/js/.eslintrc
@@ -56,7 +56,7 @@ rules:
generator-star-spacing: 0
guard-for-in: 1
handle-callback-err: 0
- id-length: [2, {"min": 1, "max": 30}]
+ id-length: [2, {"min": 1, "max": 40}]
indent: [2, 4, {"SwitchCase": 1}]
key-spacing: [2, { "beforeColon": false, "afterColon": true }]
lines-around-comment: 0
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f79a2df/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 3768e77..c0d5228 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -56,7 +56,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
// Configure transformation to JSON.
AccountSchema.set('toJSON', {
- transform: function(doc, ret) {
+ transform: (doc, ret) => {
return {
_id: ret._id,
email: ret.email,
@@ -524,16 +524,16 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
// Define Notebook model.
result.Notebook = mongoose.model('Notebook', NotebookSchema);
- result.upsert = function(model, data, cb) {
+ result.upsert = function(Model, data, cb) {
if (data._id) {
const id = data._id;
delete data._id;
- model.findOneAndUpdate({_id: id}, data, cb);
+ Model.findOneAndUpdate({_id: id}, data, cb);
}
else
- new model(data).save(cb);
+ new Model(data).save(cb);
};
result.processed = function(err, res) {
@@ -547,7 +547,7 @@ module.exports.factory = function(deepPopulatePlugin, passportMongo, settings, p
};
// Registering the routes of all plugin modules
- for (var name in pluginMongo) {
+ for (const name in pluginMongo) {
if (pluginMongo.hasOwnProperty(name))
pluginMongo[name].register(mongoose, deepPopulate, result);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f79a2df/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 09e6c21..765b8e8 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
@@ -40,14 +40,14 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
// Remove user.
router.post('/remove', function(req, res) {
- var userId = req.body.userId;
+ const userId = req.body.userId;
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) {
+ _.forEach(spaces, (space) => {
mongo.Cluster.remove({space: space._id}).exec();
mongo.Cache.remove({space: space._id}).exec();
mongo.DomainModel.remove({space: space._id}).exec();
@@ -56,7 +56,7 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
});
});
- var transporter = {
+ const transporter = {
service: settings.smtp.service,
auth: {
user: settings.smtp.email,
@@ -110,7 +110,7 @@ module.exports.factory = function(_, express, nodemailer, settings, mongo) {
req.session.viewedUser = viewedUser;
return res.sendStatus(200);
- })
+ });
});
// Become user.
[23/29] ignite git commit: IGNITE-843 Fixed project structure file
duplicates.
Posted by ak...@apache.org.
IGNITE-843 Fixed project structure file duplicates.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f44993ef
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f44993ef
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f44993ef
Branch: refs/heads/ignite-843-rc3
Commit: f44993eff678466ccd477c84d39756dcb4674fc8
Parents: 0ee811c
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Fri Feb 12 16:25:50 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 16:25:50 2016 +0700
----------------------------------------------------------------------
.../modules/states/configuration/summary/summary.controller.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f44993ef/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
index 46d9f0d..1e487a3 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
@@ -148,7 +148,7 @@ export default [
let children = null;
if (!_.isEmpty(node.children)) {
- children = _.find(node.children, {name: leaf});
+ children = _.find(node.children, {type: 'folder', name: leaf});
if (children)
return getOrCreateFolder(children, path);
@@ -170,7 +170,8 @@ export default [
const folder = getOrCreateFolder(javaFolder, path);
- folder.children.push({type: 'file', name: shortClsName});
+ if (!_.find(folder.children, {type: 'file', name: shortClsName}))
+ folder.children.push({type: 'file', name: shortClsName});
}
$scope.selectItem = (cluster) => {
[13/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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/2023470c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2023470c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2023470c
Branch: refs/heads/ignite-843-rc3
Commit: 2023470c3400ca39fe611661e074ec808bdce3a5
Parents: 0e11d41
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 13:47:26 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Feb 12 13:47:26 2016 +0700
----------------------------------------------------------------------
.../src/main/js/serve/routes/igfs.js | 121 ++++++++++---------
1 file changed, 61 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2023470c/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 f248531..f913b9b 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
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+'use strict';
+
// Fire me up!
module.exports = {
@@ -32,37 +34,36 @@ module.exports.factory = function(_, express, mongo) {
* @param req Request.
* @param res Response.
*/
- router.post('/list', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/list', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
- });
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
// Get all clusters for spaces.
- mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function(err, clusters) {
- if (mongo.processed(err, res)) {
+ mongo.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec((errCluster, clusters) => {
+ if (mongo.processed(errCluster, res)) {
// Get all IGFSs for spaces.
- mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function(err, igfss) {
- if (mongo.processed(err, res)) {
- _.forEach(igfss, function(igfs) {
+ mongo.Igfs.find({space: {$in: space_ids}}).sort('name').exec((errIgfs, igfss) => {
+ if (mongo.processed(errIgfs, res)) {
+ _.forEach(igfss, (igfs) => {
// Remove deleted clusters.
- igfs.clusters = _.filter(igfs.clusters, function(clusterId) {
- return _.findIndex(clusters, function(cluster) {
- return cluster._id.equals(clusterId);
- }) >= 0;
+ igfs.clusters = _.filter(igfs.clusters, (clusterId) => {
+ return _.findIndex(clusters, (cluster) => cluster._id.equals(clusterId)) >= 0;
});
});
res.json({
- spaces: spaces,
- clusters: clusters.map(function(cluster) {
- return {value: cluster._id, label: cluster.name};
+ spaces,
+ clusters: clusters.map((cluster) => {
+ return {
+ value: cluster._id,
+ label: cluster.name
+ };
}),
- igfss: igfss
+ igfss
});
}
});
@@ -75,75 +76,75 @@ module.exports.factory = function(_, express, mongo) {
/**
* Save IGFS.
*/
- router.post('/save', function(req, res) {
- var params = req.body;
- var igfsId = params._id;
- var clusters = params.clusters;
+ router.post('/save', (req, res) => {
+ const params = req.body;
+ const clusters = params.clusters;
+ let igfsId = params._id;
if (params._id) {
- 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) {
- if (mongo.processed(err, res))
- mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}, function(err) {
- if (mongo.processed(err, res))
+ mongo.Igfs.update({_id: igfsId}, params, {upsert: true}, (errIgfs) => {
+ if (mongo.processed(errIgfs, res)) {
+ mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, (errClusterAdd) => {
+ if (mongo.processed(errClusterAdd, res)) {
+ mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}, (errClusterPull) => {
+ if (mongo.processed(errClusterPull, res))
res.send(params._id);
});
+ }
});
- })
+ }
+ });
}
- else
- 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) {
- if (mongo.processed(err, res)) {
+ else {
+ mongo.Igfs.findOne({space: params.space, name: params.name}, (errIgfsFind, igfsFound) => {
+ if (mongo.processed(errIgfsFind, res)) {
+ if (igfsFound)
+ return res.status(500).send('IGFS with name: "' + igfsFound.name + '" already exist.');
+
+ (new mongo.Igfs(params)).save((errIgfsSave, igfs) => {
+ if (mongo.processed(errIgfsSave, res)) {
igfsId = igfs._id;
- mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function(err) {
- if (mongo.processed(err, res))
+ mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res))
res.send(igfsId);
});
}
});
}
});
+ }
});
/**
* Remove IGFS by ._id.
*/
- router.post('/remove', function(req, res) {
- mongo.Igfs.remove(req.body, function(err) {
+ router.post('/remove', (req, res) => {
+ mongo.Igfs.remove(req.body, (err) => {
if (mongo.processed(err, res))
res.sendStatus(200);
- })
+ });
});
/**
* Remove all IGFSs.
*/
- router.post('/remove/all', function(req, res) {
- var user_id = req.currentUserId();
+ router.post('/remove/all', (req, res) => {
+ const 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) {
- if (mongo.processed(err, res)) {
- var space_ids = spaces.map(function(value) {
- return value._id;
+ mongo.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, (errSpace, spaces) => {
+ if (mongo.processed(errSpace, res)) {
+ const space_ids = spaces.map((value) => value._id);
+
+ mongo.Igfs.remove({space: {$in: space_ids}}, (errIgfs) => {
+ if (mongo.processed(errIgfs, res)) {
+ mongo.Cluster.update({space: {$in: space_ids}}, {igfss: []}, {multi: true}, (errCluster) => {
+ if (mongo.processed(errCluster, res))
+ res.sendStatus(200);
+ });
+ }
});
-
- 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) {
- if (mongo.processed(err, res))
- res.sendStatus(200);
- });
- })
}
});
});
[11/29] ignite git commit: IGNITE-843 Fixed eslint warnings.
Posted by ak...@apache.org.
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-rc3
Commit: 0a7ac460fa0eae77767e552f4aabfd8da700ec97
Parents: a4a0ebd
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Feb 12 10:33:21 2016 +0700
Committer: Alexey Kuznetsov <ak...@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
[02/29] ignite git commit: IGNITE-843 Fixed update of next button
state on schema table filtering.
Posted by ak...@apache.org.
IGNITE-843 Fixed update of next button state on schema table filtering.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0ea9dbe0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0ea9dbe0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0ea9dbe0
Branch: refs/heads/ignite-843-rc3
Commit: 0ea9dbe064fbe832a5496a145ea8cc147e808f61
Parents: 07b4b85
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Fri Feb 12 08:46:01 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Feb 12 08:46:01 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/domains-controller.js | 5 +++--
.../src/main/js/views/configuration/igfs.jade | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ea9dbe0/modules/control-center-web/src/main/js/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/domains-controller.js b/modules/control-center-web/src/main/js/controllers/domains-controller.js
index c427307..cc7ed92 100644
--- a/modules/control-center-web/src/main/js/controllers/domains-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/domains-controller.js
@@ -1053,12 +1053,13 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
switch ($scope.importDomain.action) {
case 'schemas':
- res = $common.isEmptyArray($scope.importDomain.schemas) || $('#importSchemasData').find(':checked').length > 0;
+ res = $common.isEmptyArray($scope.importDomain.schemas) ||
+ _.find($scope.importDomain.displayedSchemas, {use: true});
break;
case 'tables':
- res = $('#importTableData').find(':checked').length > 0;
+ res = _.find($scope.importDomain.displayedTables, {use: true});
break;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ea9dbe0/modules/control-center-web/src/main/js/views/configuration/igfs.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/igfs.jade b/modules/control-center-web/src/main/js/views/configuration/igfs.jade
index 1bbff08..1a9d262 100644
--- a/modules/control-center-web/src/main/js/views/configuration/igfs.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/igfs.jade
@@ -23,6 +23,7 @@ include ../includes/infos
+ignite-igfs-information
div(dw-loading='loadingIgfsScreen' dw-loading-options='{text: "Loading IGFS screen...", className: "page-loading-overlay"}')
div(ng-show='ui.ready')
+ hr
+main-table('IGFS', 'igfss', 'igfsName', 'selectItem(row)', '{{$index + 1}}) {{row.name}}', 'name')
.padding-top-dflt(bs-affix)
.panel-tip-container(data-placement='bottom' bs-tooltip='' data-title='Create new IGFS')