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/09 10:26:00 UTC
[01/51] [abbrv] ignite git commit: IGNITE-843 Refactored server side.
Repository: ignite
Updated Branches:
refs/heads/ignite-843-rc3 407895a5c -> 125f56617
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..7d719e3
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/caches.js
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'caches-routes',
+ inject: ['require(lodash)', 'require(express)', 'mongo']
+};
+
+module.exports.factory = function (_, express, mongo) {
+ return new Promise((resolve) => {
+ const router = express.Router();
+
+ /**
+ * Get spaces and caches accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ if (mongo.processed(err, 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)) {
+ // Get all caches for spaces.
+ 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) {
+ return _.find(caches, {_id: cacheId});
+ });
+ });
+
+ _.forEach(domains, function (domain) {
+ domain.caches = _.filter(domain.caches, function (cacheId) {
+ return _.find(caches, {_id: cacheId});
+ });
+ });
+
+ _.forEach(caches, function (cache) {
+ // Remove deleted clusters.
+ 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) {
+ return domain._id.equals(metaId);
+ }) >= 0;
+ });
+ });
+
+ res.json({
+ spaces: spaces,
+ clusters: clusters.map(function (cluster) {
+ return {
+ value: cluster._id,
+ label: cluster.name,
+ caches: cluster.caches
+ };
+ }),
+ domains: domains,
+ caches: caches
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * Save cache.
+ */
+ 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) {
+ 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))
+ res.send(params._id);
+ });
+ });
+ });
+ });
+ })
+ }
+ 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)) {
+ 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))
+ res.send(cacheId);
+ });
+ });
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * Remove cache by ._id.
+ */
+ router.post('/remove', function (req, res) {
+ mongo.Cache.remove(req.body, function (err) {
+ if (mongo.processed(err, res))
+ res.sendStatus(200);
+ })
+ });
+
+ /**
+ * Remove all caches.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ var space_ids = spaces.map(function (value) {
+ return value._id;
+ });
+
+ 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) {
+ if (mongo.processed(err, res))
+ mongo.DomainModel.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function (err) {
+ if (mongo.processed(err, res))
+ res.sendStatus(200);
+ });
+ });
+ })
+ }
+ });
+ });
+
+ resolve(router);
+ });
+};
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..b740c01
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/clusters.js
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'clusters-routes',
+ inject: ['require(lodash)', 'require(express)', 'mongo']
+};
+
+module.exports.factory = function (_, express, mongo) {
+ return new Promise((resolve) => {
+ const router = express.Router();
+
+ /**
+ * Get spaces and clusters accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ if (mongo.processed(err, 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) {
+ // Remove deleted caches.
+ cache.clusters = _.filter(cache.clusters, function (clusterId) {
+ return _.find(clusters, {_id: clusterId});
+ });
+ });
+
+ _.forEach(igfss, function (igfs) {
+ // Remove deleted caches.
+ igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
+ return _.find(clusters, {_id: clusterId});
+ });
+ });
+
+ _.forEach(clusters, function (cluster) {
+ // Remove deleted caches.
+ 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) {
+ return igfs._id.equals(igfsId);
+ }) >= 0;
+ });
+ });
+
+ res.json({
+ spaces: spaces,
+ caches: caches,
+ igfss: igfss,
+ clusters: clusters
+ });
+ }
+ });
+ });
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * 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))
+ 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.');
+
+ (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) {
+ if (mongo.processed(err, res))
+ res.send(clusterId);
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+
+ /**
+ * Remove cluster by ._id.
+ */
+ router.post('/remove', function (req, res) {
+ mongo.Cluster.remove(req.body, function (err) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.sendStatus(200);
+ })
+ });
+
+ /**
+ * Remove all clusters.
+ */
+ 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) {
+ 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))
+ res.sendStatus(200);
+ });
+ });
+ })
+ }
+ });
+ });
+
+ resolve(router);
+ });
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..5e6e934
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/domains.js
@@ -0,0 +1,285 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'domains-routes',
+ inject: ['require(lodash)', 'require(express)', 'require(async)', 'mongo']
+};
+
+module.exports.factory = function (_, express, async, mongo) {
+ return new Promise((resolve) => {
+ const router = express.Router();
+
+ /**
+ * Get spaces and domain models accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ if (mongo.processed(err, res)) {
+ // Get all caches for spaces.
+ 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) {
+ if (mongo.processed(err, res)) {
+ _.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) {
+ 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
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ });
+
+ 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);
+ 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 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);
+ else {
+ domainId = domain._id;
+
+ mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function (err) {
+ if (err)
+ callback(err);
+ else {
+ savedDomains.push(domain);
+
+ _updateCacheStore(cacheStoreChanges, callback);
+ }
+ });
+ }
+ });
+ });
+ }
+
+ 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) {
+ if (err)
+ callback(err);
+ else
+ callback();
+ });
+ }, callback);
+ }
+ else
+ callback();
+ }
+
+ function _save(domains, res) {
+ var savedDomains = [];
+ var generatedCaches = [];
+
+ if (domains && domains.length > 0)
+ async.forEachOf(domains, function (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) {
+ // Cache already exists, just save domain model.
+ domain.caches = [cache._id];
+
+ _saveDomainModel(domain, savedDomains, callback);
+ }
+ else {
+ // If cache not found, then create it and associate with domain model.
+ var newCache = domain.newCache;
+ newCache.space = domain.space;
+
+ (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) {
+ if (mongo.processed(err, res)) {
+ domain.caches = [cacheId];
+ generatedCaches.push(cache);
+
+ _saveDomainModel(domain, savedDomains, callback);
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+ else
+ _saveDomainModel(domain, savedDomains, callback);
+ }, function (err) {
+ if (err)
+ res.status(500).send(err.message);
+ else
+ res.send({savedDomains: savedDomains, generatedCaches: generatedCaches});
+ });
+ else
+ res.status(500).send('Nothing to save!');
+ }
+
+ /**
+ * Save domain model.
+ */
+ router.post('/save', function (req, res) {
+ _save([req.body], res);
+ });
+
+ /**
+ * Batch save domain models.
+ */
+ 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) {
+ if (mongo.processed(err, res))
+ res.sendStatus(200);
+ })
+ });
+
+ /**
+ * Remove all domain models.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ var space_ids = spaces.map(function (value) {
+ return value._id;
+ });
+
+ 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) {
+ if (mongo.processed(err, res))
+ res.sendStatus(200);
+ });
+ })
+ }
+ });
+ });
+
+ /**
+ * Remove all generated demo domain models and caches.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.sendStatus(200);
+ });
+ });
+ }
+ });
+ });
+
+ resolve(router);
+ });
+};
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..cf312f5
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/igfs.js
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'igfs-routes',
+ inject: ['require(lodash)', 'require(express)', 'mongo']
+};
+
+module.exports.factory = function (_, express, mongo) {
+ return new Promise((resolve) => {
+ const router = express.Router();
+
+ /**
+ * Get spaces and IGFSs accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ 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) {
+ if (mongo.processed(err, 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) {
+ // Remove deleted clusters.
+ igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
+ return _.findIndex(clusters, function (cluster) {
+ return cluster._id.equals(clusterId);
+ }) >= 0;
+ });
+ });
+
+ res.json({
+ spaces: spaces,
+ clusters: clusters.map(function (cluster) {
+ return {value: cluster._id, label: cluster.name};
+ }),
+ igfss: igfss
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * Save IGFS.
+ */
+ 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) {
+ 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))
+ 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)) {
+ igfsId = igfs._id;
+
+ mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function (err) {
+ if (mongo.processed(err, res))
+ res.send(igfsId);
+ });
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * Remove IGFS by ._id.
+ */
+ router.post('/remove', function (req, res) {
+ mongo.Igfs.remove(req.body, function (err) {
+ if (mongo.processed(err, res))
+ res.sendStatus(200);
+ })
+ });
+
+ /**
+ * Remove all IGFSs.
+ */
+ 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) {
+ if (mongo.processed(err, res)) {
+ var space_ids = spaces.map(function (value) {
+ return value._id;
+ });
+
+ 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);
+ });
+ })
+ }
+ });
+ });
+
+ resolve(router);
+ });
+};
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..af272fd
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/notebooks.js
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'notebooks-routes',
+ inject: ['require(express)', 'mongo']
+};
+
+module.exports.factory = function (express, mongo) {
+ return new Promise((resolve) => {
+ const router = express.Router();
+
+ /**
+ * Get notebooks names accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.json(notebooks);
+ });
+ });
+ });
+
+ /**
+ * Get notebook accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.json(notebook);
+ });
+ });
+ });
+
+ /**
+ * Save notebook accessed for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ 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) {
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.send(note._id);
+ });
+ });
+ });
+
+ /**
+ * Remove notebook by ._id.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ router.post('/remove', function (req, res) {
+ mongo.Notebook.remove(req.body, function (err) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.sendStatus(200);
+ });
+ });
+
+ /**
+ * Create new notebook for user account.
+ *
+ * @param req Request.
+ * @param res Response.
+ */
+ 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ (new mongo.Notebook({space: space.id, name: req.body.name})).save(function (err, note) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ return res.send(note._id);
+ });
+ });
+ });
+
+ resolve(router);
+ });
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..06db42a
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/profile.js
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'profile-routes',
+ inject: ['require(lodash)', 'require(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) {
+ // TODO IGNITE-843 Send error to admin.
+ if (err)
+ return res.status(500).send('Failed to update profile!');
+
+ if (params.email)
+ user.email = params.email;
+
+ res.sendStatus(200);
+ });
+ }
+
+ function _checkEmail(res, user, params) {
+ 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)
+ return res.status(500).send('User with this e-mail already registered!');
+
+ _updateUser(res, params);
+ });
+ }
+ else
+ _updateUser(res, params);
+ }
+
+ /**
+ * Save user profile.
+ */
+ router.post('/save', function (req, res) {
+ var params = req.body;
+
+ 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!');
+
+ if (params.password) {
+ if (_.isEmpty(params.password))
+ return res.status(500).send('Wrong value for new password!');
+
+ user.setPassword(params.password, function (err, user) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ user.save(function (err) {
+ if (err)
+ return res.status(500).send("Failed to change password!");
+
+ _checkEmail(res, user, params);
+ });
+ });
+ }
+ else
+ _checkEmail(res, user, params);
+ });
+ });
+
+ resolve(router);
+ });
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..1aa9bc0
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/public.js
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+// Fire me up!
+
+module.exports = {
+ implements: 'public-routes',
+ inject: ['require(express)', 'require(passport)', 'require(nodemailer)', 'settings', 'mongo']
+};
+
+module.exports.factory = function (express, passport, nodemailer, settings, mongo) {
+ return new Promise(function (resolve) {
+ const router = express.Router();
+
+ const _randomString = () => {
+ const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ const possibleLen = possible.length;
+
+ let res = '';
+
+ for (let i = 0; i < settings.tokenLength; i++)
+ res += possible.charAt(Math.floor(Math.random() * possibleLen));
+
+ return res;
+ };
+
+ // GET user.
+ router.post('/user', function (req, res) {
+ var becomeUsed = req.session.viewedUser && req.user.admin;
+
+ var user = req.user;
+
+ if (becomeUsed) {
+ user = req.session.viewedUser;
+
+ user.becomeUsed = true;
+ }
+
+ res.json(user);
+ });
+
+ /**
+ * Register new account.
+ */
+ 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;
+
+ var account = new mongo.Account(req.body);
+
+ account.token = _randomString();
+
+ mongo.Account.register(account, req.body.password, function (err, account) {
+ if (err)
+ return res.status(401).send(err.message);
+
+ if (!account)
+ return res.status(500).send('Failed to create account.');
+
+ new mongo.Space({name: 'Personal space', owner: account._id}).save();
+
+ req.logIn(account, {}, function (err) {
+ if (err)
+ return res.status(401).send(err.message);
+
+ return res.sendStatus(200);
+ });
+ });
+ });
+ });
+
+ /**
+ * Login in exist account.
+ */
+ 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) {
+ if (err)
+ return res.status(401).send(err.message);
+
+ return res.sendStatus(200);
+ });
+ })(req, res, next);
+ });
+
+ /**
+ * Logout.
+ */
+ router.post('/logout', function (req, res) {
+ req.logout();
+
+ res.sendStatus(200);
+ });
+
+ /**
+ * Send e-mail to user with reset token.
+ */
+ router.post('/password/forgot', function (req, res) {
+ var transporter = {
+ service: settings.smtp.service,
+ auth: {
+ user: settings.smtp.email,
+ pass: settings.smtp.password
+ }
+ };
+
+ 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) {
+ if (!user)
+ return res.status(401).send('No account with that email address exists!');
+
+ if (err)
+ // TODO IGNITE-843 Send email to admin
+ return res.status(401).send('Failed to reset password!');
+
+ user.resetPasswordToken = token;
+
+ user.save(function (err) {
+ if (err)
+ // TODO IGNITE-843 Send email to admin
+ return res.status(401).send('Failed to reset password!');
+
+ var mailer = nodemailer.createTransport(transporter);
+
+ var mailOptions = {
+ from: settings.smtp.address(settings.smtp.username, settings.smtp.email),
+ to: settings.smtp.address(user.username, user.email),
+ subject: 'Password Reset',
+ text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' +
+ 'Please click on the following link, or paste this into your browser to complete the process:\n\n' +
+ 'http://' + req.headers.host + '/password/reset?token=' + token + '\n\n' +
+ 'If you did not request this, please ignore this email and your password will remain unchanged.\n\n' +
+ '--------------\n' +
+ 'Apache Ignite Web Console\n'
+ };
+
+ mailer.sendMail(mailOptions, function (err) {
+ if (err)
+ return res.status(401).send('Failed to send e-mail with reset link! ' + err);
+
+ return res.status(200).send('An e-mail has been sent with further instructions.');
+ });
+ });
+ });
+ });
+
+ /**
+ * Change password with given token.
+ */
+ 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!');
+
+ // TODO IGNITE-843 Send email to admin
+ if (err)
+ return res.status(500).send('Failed to reset password!');
+
+ user.setPassword(req.body.password, function (err, updatedUser) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ updatedUser.resetPasswordToken = undefined;
+
+ updatedUser.save(function (err) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ var transporter = {
+ service: settings.smtp.service,
+ auth: {
+ user: settings.smtp.email,
+ pass: settings.smtp.password
+ }
+ };
+
+ var mailer = nodemailer.createTransport(transporter);
+
+ var mailOptions = {
+ from: settings.smtp.address(settings.smtp.username, settings.smtp.email),
+ to: settings.smtp.address(user.username, user.email),
+ subject: 'Your password has been changed',
+ text: 'Hello,\n\n' +
+ 'This is a confirmation that the password for your account ' + user.email + ' has just been changed.\n\n' +
+ 'Now you can login: http://' + req.headers.host + '\n\n' +
+ '--------------\n' +
+ 'Apache Ignite Web Console\n'
+ };
+
+ mailer.sendMail(mailOptions, function (err) {
+ if (err)
+ return res.status(503).send('Password was changed, but failed to send confirmation e-mail!<br />' + err);
+
+ return res.status(200).send(user.email);
+ });
+ });
+ });
+ });
+ });
+
+ /* GET reset password page. */
+ router.post('/validate/token', function (req, res) {
+ var token = req.body.token;
+
+ var data = {token: token};
+
+ mongo.Account.findOne({resetPasswordToken: token}, function (err, user) {
+ if (!user)
+ data.error = 'Invalid token for password reset!';
+ else if (err)
+ data.error = err;
+ else
+ data.email = user.email;
+
+ res.json(data);
+ });
+ });
+
+ resolve(router);
+ });
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..268931f
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/routes.js
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+// Fire me up!
+
+module.exports = {
+ implements: 'routes',
+ inject: [
+ 'public-routes',
+ 'admin-routes',
+ 'profile-routes',
+ 'clusters-routes',
+ 'domains-routes',
+ 'caches-routes',
+ 'igfs-routes',
+ 'notebooks-routes',
+ 'agent-routes',
+ 'ignite_modules/routes:*' // Loads all routes modules of all plugins
+ ]
+};
+
+module.exports.factory = function (publicRoutes, adminRoutes, profileRoutes,
+ clusterRoutes, domainRoutes, cacheRoutes, igfsRoutes,
+ notebookRoutes, agentRoutes,
+ pluginRoutes) {
+ return {
+ register: (app) => {
+ app.all('*', (req, res, next) => {
+ req.currentUserId = () => {
+ if (!req.user)
+ return null;
+
+ if (req.session.viewedUser && req.user.admin)
+ return req.session.viewedUser._id;
+
+ return req.user._id;
+ };
+
+ next();
+ });
+
+ const _mustAuthenticated = (req, res, next) => {
+ req.isAuthenticated() ? next() : res.redirect('/');
+ };
+
+ const _adminOnly = (req, res, next) => {
+ req.isAuthenticated() && req.user.admin ? next() : res.sendStatus(403);
+ };
+
+ // Registering the standard routes
+ app.use('/', publicRoutes);
+ app.use('/admin', _mustAuthenticated, _adminOnly, adminRoutes);
+ app.use('/profile', _mustAuthenticated, adminRoutes);
+
+ app.all('/configuration/*', _mustAuthenticated);
+
+ app.use('/configuration/clusters', clusterRoutes);
+ app.use('/configuration/domains', domainRoutes);
+ app.use('/configuration/caches', cacheRoutes);
+ app.use('/configuration/igfs', igfsRoutes);
+
+ app.use('/notebooks', _mustAuthenticated, notebookRoutes);
+ app.use('/agent', _mustAuthenticated, agentRoutes);
+
+ // Registering the routes of all plugin modules
+ for (var name in pluginRoutes)
+ if (pluginRoutes.hasOwnProperty(name))
+ pluginRoutes[name].register(app, _mustAuthenticated, _adminOnly);
+
+ // Catch 404 and forward to error handler.
+ app.use(function (req, res, next) {
+ var err = new Error('Not Found: ' + req.originalUrl);
+
+ err.status = 404;
+
+ next(err);
+ });
+
+ // Production error handler: no stacktraces leaked to user.
+ app.use(function (err, req, res) {
+ res.status(err.status || 500);
+
+ res.render('error', {
+ message: err.message,
+ error: {}
+ });
+ });
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..b85b683
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/settings.js
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'settings',
+ inject: ['require(nconf)', 'require(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) {
+ var port = parseInt(val, 10);
+
+ // named pipe
+ if (isNaN(port))
+ return val;
+
+ // port number
+ if (port >= 0)
+ return port;
+
+ return false;
+ };
+
+ return {
+ agent: {
+ file: 'ignite-web-agent-1.5.0.final',
+ port: _normalizePort(nconf.get('agent-server:port')),
+ SSLOptions: nconf.get('agent-server:ssl') && {
+ key: fs.readFileSync(nconf.get('agent-server:key')),
+ cert: fs.readFileSync(nconf.get('agent-server:cert')),
+ passphrase: nconf.get('agent-server:keyPassphrase')
+ }
+ },
+ server : {
+ port: _normalizePort(nconf.get('server:port') || 80),
+ SSLOptions: nconf.get('server:ssl') && {
+ enable301Redirects: true,
+ trustXFPHeader: true,
+ port: _normalizePort(nconf.get('server:https-port') || 443),
+ key: fs.readFileSync(nconf.get('server:key')),
+ cert: fs.readFileSync(nconf.get('server:cert')),
+ passphrase: nconf.get('server:keyPassphrase')
+ }
+ },
+ smtp: {
+ service: nconf.get('smtp:service'),
+ username: nconf.get('smtp:username'),
+ email: nconf.get('smtp:email'),
+ password: nconf.get('smtp:password'),
+ address: (username, email) => username ? '"' + username + '" <' + email + '>' : email
+ },
+ mongoUrl: nconf.get('mongoDB:url'),
+ cookieTTL: 3600000 * 24 * 30,
+ sessionSecret: 'keyboard cat',
+ tokenLength: 20
+ };
+};
[26/51] [abbrv] ignite git commit: IGNITE-843 Change images.
Posted by ak...@apache.org.
IGNITE-843 Change images.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8b51eedf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8b51eedf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8b51eedf
Branch: refs/heads/ignite-843-rc3
Commit: 8b51eedf2fa609e9f92e3f14f0da21db98ea5b73
Parents: ef8f70b
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Mon Feb 8 17:40:02 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:40:02 2016 +0700
----------------------------------------------------------------------
.../main/js/public/images/query-metadata.png | Bin 92380 -> 98254 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8b51eedf/modules/control-center-web/src/main/js/public/images/query-metadata.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/query-metadata.png b/modules/control-center-web/src/main/js/public/images/query-metadata.png
old mode 100755
new mode 100644
index ef421bf..8b51ae3
Binary files a/modules/control-center-web/src/main/js/public/images/query-metadata.png and b/modules/control-center-web/src/main/js/public/images/query-metadata.png differ
[44/51] [abbrv] ignite git commit: IGNITE-2596 Add compression for
configuration zip.
Posted by ak...@apache.org.
IGNITE-2596 Add compression for configuration zip.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/07ef2787
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/07ef2787
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/07ef2787
Branch: refs/heads/ignite-843-rc3
Commit: 07ef278721438e49d4a25b9107404058b201eeb5
Parents: 0872520
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 14:23:41 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 14:23:41 2016 +0700
----------------------------------------------------------------------
.../app/modules/states/configuration/summary/summary.controller.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/07ef2787/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 b301a32..b53bf0c 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
@@ -268,7 +268,7 @@ export default [
$generatorOptional.optionalContent(zip, cluster);
- const blob = zip.generate({type: 'blob', mimeType: 'application/octet-stream'});
+ const blob = zip.generate({type: 'blob', compression: 'DEFLATE', mimeType: 'application/octet-stream'});
// Download archive.
saveAs(blob, cluster.name + '-configuration.zip');
[46/51] [abbrv] ignite git commit: IGNITE-843 Fixed pom generation.
Posted by ak...@apache.org.
IGNITE-843 Fixed pom generation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e71b2bd9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e71b2bd9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e71b2bd9
Branch: refs/heads/ignite-843-rc3
Commit: e71b2bd9112ec6ec6b56dedd2f27d1d22bb87dfd
Parents: cb137ae
Author: vsisko <vs...@gridgain.com>
Authored: Tue Feb 9 15:28:27 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 15:28:27 2016 +0700
----------------------------------------------------------------------
.../main/js/helpers/generator/generator-pom.js | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e71b2bd9/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
index 10ddcf1..2909b5f 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
@@ -144,6 +144,26 @@ $generatorPom.pom = function (cluster, igniteVersion, mvnRepositories, res) {
res.needEmptyLine = true;
addDependency('org.apache.ignite', 'ignite-core', igniteVersion);
+
+ switch (cluster.discovery.kind) {
+ case 'Cloud':
+ addDependency('org.apache.ignite', 'ignite-cloud', igniteVersion);
+
+ break;
+
+ case 'S3':
+ addDependency('org.apache.ignite', 'ignite-aws', igniteVersion);
+
+ break;
+
+ case 'GoogleStorage':
+ addDependency('org.apache.ignite', 'ignite-gce', igniteVersion);
+
+ break;
+
+ default:
+ }
+
addDependency('org.apache.ignite', 'ignite-spring', igniteVersion);
addDependency('org.apache.ignite', 'ignite-indexing', igniteVersion);
addDependency('org.apache.ignite', 'ignite-rest-http', igniteVersion);
[48/51] [abbrv] ignite git commit: IGNTIE-2369 refactoring - Fixes
#465.
Posted by ak...@apache.org.
IGNTIE-2369 refactoring - Fixes #465.
Signed-off-by: Alexey Kuznetsov <ak...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0e1cfd04
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e1cfd04
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e1cfd04
Branch: refs/heads/ignite-843-rc3
Commit: 0e1cfd04a77e47b7debbee4e698bbfeea1ac7f2f
Parents: e71b2bd
Author: Dmitriyff <dm...@gmail.com>
Authored: Tue Feb 9 15:44:48 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 15:44:48 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/app/index.js | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0e1cfd04/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 0a27aff..7334367 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -171,4 +171,11 @@ angular
User.read()
.then((user) => $root.$broadcast('user', user));
}
+}])
+.run(['$rootScope', ($root) => {
+ $root.$on('$stateChangeStart', () => {
+ _.each(angular.element('.modal'), (m) => {
+ angular.element(m).scope().$hide();
+ });
+ });
}]);
[34/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7dc05174
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7dc05174
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7dc05174
Branch: refs/heads/ignite-843-rc3
Commit: 7dc051742550065fbbca88989237f168c40987ca
Parents: 51ffdfd
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 10:18:55 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 10:18:55 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/views/reset.jade | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7dc05174/modules/control-center-web/src/main/js/views/reset.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/reset.jade b/modules/control-center-web/src/main/js/views/reset.jade
index 72d835f..468a493 100644
--- a/modules/control-center-web/src/main/js/views/reset.jade
+++ b/modules/control-center-web/src/main/js/views/reset.jade
@@ -15,10 +15,12 @@
limitations under the License.
header#header.header
- .container
- h1.navbar-brand
- a(href='/') Apache Ignite Web Configurator
- p.navbar-text(style='font-size: 18px;') Apache Ignite Web Console
+ table.container
+ tr
+ td.col-xs-3.col-sm-3.col-md-2
+ ignite-logo
+ td
+ ignite-title
.container.body-container
.main-content(ng-controller='resetPassword')
[02/51] [abbrv] ignite git commit: IGNITE-843 Refactored server side.
Posted by ak...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/igfs.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/igfs.js b/modules/control-center-web/src/main/js/routes/igfs.js
deleted file mode 100644
index 2fad048..0000000
--- a/modules/control-center-web/src/main/js/routes/igfs.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-var router = require('express').Router();
-var db = require('../db');
-
-/**
- * Get spaces and IGFSs accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/list', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- // Get all clusters for spaces.
- db.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function (err, clusters) {
- if (db.processed(err, res)) {
- // Get all IGFSs for spaces.
- db.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function (err, igfss) {
- if (db.processed(err, res)) {
- _.forEach(igfss, function (igfs) {
- // Remove deleted clusters.
- igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
- return _.findIndex(clusters, function (cluster) {
- return cluster._id.equals(clusterId);
- }) >= 0;
- });
- });
-
- res.json({
- spaces: spaces,
- clusters: clusters.map(function (cluster) {
- return {value: cluster._id, label: cluster.name};
- }),
- igfss: igfss
- });
- }
- }); }
- });
- }
- });
-});
-
-/**
- * Save IGFS.
- */
-router.post('/save', function (req, res) {
- var params = req.body;
- var igfsId = params._id;
- var clusters = params.clusters;
-
- if (params._id) {
- db.Igfs.update({_id: igfsId}, params, {upsert: true}, function (err) {
- if (db.processed(err, res))
- db.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.send(params._id);
- });
- });
- })
- }
- else
- db.Igfs.findOne({space: params.space, name: params.name}, function (err, igfs) {
- if (db.processed(err, res)) {
- if (igfs)
- return res.status(500).send('IGFS with name: "' + igfs.name + '" already exist.');
-
- (new db.Igfs(params)).save(function (err, igfs) {
- if (db.processed(err, res)) {
- igfsId = igfs._id;
-
- db.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.send(igfsId);
- });
- }
- });
- }
- });
-});
-
-/**
- * Remove IGFS by ._id.
- */
-router.post('/remove', function (req, res) {
- db.Igfs.remove(req.body, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- })
-});
-
-/**
- * Remove all IGFSs.
- */
-router.post('/remove/all', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- db.Igfs.remove({space: {$in: space_ids}}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- db.Cluster.update({space: {$in: space_ids}}, {igfss: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- });
- })
- }
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/notebooks.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/notebooks.js b/modules/control-center-web/src/main/js/routes/notebooks.js
deleted file mode 100644
index 93defd4..0000000
--- a/modules/control-center-web/src/main/js/routes/notebooks.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var router = require('express').Router();
-
-var db = require('../db');
-var utils = require('./../helpers/common-utils');
-
-/**
- * Get notebooks names accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/list', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.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) {
- return value._id;
- });
-
- // Get all metadata for spaces.
- db.Notebook.find({space: {$in: space_ids}}).select('_id name').sort('name').exec(function (err, notebooks) {
- if (err)
- return res.status(500).send(err.message);
-
- res.json(notebooks);
- });
- });
-});
-
-/**
- * Get notebook accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/get', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.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) {
- return value._id;
- });
-
- // Get all metadata for spaces.
- db.Notebook.findOne({space: {$in: space_ids}, _id: req.body.noteId}).exec(function (err, notebook) {
- if (err)
- return res.status(500).send(err.message);
-
- res.json(notebook);
- });
- });
-});
-
-/**
- * Save notebook accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/save', function (req, res) {
- var note = req.body;
- var noteId = note._id;
-
- if (noteId)
- db.Notebook.update({_id: noteId}, note, {upsert: true}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.send(noteId);
- });
- else
- db.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 db.Notebook(req.body)).save(function (err, note) {
- if (err)
- return res.status(500).send(err.message);
-
- res.send(note._id);
- });
- });
-});
-
-/**
- * Remove notebook by ._id.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/remove', function (req, res) {
- db.Notebook.remove(req.body, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.sendStatus(200);
- });
-});
-
-/**
- * Create new notebook for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/new', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.findOne({owner: user_id}, function (err, space) {
- if (err)
- return res.status(500).send(err.message);
-
- (new db.Notebook({space: space.id, name: req.body.name})).save(function (err, note) {
- if (err)
- return res.status(500).send(err.message);
-
- return res.send(note._id);
- });
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/profile.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/profile.js b/modules/control-center-web/src/main/js/routes/profile.js
deleted file mode 100644
index ae262cc..0000000
--- a/modules/control-center-web/src/main/js/routes/profile.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-
-var router = require('express').Router();
-var db = require('../db');
-
-function _updateUser(res, params) {
- db.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!');
-
- if (params.email)
- user.email = params.email;
-
- res.sendStatus(200);
- });
-}
-
-function _checkEmail(res, user, params) {
- if (params.email && user.email != params.email) {
- db.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)
- return res.status(500).send('User with this e-mail already registered!');
-
- _updateUser(res, params);
- });
- }
- else
- _updateUser(res, params);
-}
-
-/**
- * Save user profile.
- */
-router.post('/save', function (req, res) {
- var params = req.body;
-
- db.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!');
-
- if (params.password) {
- if (_.isEmpty(params.password))
- return res.status(500).send('Wrong value for new password!');
-
- user.setPassword(params.password, function (err, user) {
- if (err)
- return res.status(500).send(err.message);
-
- user.save(function(err) {
- if (err)
- return res.status(500).send("Failed to change password!");
-
- _checkEmail(res, user, params);
- });
- });
- }
- else
- _checkEmail(res, user, params);
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/public.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/public.js b/modules/control-center-web/src/main/js/routes/public.js
deleted file mode 100644
index 44786a8..0000000
--- a/modules/control-center-web/src/main/js/routes/public.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var router = require('express').Router();
-var passport = require('passport');
-var nodemailer = require('nodemailer');
-
-var db = require('../db');
-var config = require('../helpers/configuration-loader.js');
-var $commonUtils = require('./../helpers/common-utils');
-
-// GET user.
-router.post('/user', function (req, res) {
- var becomeUsed = req.session.viewedUser && req.user.admin;
-
- var user = req.user;
-
- if (becomeUsed) {
- user = req.session.viewedUser;
-
- user.becomeUsed = true;
- }
-
- res.json(user);
-});
-
-/**
- * Register new account.
- */
-router.post('/register', function (req, res) {
- db.Account.count(function (err, cnt) {
- if (err)
- return res.status(401).send(err.message);
-
- req.body.admin = cnt == 0;
-
- var account = new db.Account(req.body);
-
- account.token = $commonUtils.randomString(20);
-
- db.Account.register(account, req.body.password, function (err, account) {
- if (err)
- return res.status(401).send(err.message);
-
- if (!account)
- return res.status(500).send('Failed to create account.');
-
- new db.Space({name: 'Personal space', owner: account._id}).save();
-
- req.logIn(account, {}, function (err) {
- if (err)
- return res.status(401).send(err.message);
-
- return res.sendStatus(200);
- });
- });
- });
-});
-
-/**
- * Login in exist account.
- */
-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) {
- if (err)
- return res.status(401).send(err.message);
-
- return res.sendStatus(200);
- });
- })(req, res, next);
-});
-
-/**
- * Logout.
- */
-router.post('/logout', function (req, res) {
- req.logout();
-
- res.sendStatus(200);
-});
-
-/**
- * Send e-mail to user with reset token.
- */
-router.post('/password/forgot', function(req, res) {
- var transporter = {
- service: config.get('smtp:service'),
- auth: {
- user:config.get('smtp:email'),
- pass: config.get('smtp:password')
- }
- };
-
- 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 = $commonUtils.randomString(20);
-
- db.Account.findOne({ email: req.body.email }, function(err, user) {
- if (!user)
- return res.status(401).send('No account with that email address exists!');
-
- if (err)
- // TODO IGNITE-843 Send email to admin
- return res.status(401).send('Failed to reset password!');
-
- user.resetPasswordToken = token;
-
- user.save(function(err) {
- if (err)
- // TODO IGNITE-843 Send email to admin
- return res.status(401).send('Failed to reset password!');
-
- var mailer = nodemailer.createTransport(transporter);
-
- var mailOptions = {
- from: config.address(config.get('smtp:username'), config.get('smtp:email')),
- to: config.address(user.username, user.email),
- subject: 'Password Reset',
- text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' +
- 'Please click on the following link, or paste this into your browser to complete the process:\n\n' +
- 'http://' + req.headers.host + '/password/reset?token=' + token + '\n\n' +
- 'If you did not request this, please ignore this email and your password will remain unchanged.\n\n' +
- '--------------\n' +
- 'Apache Ignite Web Console\n'
- };
-
- mailer.sendMail(mailOptions, function(err){
- if (err)
- return res.status(401).send('Failed to send e-mail with reset link! ' + err);
-
- return res.status(200).send('An e-mail has been sent with further instructions.');
- });
- });
- });
-});
-
-/**
- * Change password with given token.
- */
-router.post('/password/reset', function(req, res) {
- db.Account.findOne({ resetPasswordToken: req.body.token }, function(err, user) {
- if (!user)
- return res.status(500).send('Invalid token for password reset!');
-
- if (err)
- // TODO IGNITE-843 Send email to admin
- return res.status(500).send('Failed to reset password!');
-
- user.setPassword(req.body.password, function (err, updatedUser) {
- if (err)
- return res.status(500).send(err.message);
-
- updatedUser.resetPasswordToken = undefined;
-
- updatedUser.save(function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- var transporter = {
- service: config.get('smtp:service'),
- auth: {
- user: config.get('smtp:email'),
- pass: config.get('smtp:password')
- }
- };
-
- var mailer = nodemailer.createTransport(transporter);
-
- var mailOptions = {
- from: config.address(config.get('smtp:username'), config.get('smtp:email')),
- to: config.address(user.username, user.email),
- subject: 'Your password has been changed',
- text: 'Hello,\n\n' +
- 'This is a confirmation that the password for your account ' + user.email + ' has just been changed.\n\n' +
- 'Now you can login: http://' + req.headers.host + '\n\n' +
- '--------------\n' +
- 'Apache Ignite Web Console\n'
- };
-
- mailer.sendMail(mailOptions, function (err) {
- if (err)
- return res.status(503).send('Password was changed, but failed to send confirmation e-mail!<br />' + err);
-
- return res.status(200).send(user.email);
- });
- });
- });
- });
-});
-
-/* GET reset password page. */
-router.post('/validate/token', function (req, res) {
- var token = req.body.token;
-
- var data = {token: token};
-
- db.Account.findOne({resetPasswordToken: token}, function (err, user) {
- if (!user)
- data.error = 'Invalid token for password reset!';
- else if (err)
- data.error = err;
- else
- data.email = user.email;
-
- res.json(data);
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/serve.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve.js b/modules/control-center-web/src/main/js/serve.js
index 9fff7a4..b5897a2 100644
--- a/modules/control-center-web/src/main/js/serve.js
+++ b/modules/control-center-web/src/main/js/serve.js
@@ -15,108 +15,94 @@
* limitations under the License.
*/
+const http = require('http'),
+ https = require('https'),
+ path = require('path');
+
/**
- * Module dependencies.
+ * Event listener for HTTP server "error" event.
*/
-var http = require('http');
-var https = require('https');
-var config = require('./helpers/configuration-loader.js');
-var app = require('./app');
-var agentManager = require('./agents/agent-manager');
+const _onError = (port, error) => {
+ if (error.syscall !== 'listen')
+ throw error;
+
+ var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
-var fs = require('fs');
+ // Handle specific listen errors with friendly messages.
+ switch (error.code) {
+ case 'EACCES':
+ console.error(bind + ' requires elevated privileges');
+ process.exit(1);
-var debug = require('debug')('ignite-web-console:server');
+ break;
+ case 'EADDRINUSE':
+ console.error(bind + ' is already in use');
+ process.exit(1);
+
+ break;
+ default:
+ throw error;
+ }
+};
/**
- * Get port from environment and store in Express.
+ * Event listener for HTTP server "listening" event.
*/
-var port = config.normalizePort(config.get('server:port') || process.env.PORT || 80);
+const _onListening = (addr) => {
+ var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;
-// Create HTTP server.
-var server = http.createServer(app);
+ console.log('Start listening on ' + bind);
+};
-app.set('port', port);
+const igniteModules = (process.env.IGNITE_MODULES && path.relative(__dirname, process.env.IGNITE_MODULES)) || './ignite_modules';
-/**
- * Listen on provided port, on all network interfaces.
- */
-server.listen(port);
-server.on('error', onError);
-server.on('listening', onListening);
-
-if (config.get('server:ssl')) {
- httpsServer = https.createServer({
- key: fs.readFileSync(config.get('server:key')),
- cert: fs.readFileSync(config.get('server:cert')),
- passphrase: config.get('server:keyPassphrase')
- }, app);
-
- var httpsPort = config.normalizePort(config.get('server:https-port') || 443);
-
- /**
- * Listen on provided port, on all network interfaces.
- */
- httpsServer.listen(httpsPort);
- httpsServer.on('error', onError);
- httpsServer.on('listening', onListening);
-}
+const fireUp = require('fire-up').newInjector({
+ basePath: __dirname,
+ modules: [
+ './serve/**/*.js',
+ `${igniteModules}/**/*.js`
+ ]
+});
-/**
- * Start agent server.
- */
-var agentServer;
+Promise.all([fireUp('settings'), fireUp('app'), fireUp('agent')])
+ .then((values) => {
+ const settings = values[0], app = values[1], agent = values[2];
-if (config.get('agent-server:ssl')) {
- agentServer = https.createServer({
- key: fs.readFileSync(config.get('agent-server:key')),
- cert: fs.readFileSync(config.get('agent-server:cert')),
- passphrase: config.get('agent-server:keyPassphrase')
- });
-}
-else {
- agentServer = http.createServer();
-}
+ // Create HTTP server.
+ const server = http.createServer(app);
-agentServer.listen(config.get('agent-server:port'));
+ app.set('port', settings.server.port);
-agentManager.createManager(agentServer);
+ server.listen(settings.server.port);
+ server.on('error', _onError.bind(null, settings.server.port));
+ server.on('listening', _onListening.bind(null, server.address()));
-/**
- * Event listener for HTTP server "error" event.
- */
-function onError(error) {
- if (error.syscall !== 'listen') {
- throw error;
- }
-
- var bind = typeof port === 'string'
- ? 'Pipe ' + port
- : 'Port ' + port;
-
- // Handle specific listen errors with friendly messages.
- switch (error.code) {
- case 'EACCES':
- console.error(bind + ' requires elevated privileges');
- process.exit(1);
- break;
- case 'EADDRINUSE':
- console.error(bind + ' is already in use');
- process.exit(1);
- break;
- default:
- throw error;
- }
-}
+ // Create HTTPS server if needed.
+ if (settings.serverSSLOptions) {
+ const httpsServer = https.createServer(settings.server.SSLOptions, app);
-/**
- * Event listener for HTTP server "listening" event.
- */
-function onListening() {
- var addr = server.address();
- var bind = typeof addr === 'string'
- ? 'pipe ' + addr
- : 'port ' + addr.port;
-
- console.log('Start listening on ' + bind);
-}
+ const httpsPort = settings.server.SSLOptions.port;
+
+ httpsServer.listen(httpsPort);
+ httpsServer.on('error', _onError.bind(null, httpsPort));
+ httpsServer.on('listening', _onListening.bind(null, httpsServer.address()));
+ }
+
+ // Start agent server.
+ const agentServer = settings.agent.SSLOptions
+ ? https.createServer(settings.agent.SSLOptions) : http.createServer();
+
+ agentServer.listen(settings.agent.port);
+ agentServer.on('error', _onError.bind(null, settings.agent.port));
+ agentServer.on('listening', _onListening.bind(null, agentServer.address()));
+
+ agent.listen(agentServer);
+
+ // Used for automated test.
+ if (process.send)
+ process.send('running');
+ }).catch((err) => {
+ console.error(err);
+
+ process.exit(1);
+ });
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..d1ffe1a
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -0,0 +1,380 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// 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;
+
+ this._wss = new ws.Server({server: this._server});
+
+ var self = this;
+
+ this._wss.on('connection', function (ws) {
+ new Client(ws, self);
+ });
+ };
+
+ /**
+ * @param userId
+ * @param {Client} client
+ */
+ AgentManager.prototype._removeClient = function (userId, client) {
+ var connections = this._clients[userId];
+
+ if (connections) {
+ var idx;
+
+ while ((idx = connections.indexOf(client)) !== -1)
+ connections.splice(idx, 1);
+
+ if (connections.length == 0)
+ delete this._clients[userId];
+ }
+ };
+
+ /**
+ * @param userId
+ * @param {Client} client
+ */
+ AgentManager.prototype._addClient = function (userId, client) {
+ var existingConnections = this._clients[userId];
+
+ if (!existingConnections) {
+ existingConnections = [];
+
+ this._clients[userId] = existingConnections;
+ }
+
+ existingConnections.push(client);
+ };
+
+ /**
+ * @param userId
+ * @returns {Client}
+ */
+ AgentManager.prototype.findClient = function (userId) {
+ const clientsList = this._clients[userId];
+
+ if (!clientsList || clientsList.length == 0)
+ return null;
+
+ return clientsList[0];
+ };
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Run http request
+ *
+ * @this {AgentServer}
+ * @param {Command} cmd Command
+ * @param {callback} callback on finish
+ */
+ AgentServer.prototype.runCommand = function (cmd, callback) {
+ var params = {cmd: cmd.name()};
+
+ for (var key in cmd._params)
+ params[key] = cmd._params[key];
+
+ var body = undefined;
+
+ var headers = undefined;
+
+ var method = 'GET';
+
+ if (cmd._isPost()) {
+ body = cmd.postData();
+
+ method = 'POST';
+
+ headers = {'JSONObject': 'application/json'};
+ }
+
+ this._client.executeRest("ignite", params, this._demo, method, headers, body, callback);
+ };
+
+ /**
+ * @constructor
+ * @param {AgentManager} manager
+ * @param {WebSocket} ws
+ */
+ function Client(ws, manager) {
+ var self = this;
+
+ this._manager = manager;
+ this._ws = ws;
+
+ ws.on('close', function () {
+ if (self._user) {
+ self._manager._removeClient(self._user._id, self);
+ }
+ });
+
+ ws.on('message', function (msgStr) {
+ var msg = JSON.parse(msgStr);
+
+ self['_rmt' + msg.type](msg);
+ });
+
+ this._reqCounter = 0;
+
+ this._cbMap = {};
+ }
+
+ Client.prototype._runCommand = function (method, args) {
+ var self = this;
+
+ return new Promise(function (resolve, reject) {
+ self._invokeRmtMethod(method, args, function (error, res) {
+ if (error != null)
+ return reject(error);
+
+ resolve(res);
+ });
+ });
+ };
+
+ /**
+ * @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';
+
+ if (typeof(callback) != 'function')
+ throw 'callback must be a function';
+
+ if (body && typeof(body) != 'string')
+ throw 'body must be a string';
+
+ if (headers && typeof(headers) != 'object')
+ throw 'headers must be an object';
+
+ if (!method)
+ method = 'GET';
+ else
+ method = method.toUpperCase();
+
+ if (method != 'GET' && method != 'POST')
+ throw 'Unknown HTTP method: ' + method;
+
+ const cb = function (error, restResult) {
+ if (error)
+ return callback(error);
+
+ const restError = restResult.error;
+
+ if (restError)
+ return callback(restError);
+
+ const restCode = restResult.restCode;
+
+ if (restCode !== 200) {
+ if (restCode === 401)
+ 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."
+ });
+ }
+
+ try {
+ var nodeResponse = JSON.parse(restResult.response);
+
+ if (nodeResponse.successStatus === 0)
+ return callback(null, nodeResponse.response);
+
+ 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});
+ }
+
+ callback(nodeResponse.error);
+ }
+ catch (e) {
+ callback(e);
+ }
+ };
+
+ this._invokeRmtMethod('executeRest', [uri, params, demo, method, headers, body], cb);
+ };
+
+ /**
+ * @param {string} error
+ */
+ Client.prototype.authResult = function (error) {
+ return this._runCommand('authResult', [].slice.call(arguments));
+ };
+
+ /**
+ * @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));
+ };
+
+ /**
+ * @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));
+ };
+
+ /**
+ * @returns {Promise} Promise on list of jars from driver folder.
+ */
+ Client.prototype.availableDrivers = function () {
+ return this._runCommand('availableDrivers', [].slice.call(arguments));
+ };
+
+ /**
+ * 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');
+
+ return;
+ }
+
+ var msg = {
+ method: method,
+ args: args
+ };
+
+ if (callback) {
+ var reqId = this._reqCounter++;
+
+ this._cbMap[reqId] = callback;
+
+ msg.reqId = reqId;
+ }
+
+ this._ws.send(JSON.stringify(msg))
+ };
+
+ Client.prototype._rmtAuthMessage = function (msg) {
+ var self = this;
+
+ fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', function (err, stats) {
+ var relDate = 0;
+
+ if (!err)
+ relDate = stats.birthtime.getTime();
+
+ 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.
+ }
+ else if (!account)
+ self.authResult('Invalid token, user not found');
+ else {
+ self.authResult(null);
+
+ self._user = account;
+
+ self._manager._addClient(account._id, self);
+
+ self._cluster = new apacheIgnite.Ignite(new AgentServer(self));
+
+ self._demo = new apacheIgnite.Ignite(new AgentServer(self, true));
+ }
+ });
+ });
+ };
+
+ Client.prototype._rmtCallRes = function (msg) {
+ var callback = this._cbMap[msg.reqId];
+
+ if (!callback) return;
+
+ delete this._cbMap[msg.reqId];
+
+ callback(msg.error, msg.response);
+ };
+
+ /**
+ * @returns {Ignite}
+ */
+ Client.prototype.ignite = function (demo) {
+ return demo ? this._demo : this._cluster;
+ };
+
+ return new AgentManager();
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..cc93ed9
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/app.js
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'app',
+ inject: ['require(express)', 'configure', 'routes']
+};
+
+module.exports.factory = function(express, configure, routes) {
+ const app = new express();
+
+ configure(app);
+
+ routes.register(app);
+
+ return app;
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/serve/config/default.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/config/default.json b/modules/control-center-web/src/main/js/serve/config/default.json
new file mode 100644
index 0000000..574d42a
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/config/default.json
@@ -0,0 +1,26 @@
+{
+ "server": {
+ "port": 3000,
+ "https-port": 8443,
+ "ssl": false,
+ "key": "serve/keys/test.key",
+ "cert": "serve/keys/test.crt",
+ "keyPassphrase": "password"
+ },
+ "mongoDB": {
+ "url": "mongodb://localhost/web-control-center"
+ },
+ "agent-server": {
+ "port": 3001,
+ "ssl": true,
+ "key": "serve/keys/test.key",
+ "cert": "serve/keys/test.crt",
+ "keyPassphrase": "password"
+ },
+ "smtp": {
+ "service": "",
+ "username": "",
+ "email": "",
+ "password": ""
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..c16b516
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/configure.js
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// 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) {
+ return (app) => {
+ app.use(logger('dev', {
+ skip: function (req, res) {
+ return res.statusCode < 400;
+ }
+ }));
+
+ app.use(cookieParser(settings.sessionSecret));
+
+ app.use(bodyParser.json({limit: '50mb'}));
+ app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
+
+ var mongoStore = connectMongo(session);
+
+ app.use(session({
+ secret: settings.sessionSecret,
+ resave: false,
+ saveUninitialized: true,
+ cookie: {
+ expires: new Date(Date.now() + settings.cookieTTL),
+ maxAge: settings.cookieTTL
+ }
+ , store: new mongoStore({mongooseConnection: mongo.connection})
+ }));
+
+ app.use(passport.initialize());
+ app.use(passport.session());
+
+ passport.serializeUser(mongo.Account.serializeUser());
+ passport.deserializeUser(mongo.Account.deserializeUser());
+
+ passport.use(mongo.Account.createStrategy());
+
+ if (settings.SSLOptions) {
+ app.set('forceSSLOptions', settings.SSLOptions);
+
+ app.use(forceSSL);
+ }
+ };
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/serve/keys/test.crt
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/keys/test.crt b/modules/control-center-web/src/main/js/serve/keys/test.crt
new file mode 100644
index 0000000..50c6d5c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/keys/test.crt
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIIB6zCCAVQCCQDcAphbU6UcLjANBgkqhkiG9w0BAQsFADA6MRIwEAYDVQQDDAls
+b2NhbGhvc3QxJDAiBgkqhkiG9w0BCQEWFXNldmRva2ltb3ZAYXBhY2hlLm9yZzAe
+Fw0xNTA3MTQxMzAyNTNaFw0xODA2MjMxMzAyNTNaMDoxEjAQBgNVBAMMCWxvY2Fs
+aG9zdDEkMCIGCSqGSIb3DQEJARYVc2V2ZG9raW1vdkBhcGFjaGUub3JnMIGfMA0G
+CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP/zpJrdHqCj6lPpeFF6LQtzKef6UiyBBo
+rbuOtCCgW8KMJJciluBWk2126qLt9smBN4jBpSNU3pq0r9gBMUTd/LSe7aY4D5ED
+Pjp7XsypNVKeHaHbFi7KhfHy0LYxsWiNPmmHJv4dtYOp+pGK25rkXNfyJxxjgxN6
+wo34+MnZIQIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAFk9XEjcdyihws+fVmdGGUFo
+bVxI9YGH6agiNbU3WNF4B4VRzcPPW8z2mEo7eF9kgYmq/YzH4T8tgi/qkL/u8eZV
+Wmi9bg6RThLN6/hj3wVoOFKykbDQ05FFdhIJXN5UOjPmxYM97EKqg6J0W2HAb8SG
++UekPnmAo/2HTKsLykH8
+-----END CERTIFICATE-----
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/serve/keys/test.key
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/keys/test.key b/modules/control-center-web/src/main/js/serve/keys/test.key
new file mode 100644
index 0000000..1b395c0
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/keys/test.key
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,6798185330CE2EE2
+
+sOwkmD8rvjx11l09V26dJhLhl+SyPIhyeZ3TqHXrYCATKoXlzidT+uPu1jVYtrwr
+nBLA6TrIDYRrBNlEsqGZ0cSvWTIczzVW1xZKHEJo5q2vUT/W8u/Q1QQtS3P3GeKF
+dEzx496rpZqwwVw59GNbuIwyYoVvQf3iEXzfhplGmLPELYIplDFOLgNuXQyXSGx6
+rwKsCxXMLsDyrA6DCz0Odf08p2HvWk/s5Ne3DFcQlqRNtIrBVGD2O0/Fp8ZZ2I4E
+Yn2OIIWJff3HanOjLOWKdN8YAn5UleNmlEUdIHeS5qaQ68mabOxLkSef9qglV+sd
+FHTtUq0cG6t6nhxZBziexha6v1yl/xABAHHhNPOfak+HthWxRD4N9f1yFYAeTmkn
+4kwBWoSUe12XRf2pGNqhEUKN/KhDmWk85wI55i/Cu2XmNoiBFlS9BXrRYU8uVCJw
+KlxjKTDWl1opCyvxTDxJnMkt44ZT445LRePKVueGIIKSUIXNQypOE+C1I0CL0N2W
+Ts3m9nthquvLeMx92k7b8yW69BER5uac3SIlGCOJObQXsHgyk8wYiyd/zLKfjctG
+PXieaW81UKjp+GqWpvWPz3VqnKwoyUWeVOOTviurli6kYOrHuySTMqMb6hxJctw9
+grAQTT0UPiAKWcM7InLzZnRjco+v9QLLEokjVngXPba16K/CItFY16xuGlaFLW7Y
+XTc67AkL8b76HBZelMjmCsqjvSoULhuMFwTOvUMm/mSM8rMoi9asrJRLQHRMWCST
+/6RENPLzPlOMnNLBujpBbn8V3/aYzEZsHMI+6S3d27WYlTJIqpabSA==
+-----END RSA PRIVATE KEY-----
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..edfb5f8
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -0,0 +1,551 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+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');
+
+ const deepPopulate = deepPopulatePlugin(mongoose);
+
+ // Connect to mongoDB database.
+ mongoose.connect(settings.mongoUrl, {server: {poolSize: 4}});
+
+ const Schema = mongoose.Schema, ObjectId = mongoose.Schema.Types.ObjectId,
+ result = { connection: mongoose.connection };
+
+ // Define Account schema.
+ var AccountSchema = new Schema({
+ username: String,
+ email: String,
+ company: String,
+ country: String,
+ lastLogin: Date,
+ admin: Boolean,
+ token: String,
+ resetPasswordToken: String
+ });
+
+ // Install passport plugin.
+ AccountSchema.plugin(passportMongo, {
+ usernameField: 'email', limitAttempts: true, lastLoginField: 'lastLogin',
+ usernameLowerCase: true
+ });
+
+ // Configure transformation to JSON.
+ AccountSchema.set('toJSON', {
+ transform: function (doc, ret) {
+ return {
+ _id: ret._id,
+ email: ret.email,
+ username: ret.username,
+ company: ret.company,
+ country: ret.country,
+ admin: ret.admin,
+ token: ret.token,
+ lastLogin: ret.lastLogin
+ };
+ }
+ });
+
+ // Define Account model.
+ result.Account = mongoose.model('Account', AccountSchema);
+
+ // Define Space model.
+ result.Space = mongoose.model('Space', new Schema({
+ name: String,
+ owner: {type: ObjectId, ref: 'Account'},
+ usedBy: [{
+ permission: {type: String, enum: ['VIEW', 'FULL']},
+ account: {type: ObjectId, ref: 'Account'}
+ }]
+ }));
+
+ // Define Domain model schema.
+ var DomainModelSchema = new Schema({
+ space: {type: ObjectId, ref: 'Space'},
+ caches: [{type: ObjectId, ref: 'Cache'}],
+ queryMetadata: {type: String, enum: ['Annotations', 'Configuration']},
+ kind: {type: String, enum: ['query', 'store', 'both']},
+ databaseSchema: String,
+ databaseTable: String,
+ keyType: String,
+ valueType: String,
+ keyFields: [{
+ databaseFieldName: String,
+ databaseFieldType: String,
+ javaFieldName: String,
+ javaFieldType: String
+ }],
+ valueFields: [{
+ databaseFieldName: String,
+ databaseFieldType: String,
+ javaFieldName: String,
+ javaFieldType: String
+ }],
+ fields: [{name: String, className: String}],
+ aliases: [{field: String, alias: String}],
+ indexes: [{
+ name: String,
+ indexType: {type: String, enum: ['SORTED', 'FULLTEXT', 'GEOSPATIAL']},
+ fields: [{name: String, direction: Boolean}]
+ }],
+ demo: Boolean
+ });
+
+ // Define model of Domain models.
+ result.DomainModel = mongoose.model('DomainModel', DomainModelSchema);
+
+ // Define Cache schema.
+ var CacheSchema = new Schema({
+ space: {type: ObjectId, ref: 'Space'},
+ name: String,
+ clusters: [{type: ObjectId, ref: 'Cluster'}],
+ domains: [{type: ObjectId, ref: 'DomainModel'}],
+ cacheMode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']},
+ atomicityMode: {type: String, enum: ['ATOMIC', 'TRANSACTIONAL']},
+
+ backups: Number,
+ memoryMode: {type: String, enum: ['ONHEAP_TIERED', 'OFFHEAP_TIERED', 'OFFHEAP_VALUES']},
+ offHeapMaxMemory: Number,
+ startSize: Number,
+ swapEnabled: Boolean,
+
+ evictionPolicy: {
+ kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
+ LRU: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ },
+ FIFO: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ },
+ SORTED: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ }
+ },
+
+ rebalanceMode: {type: String, enum: ['SYNC', 'ASYNC', 'NONE']},
+ rebalanceBatchSize: Number,
+ rebalanceBatchesPrefetchCount: Number,
+ rebalanceOrder: Number,
+ rebalanceDelay: Number,
+ rebalanceTimeout: Number,
+ rebalanceThrottle: Number,
+
+ cacheStoreFactory: {
+ kind: {
+ type: String,
+ enum: ['CacheJdbcPojoStoreFactory', 'CacheJdbcBlobStoreFactory', 'CacheHibernateBlobStoreFactory']
+ },
+ CacheJdbcPojoStoreFactory: {
+ dataSourceBean: String,
+ dialect: {
+ type: String,
+ enum: ['Generic', 'Oracle', 'DB2', 'SQLServer', 'MySQL', 'PostgreSQL', 'H2']
+ }
+ },
+ CacheJdbcBlobStoreFactory: {
+ connectVia: {type: String, enum: ['URL', 'DataSource']},
+ connectionUrl: String,
+ user: String,
+ dataSourceBean: String,
+ dialect: {
+ type: String,
+ enum: ['Generic', 'Oracle', 'DB2', 'SQLServer', 'MySQL', 'PostgreSQL', 'H2']
+ },
+ initSchema: Boolean,
+ createTableQuery: String,
+ loadQuery: String,
+ insertQuery: String,
+ updateQuery: String,
+ deleteQuery: String
+ },
+ CacheHibernateBlobStoreFactory: {
+ hibernateProperties: [String]
+ }
+ },
+ storeKeepBinary: Boolean,
+ loadPreviousValue: Boolean,
+ readThrough: Boolean,
+ writeThrough: Boolean,
+
+ writeBehindEnabled: Boolean,
+ writeBehindBatchSize: Number,
+ writeBehindFlushSize: Number,
+ writeBehindFlushFrequency: Number,
+ writeBehindFlushThreadCount: Number,
+
+ invalidate: Boolean,
+ defaultLockTimeout: Number,
+ atomicWriteOrderMode: {type: String, enum: ['CLOCK', 'PRIMARY']},
+ writeSynchronizationMode: {type: String, enum: ['FULL_SYNC', 'FULL_ASYNC', 'PRIMARY_SYNC']},
+
+ sqlEscapeAll: Boolean,
+ sqlSchema: String,
+ sqlOnheapRowCacheSize: Number,
+ longQueryWarningTimeout: Number,
+ sqlFunctionClasses: [String],
+ snapshotableIndex: Boolean,
+ statisticsEnabled: Boolean,
+ managementEnabled: Boolean,
+ readFromBackup: Boolean,
+ copyOnRead: Boolean,
+ maxConcurrentAsyncOperations: Number,
+ nearCacheEnabled: Boolean,
+ nearConfiguration: {
+ nearStartSize: Number,
+ nearEvictionPolicy: {
+ kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
+ LRU: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ },
+ FIFO: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ },
+ SORTED: {
+ batchSize: Number,
+ maxMemorySize: Number,
+ maxSize: Number
+ }
+ }
+ },
+ demo: Boolean
+ });
+
+ // Install deep populate plugin.
+ CacheSchema.plugin(deepPopulate, {
+ whitelist: ['domains']
+ });
+
+ // Define Cache model.
+ result.Cache = mongoose.model('Cache', CacheSchema);
+
+ var IgfsSchema = new Schema({
+ space: {type: ObjectId, ref: 'Space'},
+ name: String,
+ clusters: [{type: ObjectId, ref: 'Cluster'}],
+ affinnityGroupSize: Number,
+ blockSize: Number,
+ streamBufferSize: Number,
+ dataCacheName: String,
+ metaCacheName: String,
+ defaultMode: {type: String, enum: ['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']},
+ dualModeMaxPendingPutsSize: Number,
+ dualModePutExecutorService: String,
+ dualModePutExecutorServiceShutdown: Boolean,
+ fragmentizerConcurrentFiles: Number,
+ fragmentizerEnabled: Boolean,
+ fragmentizerThrottlingBlockLength: Number,
+ fragmentizerThrottlingDelay: Number,
+ ipcEndpointConfiguration: {
+ type: {type: String, enum: ['SHMEM', 'TCP']},
+ host: String,
+ port: Number,
+ memorySize: Number,
+ tokenDirectoryPath: String
+ },
+ ipcEndpointEnabled: Boolean,
+ maxSpaceSize: Number,
+ maximumTaskRangeLength: Number,
+ managementPort: Number,
+ pathModes: [{path: String, mode: {type: String, enum: ['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']}}],
+ perNodeBatchSize: Number,
+ perNodeParallelBatchCount: Number,
+ prefetchBlocks: Number,
+ sequentialReadsBeforePrefetch: Number,
+ trashPurgeTimeout: Number,
+ secondaryFileSystemEnabled: Boolean,
+ secondaryFileSystem: {
+ uri: String,
+ cfgPath: String,
+ userName: String
+ }
+ });
+
+ // Define IGFS model.
+ result.Igfs = mongoose.model('Igfs', IgfsSchema);
+
+ // Define Cluster schema.
+ var ClusterSchema = new Schema({
+ space: {type: ObjectId, ref: 'Space'},
+ name: String,
+ localHost: String,
+ discovery: {
+ localAddress: String,
+ localPort: Number,
+ localPortRange: Number,
+ addressResolver: String,
+ socketTimeout: Number,
+ ackTimeout: Number,
+ maxAckTimeout: Number,
+ networkTimeout: Number,
+ joinTimeout: Number,
+ threadPriority: Number,
+ heartbeatFrequency: Number,
+ maxMissedHeartbeats: Number,
+ maxMissedClientHeartbeats: Number,
+ topHistorySize: Number,
+ listener: String,
+ dataExchange: String,
+ metricsProvider: String,
+ reconnectCount: Number,
+ statisticsPrintFrequency: Number,
+ ipFinderCleanFrequency: Number,
+ authenticator: String,
+ forceServerMode: Boolean,
+ clientReconnectDisabled: Boolean,
+ kind: {type: String, enum: ['Vm', 'Multicast', 'S3', 'Cloud', 'GoogleStorage', 'Jdbc', 'SharedFs']},
+ Vm: {
+ addresses: [String]
+ },
+ Multicast: {
+ multicastGroup: String,
+ multicastPort: Number,
+ responseWaitTime: Number,
+ addressRequestAttempts: Number,
+ localAddress: String,
+ addresses: [String]
+ },
+ S3: {
+ bucketName: String
+ },
+ Cloud: {
+ credential: String,
+ credentialPath: String,
+ identity: String,
+ provider: String,
+ regions: [String],
+ zones: [String]
+ },
+ GoogleStorage: {
+ projectName: String,
+ bucketName: String,
+ serviceAccountP12FilePath: String,
+ serviceAccountId: String,
+ addrReqAttempts: String
+ },
+ Jdbc: {
+ initSchema: Boolean
+ },
+ SharedFs: {
+ path: String
+ }
+ },
+ atomicConfiguration: {
+ backups: Number,
+ cacheMode: {type: String, enum: ['LOCAL', 'REPLICATED', 'PARTITIONED']},
+ atomicSequenceReserveSize: Number
+ },
+ binaryConfiguration: {
+ idMapper: String,
+ serializer: String,
+ typeConfigurations: [{typeName: String, idMapper: String, serializer: String, enum: Boolean}],
+ compactFooter: Boolean
+ },
+ caches: [{type: ObjectId, ref: 'Cache'}],
+ clockSyncSamples: Number,
+ clockSyncFrequency: Number,
+ deploymentMode: {type: String, enum: ['PRIVATE', 'ISOLATED', 'SHARED', 'CONTINUOUS']},
+ discoveryStartupDelay: Number,
+ igfsThreadPoolSize: Number,
+ igfss: [{type: ObjectId, ref: 'Igfs'}],
+ includeEventTypes: [String],
+ managementThreadPoolSize: Number,
+ marshaller: {
+ kind: {type: String, enum: ['OptimizedMarshaller', 'JdkMarshaller']},
+ OptimizedMarshaller: {
+ poolSize: Number,
+ requireSerializable: Boolean
+ }
+ },
+ marshalLocalJobs: Boolean,
+ marshallerCacheKeepAliveTime: Number,
+ marshallerCacheThreadPoolSize: Number,
+ metricsExpireTime: Number,
+ metricsHistorySize: Number,
+ metricsLogFrequency: Number,
+ metricsUpdateFrequency: Number,
+ networkTimeout: Number,
+ networkSendRetryDelay: Number,
+ networkSendRetryCount: Number,
+ communication: {
+ listener: String,
+ localAddress: String,
+ localPort: Number,
+ localPortRange: Number,
+ sharedMemoryPort: Number,
+ directBuffer: Boolean,
+ directSendBuffer: Boolean,
+ idleConnectionTimeout: Number,
+ connectTimeout: Number,
+ maxConnectTimeout: Number,
+ reconnectCount: Number,
+ socketSendBuffer: Number,
+ socketReceiveBuffer: Number,
+ messageQueueLimit: Number,
+ slowClientQueueLimit: Number,
+ tcpNoDelay: Boolean,
+ ackSendThreshold: Number,
+ unacknowledgedMessagesBufferSize: Number,
+ socketWriteTimeout: Number,
+ selectorsCount: Number,
+ addressResolver: String
+ },
+ connector: {
+ enabled: Boolean,
+ jettyPath: String,
+ host: String,
+ port: Number,
+ portRange: Number,
+ idleTimeout: Number,
+ idleQueryCursorTimeout: Number,
+ idleQueryCursorCheckFrequency: Number,
+ receiveBufferSize: Number,
+ sendBufferSize: Number,
+ directBuffer: Boolean,
+ noDelay: Boolean,
+ selectorCount: Number,
+ threadPoolSize: Number,
+ messageInterceptor: String,
+ secretKey: String,
+ sslEnabled: Boolean,
+ sslClientAuth: Boolean,
+ sslFactory: String
+ },
+ peerClassLoadingEnabled: Boolean,
+ peerClassLoadingLocalClassPathExclude: [String],
+ peerClassLoadingMissedResourcesCacheSize: Number,
+ peerClassLoadingThreadPoolSize: Number,
+ publicThreadPoolSize: Number,
+ swapSpaceSpi: {
+ kind: {type: String, enum: ['FileSwapSpaceSpi']},
+ FileSwapSpaceSpi: {
+ baseDirectory: String,
+ readStripesNumber: Number,
+ maximumSparsity: Number,
+ maxWriteQueueSize: Number,
+ writeBufferSize: Number
+ }
+ },
+ systemThreadPoolSize: Number,
+ timeServerPortBase: Number,
+ timeServerPortRange: Number,
+ transactionConfiguration: {
+ defaultTxConcurrency: {type: String, enum: ['OPTIMISTIC', 'PESSIMISTIC']},
+ defaultTxIsolation: {type: String, enum: ['READ_COMMITTED', 'REPEATABLE_READ', 'SERIALIZABLE']},
+ defaultTxTimeout: Number,
+ pessimisticTxLogLinger: Number,
+ pessimisticTxLogSize: Number,
+ txSerializableEnabled: Boolean,
+ txManagerFactory: String
+ },
+ sslEnabled: Boolean,
+ sslContextFactory: {
+ keyAlgorithm: String,
+ keyStoreFilePath: String,
+ keyStoreType: String,
+ protocol: String,
+ trustStoreFilePath: String,
+ trustStoreType: String,
+ trustManagers: [String]
+ },
+ rebalanceThreadPoolSize: Number
+ });
+
+ // Install deep populate plugin.
+ ClusterSchema.plugin(deepPopulate, {
+ whitelist: [
+ 'caches',
+ 'caches.domains',
+ 'igfss'
+ ]
+ });
+
+ // Define Cluster model.
+ result.Cluster = mongoose.model('Cluster', ClusterSchema);
+
+ result.ClusterDefaultPopulate = '';
+
+ // Define Notebook schema.
+ var NotebookSchema = new Schema({
+ space: {type: ObjectId, ref: 'Space'},
+ name: String,
+ expandedParagraphs: [Number],
+ paragraphs: [{
+ name: String,
+ query: String,
+ editor: Boolean,
+ result: {type: String, enum: ['none', 'table', 'bar', 'pie', 'line', 'area']},
+ pageSize: Number,
+ timeLineSpan: String,
+ hideSystemColumns: Boolean,
+ cacheName: String,
+ chartsOptions: {barChart: {stacked: Boolean}, areaChart: {style: String}},
+ rate: {
+ value: Number,
+ unit: Number
+ }
+ }]
+ });
+
+ // Define Notebook model.
+ result.Notebook = mongoose.model('Notebook', NotebookSchema);
+
+ result.upsert = function (model, data, cb) {
+ if (data._id) {
+ var id = data._id;
+
+ delete data._id;
+
+ model.findOneAndUpdate({_id: id}, data, cb);
+ }
+ else
+ new model(data).save(cb);
+ };
+
+ result.processed = function(err, res) {
+ if (err) {
+ res.status(500).send(err);
+
+ return false;
+ }
+
+ return true;
+ };
+
+ // Registering the routes of all plugin modules
+ for (var name in pluginMongo)
+ if (pluginMongo.hasOwnProperty(name))
+ pluginMongo[name].register(mongoose, deepPopulate, result);
+
+ return result;
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..a79d584
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/admin.js
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'admin-routes',
+ inject: ['require(lodash)', 'require(express)', 'require(nodemailer)', 'mongo']
+};
+
+module.exports.factory = function (_, express, nodemailer, 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) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.json(users);
+ });
+ });
+
+ // Remove user.
+ router.post('/remove', function (req, res) {
+ var 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) {
+ mongo.Cluster.remove({space: space._id}).exec();
+ mongo.Cache.remove({space: space._id}).exec();
+ mongo.DomainModel.remove({space: space._id}).exec();
+ mongo.Notebook.remove({space: space._id}).exec();
+ mongo.Space.remove({owner: space._id}).exec();
+ });
+ });
+
+ var transporter = {
+ service: settings.smtp.service,
+ auth: {
+ user: settings.smtp.email,
+ pass: settings.smtp.password
+ }
+ };
+
+ if (transporter.service != '' || transporter.auth.user != '' || transporter.auth.pass != '') {
+ var mailer = nodemailer.createTransport(transporter);
+
+ var mailOptions = {
+ from: settings.smtp.address(settings.smtp.username, settings.smtp.email),
+ to: settings.smtp.address(user.username, user.email),
+ subject: 'Your account was deleted',
+ text: 'You are receiving this e-mail because admin remove your account.\n\n' +
+ '--------------\n' +
+ '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);
+
+ res.sendStatus(200);
+ });
+ }
+ else
+ res.sendStatus(200);
+ });
+ });
+
+ // Save user.
+ router.post('/save', function (req, res) {
+ var userId = req.body.userId;
+ var adminFlag = req.body.adminFlag;
+
+ mongo.Account.findByIdAndUpdate(userId, {admin: adminFlag}, function (err) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ res.sendStatus(200);
+ });
+ });
+
+ // Become user.
+ router.get('/become', function (req, res) {
+ mongo.Account.findById(req.query.viewedUserId).exec(function (err, viewedUser) {
+ if (err)
+ return res.sendStatus(404);
+
+ req.session.viewedUser = viewedUser;
+
+ return res.sendStatus(200);
+ })
+ });
+
+ // Become user.
+ router.get('/revert/identity', function (req, res) {
+ req.session.viewedUser = null;
+
+ return res.sendStatus(200);
+ });
+
+ resolve(router);
+ });
+};
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/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
new file mode 100644
index 0000000..e5abf0f
--- /dev/null
+++ b/modules/control-center-web/src/main/js/serve/routes/agent.js
@@ -0,0 +1,331 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Fire me up!
+
+module.exports = {
+ implements: 'agent-routes',
+ inject: ['require(lodash)', 'require(express)', 'require(apache-ignite)', 'require(fs)', 'require(jszip)', 'settings', 'agent']
+};
+
+/**
+ * @param _
+ * @param express
+ * @param apacheIgnite
+ * @param fs
+ * @param JSZip
+ * @param settings
+ * @param {AgentManager} agent
+ * @returns {Promise}
+ */
+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) {
+ var client = agent.findClient(userId);
+
+ if (client)
+ return resolve(client);
+
+ reject({code: 503, message: 'Connection to Ignite Web Agent is not established'});
+ });
+ };
+
+ const _compact = (className) => {
+ return className.replace('java.lang.', '').replace('java.util.', '').replace('java.sql.', '');
+ };
+
+ const _handleException = (res) => {
+ 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) {
+ var agentFld = settings.agentFile;
+ var agentZip = agentFld + '.zip';
+ var 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)
+ return res.download(agentPathZip, agentZip);
+
+ var zip = new JSZip(data);
+
+ var prop = [];
+
+ var 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.agentPort);
+ prop.push('#Uncomment following options if needed:');
+ 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('rel-date=' + stats.birthtime.getTime());
+
+ zip.file(agentFld + '/default.properties', prop.join('\n'));
+
+ var buffer = zip.generate({type: 'nodebuffer', platform: 'UNIX'});
+
+ // Set the archive name.
+ res.attachment(agentZip);
+
+ res.send(buffer);
+ });
+ });
+ });
+
+ /* Get grid topology. */
+ 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))
+ .catch(_handleException(res));
+ });
+
+ /* Execute query. */
+ router.post('/query', function (req, res) {
+ _client(req.currentUserId())
+ .then((client) => {
+ // Create sql query.
+ var qry = new SqlFieldsQuery(req.body.query);
+
+ // Set page size for query.
+ qry.setPageSize(req.body.pageSize);
+
+ return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
+ })
+ .then((cursor) => res.json({
+ meta: cursor.fieldsMetadata(),
+ rows: cursor.page(),
+ queryId: cursor.queryId()
+ }))
+ .catch(_handleException(res));
+ });
+
+ /* Execute query getAll. */
+ router.post('/query/getAll', function (req, res) {
+ _client(req.currentUserId())
+ .then((client) => {
+ // Create sql query.
+ const qry = req.body.query ? new SqlFieldsQuery(req.body.query) : new ScanQuery();
+
+ // Set page size for query.
+ qry.setPageSize(1024);
+
+ // 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}))
+ });
+ })
+ .then(response => res.json(response))
+ .catch(_handleException(res));
+ });
+
+ /* Execute query. */
+ router.post('/scan', function (req, res) {
+ _client(req.currentUserId())
+ .then((client) => {
+ // Create sql query.
+ var qry = new ScanQuery();
+
+ // Set page size for query.
+ qry.setPageSize(req.body.pageSize);
+
+ // Get query cursor.
+ return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
+ })
+ .then((cursor) => res.json({
+ meta: cursor.fieldsMetadata(),
+ rows: cursor.page(),
+ queryId: cursor.queryId()
+ }))
+ .catch(_handleException(res));
+ });
+
+ /* Get next query page. */
+ router.post('/query/fetch', function (req, res) {
+ _client(req.currentUserId())
+ .then((client) => {
+ var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
+
+ var 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']}))
+ .catch(_handleException(res));
+ });
+
+ /* Close query cursor by id. */
+ 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))
+ })
+ .then(() => res.sendStatus(200))
+ .catch(_handleException(res));
+ });
+
+ /* Get metadata for cache. */
+ 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 fields = meta.fields[typeName];
+
+ var columns = [];
+
+ for (var fieldName in fields) {
+ var fieldClass = _compact(fields[fieldName]);
+
+ columns.push({
+ type: 'field',
+ name: fieldName,
+ clazz: fieldClass,
+ system: fieldName == "_KEY" || fieldName == "_VAL",
+ cacheName: meta.cacheName,
+ typeName: typeName
+ });
+ }
+
+ var indexes = [];
+
+ for (var index of meta.indexes[typeName]) {
+ fields = [];
+
+ for (var 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
+ });
+ }
+
+ if (fields.length > 0)
+ indexes.push({
+ type: 'index',
+ name: index.name,
+ children: fields,
+ cacheName: meta.cacheName,
+ typeName: typeName
+ });
+ }
+
+ columns = _.sortBy(columns, 'name');
+
+ if (!_.isEmpty(indexes))
+ columns = columns.concat({
+ type: 'indexes',
+ name: 'Indexes',
+ cacheName: meta.cacheName,
+ typeName: typeName,
+ children: indexes
+ });
+
+ return {
+ type: 'type',
+ cacheName: meta.cacheName || "",
+ typeName: typeName,
+ children: columns
+ };
+ });
+
+ if (!_.isEmpty(cacheTypes))
+ types = types.concat(cacheTypes);
+ }
+
+ res.json(types);
+ })
+ .catch(_handleException(res));
+ });
+
+ /* Ping client. */
+ 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) {
+ _client(req.currentUserId())
+ .then((client) => client.availableDrivers())
+ .then((arr) => res.json(arr))
+ .catch(_handleException(res));
+ });
+
+ /** Get database schemas. */
+ router.post('/schemas', function (req, res) {
+ _client(req.currentUserId())
+ .then((client) => {
+ var args = req.body;
+
+ args.jdbcInfo = {user: args.user, password: args.password};
+
+ return client.metadataSchemas(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo)
+ })
+ .then((arr) => res.json(arr))
+ .catch(_handleException(res));
+ });
+
+ /** Get database tables. */
+ 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)
+ })
+ .then((arr) => res.json(arr))
+ .catch(_handleException(res));
+ });
+
+ resolve(router);
+ });
+};
+
[49/51] [abbrv] 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/b58eb482
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b58eb482
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b58eb482
Branch: refs/heads/ignite-843-rc3
Commit: b58eb482eae16be4b437e215583e2762c162915f
Parents: 0e1cfd0 9ba3e22
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Feb 9 15:45:54 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 15:45:54 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/stylesheets/style.scss | 21 ++++++++++++++++----
.../src/main/js/views/sql/sql.jade | 5 +++--
2 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[07/51] [abbrv] ignite git commit: IGNITE-843 Refactored server side.
Posted by ak...@apache.org.
IGNITE-843 Refactored server side.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4ba27835
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4ba27835
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4ba27835
Branch: refs/heads/ignite-843-rc3
Commit: 4ba2783532e2febb227f1b222c4b0608d8396b62
Parents: 721a116
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 12:58:54 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 12:58:54 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/package.json | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ba27835/modules/control-center-web/src/main/js/package.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/package.json b/modules/control-center-web/src/main/js/package.json
index fe4636b..e526d86 100644
--- a/modules/control-center-web/src/main/js/package.json
+++ b/modules/control-center-web/src/main/js/package.json
@@ -33,6 +33,7 @@
"express": "~4.13.3",
"express-force-ssl": "^0.3.0",
"express-session": "^1.12.0",
+ "fire-up": "^0.4.4",
"font-awesome": "^4.4.0",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
[33/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/51ffdfd7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/51ffdfd7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/51ffdfd7
Branch: refs/heads/ignite-843-rc3
Commit: 51ffdfd758ab030f8871ea23950b88ef77f04ee0
Parents: fc5b6ac
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 10:02:20 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 10:02:20 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/mongo.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/51ffdfd7/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 9d3ade9..26cccd8 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -131,7 +131,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
swapEnabled: Boolean,
evictionPolicy: {
- kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
+ kind: {type: String, enum: ['LRU', 'FIFO', 'SORTED']},
LRU: {
batchSize: Number,
maxMemorySize: Number,
@@ -142,7 +142,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
maxMemorySize: Number,
maxSize: Number
},
- Sorted: {
+ SORTED: {
batchSize: Number,
maxMemorySize: Number,
maxSize: Number
@@ -220,7 +220,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
nearConfiguration: {
nearStartSize: Number,
nearEvictionPolicy: {
- kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
+ kind: {type: String, enum: ['LRU', 'FIFO', 'SORTED']},
LRU: {
batchSize: Number,
maxMemorySize: Number,
@@ -231,7 +231,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
maxMemorySize: Number,
maxSize: Number
},
- Sorted: {
+ SORTED: {
batchSize: Number,
maxMemorySize: Number,
maxSize: Number
[10/51] [abbrv] ignite git commit: IGNITE-843 Minor getting started
fixes.
Posted by ak...@apache.org.
IGNITE-843 Minor getting started fixes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d7b22cd3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d7b22cd3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d7b22cd3
Branch: refs/heads/ignite-843-rc3
Commit: d7b22cd3f408e791f63621ac03a3d066043907cf
Parents: 3eec50a
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 15:56:01 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 15:56:01 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/data/getting-started.json | 2 +-
.../app/directives/information/information.jade | 4 +--
.../src/main/js/public/stylesheets/style.scss | 22 +++++--------
.../js/views/configuration/domains-import.jade | 2 +-
.../src/main/js/views/includes/infos.jade | 34 +++++++++-----------
.../js/views/templates/getting-started.jade | 2 +-
6 files changed, 29 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/modules/control-center-web/src/main/js/app/data/getting-started.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/data/getting-started.json b/modules/control-center-web/src/main/js/app/data/getting-started.json
index 5a2fb69..fd3b54c 100644
--- a/modules/control-center-web/src/main/js/app/data/getting-started.json
+++ b/modules/control-center-web/src/main/js/app/data/getting-started.json
@@ -8,7 +8,7 @@
"<li>Import domain model from database</li>",
"<li>Configure all needed caches</li>",
"<li>Preview generated XML and Java code in browser</li>",
- "<li>Download fully functional Maven project with generated XML and Java code</li>",
+ "<li>Download ready-to-use Maven project</li>",
"<li>Execute SQL queries on real clusters</li>",
"</ul>"
]
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/modules/control-center-web/src/main/js/app/directives/information/information.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/information/information.jade b/modules/control-center-web/src/main/js/app/directives/information/information.jade
index 8bb9cbc..b805d4a 100644
--- a/modules/control-center-web/src/main/js/app/directives/information/information.jade
+++ b/modules/control-center-web/src/main/js/app/directives/information/information.jade
@@ -15,6 +15,6 @@
limitations under the License.
.block-information
- span.icon.fa.fa-info-circle
- h3 {{::title}}
+ span.icon.fa.fa-info-circle(ng-if='title')
+ h3(ng-if='title') {{::title}}
div(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/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 19589b6..cea59a9 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
@@ -345,6 +345,14 @@ h1, h2, h3, h4, h5, h6 {
float: left;
margin: 0;
}
+
+ .btn:last-child {
+ margin-right: 0;
+ }
+
+ .checkbox {
+ margin: 0;
+ }
}
.login-header {
@@ -1815,20 +1823,6 @@ treecontrol.tree-classic {
margin: 15px 15px 300px;
}
-.getting-started-footer {
- @extend .modal-footer;
-
- padding: 10px 15px;
-
- .btn:last-child {
- margin-right: 0;
- }
-
- .checkbox {
- margin: 0;
- }
-}
-
.getting-started-demo {
color: $brand-info;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/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 87c439d..3bd9688 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
@@ -117,7 +117,7 @@ mixin td-ellipses-lbl(w, lbl)
thead
tr
th.header(colspan='6')
- .col-sm-4.pull-right(style='margin-bottom: 5px')
+ .col-sm-4.pull-right(style='margin-bottom: 8px')
input.form-control(type='text' st-search='label' placeholder='Filter tables...' ng-model='importDomain.displayedTablesFilter' ng-change='selectTable()')
tr
th(width='30px')
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/modules/control-center-web/src/main/js/views/includes/infos.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/infos.jade b/modules/control-center-web/src/main/js/views/includes/infos.jade
index 23313a3..d7f692d 100644
--- a/modules/control-center-web/src/main/js/views/includes/infos.jade
+++ b/modules/control-center-web/src/main/js/views/includes/infos.jade
@@ -15,26 +15,24 @@
limitations under the License.
mixin ignite-clusters-information
- ignite-information(data-title='On this screen you can')
+ ignite-information
ul
li Configure #[a(href='https://apacheignite.readme.io/docs/clustering' target='_blank') clusters] properties
li Associate clusters with caches and in-memory file systems
- li Preview XML and Java code
-mixin ignite-caches-information
- ignite-information(data-title='On this screen you can')
+mixin ignite-domains-information
+ ignite-information
ul
- li Configure #[a(href='https://apacheignite.readme.io/docs/data-grid' target='_blank') caches] properties
- li Associate caches with clusters and domain model
- li Preview XML and Java code
+ li Import database schemas
+ li Try in
+ span.getting-started-demo(ng-click='showImportDomainModal(true)' style='cursor: pointer') Demo
+ | mode
-mixin ignite-domains-information
- ignite-information(data-title='On this screen you can')
+mixin ignite-caches-information
+ ignite-information
ul
- li Import Domain model from database
- li Associate domain model with caches
- li Configure #[a(href='https://apacheignite.readme.io/docs/sql-queries' target='_blank') SQL queries]
- li Preview XML and Java code
+ li Configure memory settings
+ li Configure persistence
mixin ignite-igfs-information
ignite-information(data-title='Configure IGFS only if you are going to use In-memory File System')
@@ -44,10 +42,10 @@ mixin ignite-igfs-information
li In addition IGFS provides API to execute map-reduce tasks over file system data
mixin ignite-summary-information
- ignite-information(data-title='On this screen you can')
+ ignite-information
ul
li Preview XML configurations for #[a(href='https://apacheignite.readme.io/docs/clients-vs-servers' target='_blank') server and client] nodes
- li Preview Java classes with server and client nodes configuration from code
- li Preview Maven pom.xml
- li Preview #[a(href='https://apacheignite.readme.io/docs/docker-deployment' target='_blank') Dockerfile] for server node
- li Download fully functional Maven project
+ li Preview code configuration
+ li Preview #[a(href='https://apacheignite.readme.io/docs/docker-deployment' target='_blank') Docker file]
+ li Preview POM dependencies
+ li Download ready-to-use Maven project
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7b22cd3/modules/control-center-web/src/main/js/views/templates/getting-started.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/getting-started.jade b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
index 0c8d316..b6a4392 100644
--- a/modules/control-center-web/src/main/js/views/templates/getting-started.jade
+++ b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
@@ -20,7 +20,7 @@
h4.modal-title {{title}}
.getting-started
.col-xs-12(ng-bind-html='message')
- .getting-started-footer
+ .modal-footer
.checkbox
label
input(type='checkbox' ng-model='ui.showGettingStarted')
[12/51] [abbrv] ignite git commit: IGNITE-843 Refactored modules.
Posted by ak...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/logo/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/logo/main.js b/modules/control-center-web/src/main/js/app/modules/logo/main.js
deleted file mode 100644
index be7175d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/logo/main.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import templateLogo from './logo.jade!';
-const templateTitle = `<label class= 'title'>{{::title.text}}</label>`;
-import templatePoweredByApache from './powered-by-apache.jade!';
-
-import angular from 'angular';
-
-angular
- .module('ignite-console.logo', [
-
- ])
- .provider('igniteLogo', function() {
- let poweredBy = false;
-
- let url = '/images/ignite-logo.png';
-
- let title = 'Management console for Apache Ignite';
-
- this.url = function(_url) {
- url = _url;
-
- poweredBy = true;
- };
-
- this.title = function(_title) {
- title = _title;
- };
-
- this.$get = [function() {
- return {
- url,
- poweredBy,
- title
- };
- }];
- })
- .directive('ignitePoweredByApache', ['igniteLogo', function(igniteLogo) {
- function controller() {
- const ctrl = this;
-
- ctrl.show = igniteLogo.poweredBy;
- }
-
- return {
- restrict: 'E',
- template: templatePoweredByApache,
- controller,
- controllerAs: 'poweredBy',
- replace: true
- };
- }])
- .directive('igniteLogo', ['igniteLogo', function(igniteLogo) {
- function controller() {
- const ctrl = this;
-
- ctrl.url = igniteLogo.url;
- }
-
- return {
- restrict: 'E',
- template: templateLogo,
- controller,
- controllerAs: 'logo',
- replace: true
- };
- }])
- .directive('igniteTitle', ['igniteLogo', function(igniteLogo) {
- function controller() {
- const ctrl = this;
-
- ctrl.text = igniteLogo.title;
- }
-
- return {
- restrict: 'E',
- template: templateTitle,
- controller,
- controllerAs: 'title',
- replace: true
- };
- }]);
-
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/logo/powered-by-apache.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/logo/powered-by-apache.jade b/modules/control-center-web/src/main/js/app/modules/logo/powered-by-apache.jade
deleted file mode 100644
index af9aadf..0000000
--- a/modules/control-center-web/src/main/js/app/modules/logo/powered-by-apache.jade
+++ /dev/null
@@ -1,18 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-a(ng-if='poweredBy.show' href='//ignite.apache.org' target='_blank')
- img(ng-src='/images/pb-ignite.png' height='65')
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/Navbar.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/Navbar.provider.js b/modules/control-center-web/src/main/js/app/modules/navbar/Navbar.provider.js
new file mode 100644
index 0000000..f1ae1b2
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/Navbar.provider.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteNavbar', [function() {
+ const items = [];
+
+ this.push = function(data) {
+ items.push(data);
+ };
+
+ this.$get = [function() {
+ return items;
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js b/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
new file mode 100644
index 0000000..0e94063
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteUserbar', [function() {
+ return {
+ restrict: 'A',
+ controller: ['$rootScope', 'IgniteUserbar', function($root, IgniteUserbar) {
+ const ctrl = this;
+
+ ctrl.items = [
+ {text: 'Profile', sref: 'settings.profile'},
+ {text: 'Getting Started', click: 'gettingStarted.tryShow(true)'}
+ ];
+
+ const _rebuildSettings = (event, user) => {
+ ctrl.items.splice(2);
+
+ if (!user.becomeUsed && user.admin)
+ ctrl.items.push({text: 'Admin Panel', sref: 'settings.admin'});
+
+ ctrl.items.push(...IgniteUserbar);
+
+ if (!user.becomeUsed)
+ ctrl.items.push({text: 'Log Out', sref: 'logout'});
+ };
+
+ if ($root.user)
+ _rebuildSettings(null, $root.user);
+
+ $root.$on('user', _rebuildSettings);
+ }],
+ controllerAs: 'userbar'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.provider.js b/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.provider.js
new file mode 100644
index 0000000..9513641
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.provider.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteUserbar', [function() {
+ const items = [];
+
+ this.push = function(data) {
+ items.push(data);
+ };
+
+ this.$get = [function() {
+ return items;
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/main.js b/modules/control-center-web/src/main/js/app/modules/navbar/main.js
deleted file mode 100644
index 258026d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/navbar/main.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.navbar', [
-
-])
-.provider('igniteNavbar', function() {
- const items = [];
-
- this.push = function(data) {
- items.push(data);
- };
-
- this.$get = [function() {
- return items;
- }];
-})
-.directive('igniteNavbar', ['igniteNavbar', function(igniteNavbar) {
- function controller() {
- const ctrl = this;
-
- ctrl.items = igniteNavbar;
- }
-
- return {
- restrict: 'A',
- controller,
- controllerAs: 'navbar'
- };
-}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/navbar.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/navbar.directive.js b/modules/control-center-web/src/main/js/app/modules/navbar/navbar.directive.js
new file mode 100644
index 0000000..020cfe4
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/navbar.directive.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteNavbar', ['IgniteNavbar', (IgniteNavbar) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.items = IgniteNavbar;
+ }
+
+ return {
+ restrict: 'A',
+ controller,
+ controllerAs: 'navbar'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/navbar/navbar.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/navbar.module.js b/modules/control-center-web/src/main/js/app/modules/navbar/navbar.module.js
new file mode 100644
index 0000000..b845cbc
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/navbar.module.js
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import IgniteNavbar from './Navbar.provider';
+import IgniteUserbar from './Userbar.provider';
+
+import igniteNavbar from './navbar.directive';
+import igniteUserbar from './userbar.directive';
+
+angular
+.module('ignite-console.navbar', [
+
+])
+.provider(...IgniteNavbar)
+.provider(...IgniteUserbar)
+.directive(...igniteNavbar)
+.directive(...igniteUserbar);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/settings/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/settings/main.js b/modules/control-center-web/src/main/js/app/modules/settings/main.js
deleted file mode 100644
index fcc0609..0000000
--- a/modules/control-center-web/src/main/js/app/modules/settings/main.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.userbar', [
-
-])
-.provider('igniteSettings', function() {
- const items = [];
-
- this.push = function(data) {
- items.push(data);
- };
-
- this.$get = [function() {
- return items;
- }];
-})
-.directive('igniteSettings', function() {
- return {
- restrict: 'A',
- controller: ['$rootScope', 'igniteSettings', function($root, igniteSettings) {
- const ctrl = this;
-
- ctrl.items = [
- {text: 'Profile', sref: 'settings.profile'},
- {text: 'Getting Started', click: 'gettingStarted.tryShow(true)'}
- ];
-
- const _rebuildSettings = (event, user) => {
- ctrl.items.splice(2);
-
- if (!user.becomeUsed && user.admin)
- ctrl.items.push({text: 'Admin Panel', sref: 'settings.admin'});
-
- ctrl.items.push(...igniteSettings);
-
- if (!user.becomeUsed)
- ctrl.items.push({text: 'Log Out', sref: 'logout'});
- };
-
- if ($root.user)
- _rebuildSettings(null, $root.user);
-
- $root.$on('user', _rebuildSettings);
- }],
- controllerAs: 'settings'
- };
-});
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/states/login/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/login/index.js b/modules/control-center-web/src/main/js/app/modules/states/login/index.js
index 38cfb6b..e0632b4 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/login/index.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/login/index.js
@@ -21,7 +21,7 @@ angular
.module('ignite-console.states.login', [
'ui.router',
// services
- 'ignite-console.Auth'
+ 'ignite-console.user'
])
.config(['$stateProvider', function($stateProvider) {
// set up the states
@@ -36,9 +36,9 @@ angular
}
});
}])
-.run(['$rootScope', '$state', 'Auth', 'igniteTerms', function($root, $state, Auth, igniteTerms) {
+.run(['$rootScope', '$state', 'Auth', 'IgniteTerms', function($root, $state, Auth, IgniteTerms) {
$root.$on('$stateChangeStart', function(event, toState) {
- if (toState.name === igniteTerms.termsState)
+ if (toState.name === IgniteTerms.termsState)
return;
if (!Auth.authorized && (toState.name !== 'login' && !_.startsWith(toState.name, 'password.'))) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/terms/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/terms/main.js b/modules/control-center-web/src/main/js/app/modules/terms/main.js
deleted file mode 100644
index 0fad45d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/terms/main.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.terms', [
-
-])
-.provider('igniteTerms', function() {
- let _rows = [
- 'Apache Ignite Web Console',
- '© 2016 The Apache Software Foundation.',
- 'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
- ];
-
- let _state;
-
- this.footerRows = function(rows) {
- _rows = rows;
- };
-
- this.termsState = function(state) {
- _state = state;
- };
-
- this.$get = [function() {
- return {
- footerRows: _rows,
- termsState: _state
- };
- }];
-})
-.directive('igniteTerms', ['igniteTerms', function(igniteTerms) {
- function controller() {
- const ctrl = this;
-
- ctrl.footerRows = igniteTerms.footerRows;
- ctrl.termsState = igniteTerms.termsState;
- }
-
- return {
- restrict: 'A',
- controller,
- controllerAs: 'terms'
- };
-}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/services/Countries/Countries.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/services/Countries/Countries.service.js b/modules/control-center-web/src/main/js/app/services/Countries/Countries.service.js
new file mode 100644
index 0000000..82b8626
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/services/Countries/Countries.service.js
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Java built-in short class names.
+import COUNTRIES from 'app/data/countries.json!';
+
+export default ['IgniteCountries', function() {
+ return COUNTRIES;
+}];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/services/Countries/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/services/Countries/index.js b/modules/control-center-web/src/main/js/app/services/Countries/index.js
deleted file mode 100644
index 82b8626..0000000
--- a/modules/control-center-web/src/main/js/app/services/Countries/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Java built-in short class names.
-import COUNTRIES from 'app/data/countries.json!';
-
-export default ['IgniteCountries', function() {
- return COUNTRIES;
-}];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/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 573cfa5..6c25e46 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
@@ -17,7 +17,7 @@
// Controller for Clusters screen.
consoleModule.controller('clustersController', function ($http, $timeout, $scope, $state, $controller,
- $common, $focus, $confirm, $clone, $loading, $unsavedChangesGuard, $cleanup, igniteIncludeEventGroups) {
+ $common, $focus, $confirm, $clone, $loading, $unsavedChangesGuard, $cleanup, igniteEventGroups) {
$unsavedChangesGuard.install($scope);
var __original_value;
@@ -70,7 +70,7 @@ consoleModule.controller('clustersController', function ($http, $timeout, $scope
{value: undefined, label: 'Not set'}
];
- $scope.eventGroups = igniteIncludeEventGroups;
+ $scope.eventGroups = igniteEventGroups;
$scope.toggleExpanded = function () {
$scope.ui.expanded = !$scope.ui.expanded;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 7c663ec..da6705a 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -27,11 +27,6 @@ var consoleModule = angular.module('ignite-web-console',
.run(function ($rootScope, $http, $state, $common, Auth, User, IgniteGettingStarted) {
$rootScope.gettingStarted = IgniteGettingStarted;
- if (Auth.authorized)
- User.read().then(function (user) {
- $rootScope.$broadcast('user', user);
- });
-
$rootScope.revertIdentity = function () {
$http
.get('/api/v1/admin/revert/identity')
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
index fdca965..da1074b 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
@@ -827,7 +827,7 @@ $generatorJava.clusterEvents = function (cluster, res) {
if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
res.emptyLineIfNeeded();
- var evtGrps = angular.element(document.getElementById('app')).injector().get('igniteIncludeEventGroups');
+ var evtGrps = angular.element(document.getElementById('app')).injector().get('igniteEventGroups');
var evtGrpDscr = _.find(evtGrps, {value: cluster.includeEventTypes[0]});
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
index 5dd2711..830dca7 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -575,7 +575,7 @@ $generatorXml.clusterEvents = function (cluster, res) {
else {
res.startBlock('<list>');
- var evtGrps = angular.element(document.getElementById('app')).injector().get('igniteIncludeEventGroups');
+ var evtGrps = angular.element(document.getElementById('app')).injector().get('igniteEventGroups');
_.forEach(cluster.includeEventTypes, function(eventGroup, ix) {
if (ix > 0)
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/sidebar.jade b/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
index a59bb9c..bba6b25 100644
--- a/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
@@ -17,7 +17,7 @@
.row
.col-xs-3.col-sm-3.col-md-2.border-right.section-left.greedy
.sidebar-nav(bs-affix)
- ul.menu(ignite-configuration-sidebar)
+ ul.menu(ignite-sidebar)
li(ng-repeat='item in sidebar.items')
a(ui-sref-active='active' ui-sref='{{::item.sref}}')
span.fa-stack
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/views/includes/header.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/header.jade b/modules/control-center-web/src/main/js/views/includes/header.jade
index 5ff7766..3ed39b3 100644
--- a/modules/control-center-web/src/main/js/views/includes/header.jade
+++ b/modules/control-center-web/src/main/js/views/includes/header.jade
@@ -22,7 +22,7 @@ header#header.header
td.col-xs-3.col-sm-3.col-md-2
ignite-logo
td(ng-if='$root.user' style='padding-top: 20px')
- ul.nav.navbar-nav(ignite-configuration-sidebar ignite-navbar)
+ ul.nav.navbar-nav(ignite-sidebar ignite-navbar)
li(ng-class='{active: $state.includes("base.configuration")}')
a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='sidebar.items' data-placement='bottom-right') Configuration
span.caret
@@ -34,7 +34,7 @@ header#header.header
li(ui-sref-active='active' ng-repeat='item in navbar.items')
a(ui-sref='{{::item.sref}}') {{::item.text}}
- ul.nav.navbar-nav.pull-right(ignite-settings)
+ ul.nav.navbar-nav.pull-right(ignite-userbar)
li(ng-class='{active: $state.includes("settings")}')
- a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='settings.items' data-placement='bottom-right') {{user.username}}
+ a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='userbar.items' data-placement='bottom-right') {{user.username}}
span.caret
[31/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7ca17123
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7ca17123
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7ca17123
Branch: refs/heads/ignite-843-rc3
Commit: 7ca171239ca2c0812fe6517755eded6db60be309
Parents: 9c51b0e
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 09:38:18 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 09:38:18 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/mongo.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7ca17123/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 88ea6f4..9d3ade9 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -142,7 +142,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
maxMemorySize: Number,
maxSize: Number
},
- SORTED: {
+ Sorted: {
batchSize: Number,
maxMemorySize: Number,
maxSize: Number
@@ -231,7 +231,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
maxMemorySize: Number,
maxSize: Number
},
- SORTED: {
+ Sorted: {
batchSize: Number,
maxMemorySize: Number,
maxSize: Number
[05/51] [abbrv] ignite git commit: IGNITE-843 Caches min values.
Posted by ak...@apache.org.
IGNITE-843 Caches min values.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/57b82a1d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/57b82a1d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/57b82a1d
Branch: refs/heads/ignite-843-rc3
Commit: 57b82a1dfc780b22af6670e24416a017496301fd
Parents: f29c2fd
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 10:51:22 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 10:51:22 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/caches-controller.js | 4 ++++
.../src/main/js/controllers/models/caches.json | 3 +++
2 files changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/57b82a1d/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index 4ad6f77..7b8055a 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -572,6 +572,10 @@ consoleModule.controller('cachesController', [
}
}
+ if (item.writeBehindFlushSize === 0 && item.writeBehindFlushFrequency === 0)
+ return showPopoverMessage($scope.ui, 'store', 'writeBehindFlushSize',
+ 'Both \'Flush frequency\' and \'Flush size\' are not allowed as 0');
+
if (item.cacheMode !== 'LOCAL' && item.rebalanceMode !== 'NONE' && item.rebalanceBatchSize === 0)
return showPopoverMessage($scope.ui, 'rebalance', 'rebalanceBatchSize',
'Batch size should be more than 0 for not "NONE" rebalance mode', 10000);
http://git-wip-us.apache.org/repos/asf/ignite/blob/57b82a1d/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index 9c9ef73..1853cf2 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -335,6 +335,7 @@
"type": "number",
"model": "sqlOnheapRowCacheSize",
"placeholder": 10240,
+ "min": 1,
"tip": [
"Number of SQL rows which will be cached onheap to avoid deserialization on each SQL index access"
]
@@ -690,6 +691,7 @@
"model": "writeBehindBatchSize",
"disabled": "!backupItem.writeBehindEnabled",
"placeholder": 512,
+ "min": 1,
"tip": [
"Maximum batch size for write-behind cache store operations",
"Store operations (get or remove) are combined in a batch of this size to be passed to cache store"
@@ -725,6 +727,7 @@
"model": "writeBehindFlushThreadCount",
"disabled": "!backupItem.writeBehindEnabled",
"placeholder": 1,
+ "min": 1,
"tip": [
"Number of threads that will perform cache flushing"
]
[32/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc5b6ac0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc5b6ac0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc5b6ac0
Branch: refs/heads/ignite-843-rc3
Commit: fc5b6ac02d548fe71aac937bde4a91ee22ce30eb
Parents: 7ca1712
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 09:47:04 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 09:47:04 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/serve/config/default.json | 2 +-
modules/control-center-web/src/main/js/serve/routes/public.js | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc5b6ac0/modules/control-center-web/src/main/js/serve/config/default.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/serve/config/default.json b/modules/control-center-web/src/main/js/serve/config/default.json
index 574d42a..3dcc5ca 100644
--- a/modules/control-center-web/src/main/js/serve/config/default.json
+++ b/modules/control-center-web/src/main/js/serve/config/default.json
@@ -19,7 +19,7 @@
},
"smtp": {
"service": "",
- "username": "",
+ "username": "Apache Ignite Web Console",
"email": "",
"password": ""
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc5b6ac0/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 1aa9bc0..5d53639 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
@@ -138,15 +138,15 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
if (!user)
return res.status(401).send('No account with that email address exists!');
- if (err)
// TODO IGNITE-843 Send email to admin
+ if (err)
return res.status(401).send('Failed to reset password!');
user.resetPasswordToken = token;
user.save(function (err) {
- if (err)
// TODO IGNITE-843 Send email to admin
+ if (err)
return res.status(401).send('Failed to reset password!');
var mailer = nodemailer.createTransport(transporter);
@@ -160,7 +160,7 @@ module.exports.factory = function (express, passport, nodemailer, settings, mong
'http://' + req.headers.host + '/password/reset?token=' + token + '\n\n' +
'If you did not request this, please ignore this email and your password will remain unchanged.\n\n' +
'--------------\n' +
- 'Apache Ignite Web Console\n'
+ settings.smtp.username + '\n'
};
mailer.sendMail(mailOptions, function (err) {
[40/51] [abbrv] ignite git commit: IGNITE-843 Fixed discovery jcloud
ip finder saving regions and zones.
Posted by ak...@apache.org.
IGNITE-843 Fixed discovery jcloud ip finder saving regions and zones.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/79c6bfc0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/79c6bfc0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/79c6bfc0
Branch: refs/heads/ignite-843-rc3
Commit: 79c6bfc097d9326d99a196588e6aa73096faa2fe
Parents: 6240528
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Feb 9 11:35:56 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 11:35:56 2016 +0700
----------------------------------------------------------------------
.../clusters/general/discovery/cloud.jade | 31 ++++++++++----------
.../main/js/controllers/clusters-controller.js | 2 ++
2 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/79c6bfc0/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
index bca8c4e..258524f 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
@@ -17,7 +17,8 @@
- var model = 'backupItem.discovery.Cloud';
- var regions = model + '.regions';
- var zones = model + '.zones';
-- var form = 'generalDiscoveryCloudRegions'
+- var formRegions = 'discoveryCloudRegions'
+- var formZones = 'discoveryCloudZones'
div
.details-row
@@ -70,7 +71,7 @@ div
data-ng-required='true'
)
.details-row
- ignite-form-group(ng-model='#{regions}' ng-form='generalDiscoveryCloudRegions')
+ ignite-form-group(ng-model='#{regions}' ng-form='#{formRegions}')
ignite-form-field-label
| Regions
ignite-form-group-tooltip
@@ -78,11 +79,11 @@ div
| If the regions are not set then every region, that a cloud provider has, will be investigated. This could lead to significant performance degradation#[br]
| Note, that some cloud providers, like Google Compute Engine, doesn't have a notion of a region. For such providers regions are redundant
ignite-form-group-add(ng-click='group.add = [{}]')
- | Add new address
+ | Add new region
- var field = 'edit'
- - var valid = form + '.' + field + '.$valid'
- - var save = addresses + '[$index] = ' + field
+ - var valid = formRegions + '.' + field + '.$valid'
+ - var save = regions + '[$index] = ' + field
.group-content(ng-if='#{regions}.length')
ignite-form-field(ng-repeat='model in #{regions} track by $index' type='internal')
@@ -115,13 +116,13 @@ div
)
i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-show='!#{form}.#{field}.$pristine && #{form}.#{field}.$error.igniteUnique'
+ ng-show='!#{formRegions}.#{field}.$pristine && #{formRegions}.#{field}.$error.igniteUnique'
bs-tooltip
data-title='Such region already exists!'
)
- var field = 'new'
- - var valid = form + '.' + field + '.$valid'
+ - var valid = formRegions + '.' + field + '.$valid'
- var push = regions + '.push(' + field + ')'
.group-content(ng-repeat='field in group.add')
@@ -145,7 +146,7 @@ div
)
i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-show='!#{form}.#{field}.$pristine && #{form}.#{field}.$error.igniteUnique'
+ ng-show='!#{formRegions}.#{field}.$pristine && #{formRegions}.#{field}.$error.igniteUnique'
bs-tooltip
data-title='Such region already exists!'
)
@@ -153,7 +154,7 @@ div
.group-content-empty(ng-if='!(#{regions}.length) && !group.add.length')
| Not defined
.details-row
- ignite-form-group(ng-model='#{zones}' ng-form='generalDiscoveryCloudZones')
+ ignite-form-group(ng-model='#{zones}' ng-form='#{formZones}')
ignite-form-field-label
| Zones
ignite-form-group-tooltip
@@ -161,11 +162,11 @@ div
| If the zones are not set then every zone from specified regions, will be taken into account#[br]
| Note, that some cloud providers, like Rackspace, doesn't have a notion of a zone. For such providers zones are redundant
ignite-form-group-add(ng-click='group.add = [{}]')
- | Add new address
+ | Add new zone
- var field = 'edit'
- - var valid = form + '.' + field + '.$valid'
- - var save = addresses + '[$index] = ' + field
+ - var valid = formZones + '.' + field + '.$valid'
+ - var save = zones + '[$index] = ' + field
.group-content(ng-if='#{zones}.length')
ignite-form-field(ng-repeat='model in #{zones} track by $index' type='internal')
@@ -198,13 +199,13 @@ div
)
i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-show='!#{form}.#{field}.$pristine && #{form}.#{field}.$error.igniteUnique'
+ ng-show='!#{formZones}.#{field}.$pristine && #{formZones}.#{field}.$error.igniteUnique'
bs-tooltip
data-title='Such zone already exists!'
)
- var field = 'new'
- - var valid = form + '.' + field + '.$valid'
+ - var valid = formZones + '.' + field + '.$valid'
- var push = zones + '.push(' + field + ')'
.group-content(ng-repeat='field in group.add')
@@ -228,7 +229,7 @@ div
)
i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-show='!#{form}.#{field}.$pristine && #{form}.#{field}.$error.igniteUnique'
+ ng-show='!#{formZones}.#{field}.$pristine && #{formZones}.#{field}.$error.igniteUnique'
bs-tooltip
data-title='Such zone already exists!'
)
http://git-wip-us.apache.org/repos/asf/ignite/blob/79c6bfc0/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 6c25e46..a893a42 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
@@ -238,6 +238,8 @@ consoleModule.controller('clustersController', function ($http, $timeout, $scope
// Check cluster logical consistency.
function validate(item) {
+ $common.hidePopover();
+
if ($common.isEmptyString(item.name))
return showPopoverMessage($scope.ui, 'general', 'clusterName', 'Name should not be empty');
[38/51] [abbrv] ignite git commit: IGNITE-2551 Disable next button on
loading
Posted by ak...@apache.org.
IGNITE-2551 Disable next button on loading
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/66cddcae
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/66cddcae
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/66cddcae
Branch: refs/heads/ignite-843-rc3
Commit: 66cddcae392833e1646bfba492b042ad7c5e726b
Parents: 7dc0517
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 11:15:51 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 11:15:51 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/stylesheets/style.scss | 6 +++++-
modules/control-center-web/src/main/js/views/sql/sql.jade | 8 ++++----
2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/66cddcae/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 9a4a588..2d36ebe 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
@@ -1863,12 +1863,16 @@ treecontrol.tree-classic {
}
.grid {
+ .ui-grid-column-menu-button {
+ right: -5px;
+ }
+
.ui-grid-menu-button {
margin-top: -1px;
}
.ui-grid-column-menu-button-last-col {
- margin-right: 10px
+ margin-right: 0
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/66cddcae/modules/control-center-web/src/main/js/views/sql/sql.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade
index ca5ab1c..f4893dd 100644
--- a/modules/control-center-web/src/main/js/views/sql/sql.jade
+++ b/modules/control-center-web/src/main/js/views/sql/sql.jade
@@ -120,9 +120,9 @@ mixin chart-settings(mdl)
hr(style='margin: 0')
.col-sm-12
.sql-controls
- a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, true)' ng-click='actionAvailable(paragraph, true) ? execute(paragraph) : ""' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "execute", true)}}') Execute
- a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, true)' ng-click='actionAvailable(paragraph, true) ? explain(paragraph) : ""' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "explain", true)}}') Explain
- a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, false)' ng-click='actionAvailable(paragraph, false) ? scan(paragraph): ""' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "execute scan", false)}}') Scan
+ a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, true)' ng-click='actionAvailable(paragraph, true) && execute(paragraph)' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "execute", true)}}') Execute
+ a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, true)' ng-click='actionAvailable(paragraph, true) && explain(paragraph)' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "explain", true)}}') Explain
+ a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph, false)' ng-click='actionAvailable(paragraph, false) && scan(paragraph)' data-placement='bottom' bs-tooltip data-title='{{actionTooltip(paragraph, "execute scan", false)}}') Scan
.pull-right
labelHide System columns:
a.btn.btn-default.fa.fa-bars.tipLabel(ng-class='{"btn-info": paragraph.systemColumns}' ng-click='toggleSystemColumns(paragraph)' ng-disabled='paragraph.disabledSystemColumns' bs-tooltip data-title='Show "_KEY", "_VAL" columns')
@@ -178,4 +178,4 @@ mixin chart-settings(mdl)
hr(style='margin-top: 0; margin-bottom: 5px')
a(ng-show='paragraph.queryArgs.type' style='float: left; margin-left: 10px; margin-bottom: 5px' ng-click='showResultQuery(paragraph)') Show query
i.fa.fa-chevron-circle-right(ng-show=nextVisibleCondition style='float: right;margin-right: 10px; margin-top: 3px' ng-click='nextPage(paragraph)')
- a(ng-show=nextVisibleCondition style='float: right; margin-bottom: 5px;margin-right: 5px;' ng-click='nextPage(paragraph)') Next
+ a(ng-show=nextVisibleCondition ng-disabled='paragraph.loading' ng-click='!paragraph.loading && nextPage(paragraph)' style='float: right; margin-bottom: 5px;margin-right: 5px;') Next
[08/51] [abbrv] 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/addc83d6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/addc83d6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/addc83d6
Branch: refs/heads/ignite-843-rc3
Commit: addc83d6cba9ad776c413d005e807c9e4dc9a220
Parents: 4ba2783 63f6778
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 12:59:12 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 12:59:12 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/data/getting-started.json | 39 +++++++-------------
.../main/js/controllers/caches-controller.js | 4 ++
.../src/main/js/controllers/models/caches.json | 3 ++
.../src/main/js/public/stylesheets/style.scss | 8 ++++
.../js/views/templates/getting-started.jade | 2 +-
5 files changed, 30 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
[16/51] [abbrv] ignite git commit: IGNITE-843 Fixed wrong check for
top panels.
Posted by ak...@apache.org.
IGNITE-843 Fixed wrong check for top panels.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7334db0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7334db0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7334db0
Branch: refs/heads/ignite-843-rc3
Commit: a7334db0a5553e949232ba277a2a5d42d73919e2
Parents: b7567ef
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 16:33:45 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 16:33:45 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/controllers/common-module.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a7334db0/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index da6705a..d2625d0 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -569,7 +569,7 @@ consoleModule.service('$common', [
if (idx >= 0) {
var activePanels = ui.activePanels;
- if (!_.includes(ui.topPanels))
+ if (!_.includes(ui.topPanels, idx))
ui.expanded = true;
if (!activePanels || activePanels.length < 1)
[15/51] [abbrv] ignite git commit: IGNITE-2562 - Fixes #461.
Posted by ak...@apache.org.
IGNITE-2562 - Fixes #461.
Signed-off-by: Alexey Kuznetsov <ak...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b7567ef4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b7567ef4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b7567ef4
Branch: refs/heads/ignite-843-rc3
Commit: b7567ef4becc8b00dbb5dc3579a9bc8d77c98e59
Parents: a9c7534
Author: Dmitriyff <dm...@gmail.com>
Authored: Mon Feb 8 16:33:16 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 16:33:16 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/.eslintrc | 2 +-
.../bs-affix-update.directive.js | 34 ++++++++++++++++++++
.../control-center-web/src/main/js/app/index.js | 2 ++
.../src/main/js/public/stylesheets/style.scss | 4 +++
.../src/main/js/views/configuration/caches.jade | 1 +
.../main/js/views/configuration/clusters.jade | 1 +
.../main/js/views/configuration/domains.jade | 1 +
.../src/main/js/views/configuration/igfs.jade | 1 +
.../main/js/views/configuration/summary.jade | 1 +
.../src/main/js/views/includes/controls.jade | 2 +-
10 files changed, 47 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/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 6d377ee..b18ff6d 100644
--- a/modules/control-center-web/src/main/js/.eslintrc
+++ b/modules/control-center-web/src/main/js/.eslintrc
@@ -156,7 +156,7 @@ rules:
no-undefined: 2
no-unneeded-ternary: 2
no-unreachable: 2
- no-unused-expressions: 2
+ no-unused-expressions: [2, { allowShortCircuit: true }]
no-unused-vars: [2, {"vars": "all", "args": "after-used"}]
no-use-before-define: 2
no-useless-call: 2
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/modules/control-center-web/src/main/js/app/directives/bs-affix-update/bs-affix-update.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/bs-affix-update/bs-affix-update.directive.js b/modules/control-center-web/src/main/js/app/directives/bs-affix-update/bs-affix-update.directive.js
new file mode 100644
index 0000000..131089d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/directives/bs-affix-update/bs-affix-update.directive.js
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, aither express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import jQuery from 'jquery';
+
+export default ['igniteBsAffixUpdate', ['$window', '$timeout', ($window, $timeout) => {
+ let update = null;
+
+ const link = ({$last}) => {
+ if ($last) {
+ update && $timeout.cancel(update);
+ update = $timeout(() => jQuery($window).trigger('resize'), 1000);
+ }
+ };
+
+ return {
+ restrict: 'A',
+ link
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/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 ac45b73..fac2313 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -88,6 +88,7 @@ import igniteUiAcePom from './directives/ui-ace-pom/ui-ace-pom.directive';
import igniteUiAceDocker from './directives/ui-ace-docker/ui-ace-docker.directive';
import igniteUiAcePojos from './directives/ui-ace-pojos/ui-ace-pojos.directive';
import igniteFormFieldJavaClass from './directives/form-field-java-class/form-field-java-class.directive';
+import igniteBsAffixUpdate from './directives/bs-affix-update/bs-affix-update.directive';
// Services.
import cleanup from './services/cleanup/cleanup.service';
@@ -136,6 +137,7 @@ angular
.directive(...igniteUiAceDocker)
.directive(...igniteUiAcePojos)
.directive(...igniteFormFieldJavaClass)
+.directive(...igniteBsAffixUpdate)
// Services.
.service(...cleanup)
.service(...GeneratorXml)
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/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 cea59a9..9a4a588 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
@@ -956,6 +956,10 @@ button.form-control {
}
}
+.affix + .bs-affix-fix {
+ height: 78px;
+}
+
.panel-details {
margin-top: 5px;
padding: 5px;
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/modules/control-center-web/src/main/js/views/configuration/caches.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/caches.jade b/modules/control-center-web/src/main/js/views/configuration/caches.jade
index 518d90a..ba07ad9 100644
--- a/modules/control-center-web/src/main/js/views/configuration/caches.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/caches.jade
@@ -30,6 +30,7 @@ include ../includes/infos
button.btn.btn-primary(id='new-item' ng-click='createItem()') Add cache
+save-remove-buttons('cache')
hr
+ .bs-affix-fix
form.form-horizontal(name='ui.inputForm' ng-show='backupItem && tableVisibleRow(displayedRows, selectedItem)' novalidate)
.panel-group(bs-collapse ng-model='ui.activePanels' data-allow-multiple='true')
+groups('general', 'backupItem')
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/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 01ea947..e5a3a07 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
@@ -48,6 +48,7 @@ include ../includes/infos
.panel-tip-container(ng-show='backupItem')
i.btn.btn-primary.fa.fa-undo(id='undo-item' ng-disabled='!ui.inputForm.$dirty' ng-click='ui.inputForm.$dirty && resetAll()' bs-tooltip=undoTip data-placement='bottom' data-trigger='hover')
hr
+ .bs-affix-fix
div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels')
form.form-horizontal(name='ui.inputForm' ng-show='backupItem' novalidate)
.panel-group(ng-click='triggerDigest = true')
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/modules/control-center-web/src/main/js/views/configuration/domains.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/domains.jade b/modules/control-center-web/src/main/js/views/configuration/domains.jade
index 7a43c06..395ead1 100644
--- a/modules/control-center-web/src/main/js/views/configuration/domains.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/domains.jade
@@ -59,6 +59,7 @@ include ../includes/infos
button.btn.dropdown-toggle.btn-info(id='remove-demo-dropdown' ng-if='hasDemoItems()' data-toggle='dropdown' data-container='body' bs-dropdown='removeDemoDropdown' data-placement='bottom-right')
span.caret
hr
+ .bs-affix-fix
form.form-horizontal(name='ui.inputForm' ng-show='backupItem && tableVisibleRow((displayedRows | domainsValidation:ui.showValid:true), selectedItem)' novalidate)
.panel-group(bs-collapse ng-model='ui.activePanels' data-allow-multiple='true')
+groups('domainModel', 'backupItem')
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/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 7398d45..1bbff08 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
@@ -29,6 +29,7 @@ include ../includes/infos
button.btn.btn-primary(id='new-item' ng-click='createItem()') Add IGFS
+save-remove-buttons('IGFS')
hr
+ .bs-affix-fix
form.form-horizontal(name='ui.inputForm' ng-show='backupItem && tableVisibleRow(displayedRows, selectedItem)' novalidate)
.panel-group(bs-collapse ng-model='ui.activePanels' data-allow-multiple='true' ng-click='triggerDigest = true')
+groups('general', 'backupItem')
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/modules/control-center-web/src/main/js/views/configuration/summary.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/summary.jade b/modules/control-center-web/src/main/js/views/configuration/summary.jade
index 59f275c..e280f2b 100644
--- a/modules/control-center-web/src/main/js/views/configuration/summary.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/summary.jade
@@ -44,6 +44,7 @@ mixin ignite-form-field-tooltip(message)
label.tipLabel Project structure
button.btn.btn-primary(id='proprietary-jdbc-drivers' ng-if='downloadJdbcDriversVisible()' ng-click='downloadJdbcDrivers()' bs-tooltip='' data-title='Open proprietary JDBC drivers download pages' data-placement='bottom') Download JDBC drivers
hr
+ .bs-affix-fix
.panel-group(bs-collapse ng-init='ui.activePanels=[0,1]' ng-model='ui.activePanels' data-allow-multiple='true')
.panel.panel-default
.panel-heading(role='tab' bs-collapse-toggle)
http://git-wip-us.apache.org/repos/asf/ignite/blob/b7567ef4/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index 7ce0b5d..f08c9dd 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -536,7 +536,7 @@ mixin main-table(title, rows, focusId, click, rowTemplate, searchField)
.scrollable-y(ng-show='displayedRows.length > 0' style='max-height: 200px')
table
tbody
- tr(ng-repeat='row in displayedRows track by row._id')
+ tr(ng-repeat='row in displayedRows track by row._id' ignite-bs-affix-update)
td
a(ng-class='{active: row._id == selectedItem._id}' on-click-focus=focusId ng-click=click) #{rowTemplate}
label.placeholder(ng-show='displayedRows.length == 0') No #{rows} found
[45/51] [abbrv] ignite git commit: IGNITE-843 Fixed validation.
Posted by ak...@apache.org.
IGNITE-843 Fixed validation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cb137aec
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cb137aec
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cb137aec
Branch: refs/heads/ignite-843-rc3
Commit: cb137aecdfb47717c7e3e8814f4df9d6bde32269
Parents: 07ef278
Author: vsisko <vs...@gridgain.com>
Authored: Tue Feb 9 14:58:20 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 14:58:20 2016 +0700
----------------------------------------------------------------------
.../form-field-java-class/form-field-java-class.jade | 6 +++---
.../src/main/js/app/modules/form/field/input/number.jade | 4 ++--
.../src/main/js/controllers/caches-controller.js | 10 ----------
3 files changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/cb137aec/modules/control-center-web/src/main/js/app/directives/form-field-java-class/form-field-java-class.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/form-field-java-class/form-field-java-class.jade b/modules/control-center-web/src/main/js/app/directives/form-field-java-class/form-field-java-class.jade
index 3e5b1c4..ca8e6bb 100644
--- a/modules/control-center-web/src/main/js/app/directives/form-field-java-class/form-field-java-class.jade
+++ b/modules/control-center-web/src/main/js/app/directives/form-field-java-class/form-field-java-class.jade
@@ -46,8 +46,8 @@ div
)
span(ng-transclude)
+ +feedback('javaPackageSpecified', 'does not have package specified!')
+ +feedback('javaBuiltInClass', 'should not be the Java built-in class!')
+ +feedback('javaKeywords', 'could not contains reserved Java keyword!')
+feedback('javaIdentifier', 'is invalid Java identifier!')
+feedback('required', 'could not be empty!')
- +feedback('javaKeywords', 'could not contains reserved Java keyword!')
- +feedback('javaBuiltInClass', 'should not be the Java built-in class!')
- +feedback('javaPackageSpecified', 'does not have package specified!')
http://git-wip-us.apache.org/repos/asf/ignite/blob/cb137aec/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
index b032c46..01d2b48 100644
--- a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
@@ -37,8 +37,8 @@ mixin feedback(error, message)
data-ng-model-options='{debounce: 150}'
)
- +feedback('min', 'Value is less than allowable minimum')
- +feedback('max', 'Value is more than allowable maximum')
+ +feedback('min', 'Value is less than allowable minimum: {{ min || 0 }}')
+ +feedback('max', 'Value is more than allowable maximum: {{ max }}')
+feedback('number', 'Invalid value. Only numbers allowed')
span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/cb137aec/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index 7b8055a..2f00dad 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -560,16 +560,6 @@ consoleModule.controller('cachesController', [
if (!item.readThrough && !item.writeThrough)
return showPopoverMessage($scope.ui, 'store', 'readThrough',
'Store is configured but read/write through are not enabled!');
-
- if (item.cacheStoreFactory.kind === 'CacheJdbcPojoStoreFactory') {
- if ($common.isDefined(item.domains)) {
- var domains = cacheDomains($scope.backupItem);
-
- if (_.findIndex(domains, $common.domainForStoreConfigured) < 0)
- return showPopoverMessage($scope.ui, 'general', 'domains',
- 'Cache with configured JDBC POJO store factory should be associated with at least one domain model for cache store', 10000);
- }
- }
}
if (item.writeBehindFlushSize === 0 && item.writeBehindFlushFrequency === 0)
[13/51] [abbrv] ignite git commit: IGNITE-843 Refactored modules.
Posted by ak...@apache.org.
IGNITE-843 Refactored modules.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0fc97266
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0fc97266
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0fc97266
Branch: refs/heads/ignite-843-rc3
Commit: 0fc9726635cb832ec2a2fdad0d6ce17d5e12f6b2
Parents: 61fe0f7
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 16:03:43 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 16:03:43 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/app/index.js | 43 ++++---
.../src/main/js/app/modules/Auth/index.js | 84 --------------
.../src/main/js/app/modules/Form/form.module.js | 92 +++++++++++++++
.../src/main/js/app/modules/Form/index.js | 92 ---------------
.../app/modules/JavaTypes/JavaTypes.provider.js | 67 +++++++++++
.../src/main/js/app/modules/JavaTypes/index.js | 67 -----------
.../QueryNotebooks/QueryNotebooks.provider.js | 115 +++++++++++++++++++
.../main/js/app/modules/QueryNotebooks/index.js | 115 -------------------
.../main/js/app/modules/User/Auth.service.js | 76 ++++++++++++
.../main/js/app/modules/User/User.service.js | 58 ++++++++++
.../src/main/js/app/modules/User/index.js | 66 -----------
.../src/main/js/app/modules/User/user.module.js | 28 +++++
.../js/app/modules/Version/Version.provider.js | 32 ++++++
.../src/main/js/app/modules/Version/main.js | 32 ------
.../js/app/modules/branding/branding.module.js | 38 ++++++
.../js/app/modules/branding/logo.directive.js | 34 ++++++
.../src/main/js/app/modules/branding/logo.jade | 18 +++
.../js/app/modules/branding/logo.provider.js | 42 +++++++
.../branding/powered-by-apache.directive.js | 35 ++++++
.../app/modules/branding/powered-by-apache.jade | 18 +++
.../js/app/modules/branding/terms.directive.js | 31 +++++
.../js/app/modules/branding/terms.provider.js | 41 +++++++
.../js/app/modules/branding/title.directive.js | 35 ++++++
.../configuration/EventGroups.provider.js | 30 +++++
.../modules/configuration/Sidebar.provider.js | 39 +++++++
.../configuration/configuration.module.js | 32 ++++++
.../configuration/include-event-types/main.js | 36 ------
.../modules/configuration/sidebar.directive.js | 30 +++++
.../app/modules/configuration/sidebar/main.js | 56 ---------
.../main/js/app/modules/dialog/dialog.module.js | 32 ++++++
.../src/main/js/app/modules/dialog/index.js | 31 -----
.../getting-started/GettingStarted.provider.js | 112 ++++++++++++++++++
.../main/js/app/modules/getting-started/main.js | 112 ------------------
.../src/main/js/app/modules/logo/logo.jade | 18 ---
.../src/main/js/app/modules/logo/main.js | 98 ----------------
.../js/app/modules/logo/powered-by-apache.jade | 18 ---
.../js/app/modules/navbar/Navbar.provider.js | 28 +++++
.../js/app/modules/navbar/Userbar.directive.js | 48 ++++++++
.../js/app/modules/navbar/Userbar.provider.js | 28 +++++
.../src/main/js/app/modules/navbar/main.js | 47 --------
.../js/app/modules/navbar/navbar.directive.js | 30 +++++
.../main/js/app/modules/navbar/navbar.module.js | 33 ++++++
.../src/main/js/app/modules/settings/main.js | 65 -----------
.../main/js/app/modules/states/login/index.js | 6 +-
.../src/main/js/app/modules/terms/main.js | 61 ----------
.../app/services/Countries/Countries.service.js | 23 ++++
.../src/main/js/app/services/Countries/index.js | 23 ----
.../main/js/controllers/clusters-controller.js | 4 +-
.../src/main/js/controllers/common-module.js | 5 -
.../main/js/helpers/generator/generator-java.js | 2 +-
.../main/js/helpers/generator/generator-xml.js | 2 +-
.../main/js/views/configuration/sidebar.jade | 2 +-
.../src/main/js/views/includes/header.jade | 6 +-
53 files changed, 1256 insertions(+), 1060 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/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 3f4bd04..ac45b73 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -56,11 +56,9 @@ import 'angular-ui-grid/ui-grid.css!';
import 'angular-loading/angular-loading.css!';
import 'angular-motion/dist/angular-motion.css!';
-import './modules/User/index';
-import './modules/Auth/index';
-import './modules/Form/index';
-import './modules/JavaTypes/index';
-import './modules/QueryNotebooks/index';
+import './modules/Form/form.module';
+import './modules/JavaTypes/JavaTypes.provider';
+import './modules/QueryNotebooks/QueryNotebooks.provider';
import './modules/states/login/index';
import './modules/states/logout/index';
@@ -71,15 +69,13 @@ import './modules/states/profile/index';
import './modules/states/admin/index';
// ignite:modules
-import './modules/dialog/index';
-import './modules/navbar/main';
-import './modules/settings/main';
-import './modules/configuration/sidebar/main';
-import './modules/configuration/include-event-types/main';
-import './modules/terms/main';
-import './modules/logo/main';
-import './modules/getting-started/main';
-import './modules/Version/main';
+import './modules/user/user.module';
+import './modules/branding/branding.module';
+import './modules/navbar/navbar.module';
+import './modules/configuration/configuration.module';
+import './modules/getting-started/GettingStarted.provider';
+import './modules/dialog/dialog.module';
+import './modules/Version/Version.provider';
// endignite
// Directives.
@@ -97,7 +93,7 @@ import igniteFormFieldJavaClass from './directives/form-field-java-class/form-fi
import cleanup from './services/cleanup/cleanup.service';
import GeneratorXml from './services/Generator/Xml.service';
import GeneratorJava from './services/Generator/Java.service';
-import IgniteCountries from './services/Countries/index';
+import IgniteCountries from './services/Countries/Countries.service';
// Providers
@@ -110,8 +106,8 @@ angular
'ui.router.title',
'ngRetina',
// Base modules.
- 'ignite-console.Auth',
- 'ignite-console.User',
+ 'ignite-console.user',
+ 'ignite-console.branding',
'ignite-console.Form',
'ignite-console.JavaTypes',
'ignite-console.QueryNotebooks',
@@ -126,11 +122,7 @@ angular
// Common modules.
'ignite-console.dialog',
'ignite-console.navbar',
- 'ignite-console.userbar',
- 'ignite-console.configuration.sidebar',
- 'ignite-console.configuration.include-event-types',
- 'ignite-console.terms',
- 'ignite-console.logo',
+ 'ignite-console.configuration',
'ignite-console.getting-started',
'ignite-console.version'
])
@@ -170,6 +162,11 @@ angular
$locationProvider.html5Mode(true);
}])
-.run(['$rootScope', '$state', ($root, $state) => {
+.run(['$rootScope', '$state', 'Auth', 'User', ($root, $state, Auth, User) => {
$root.$state = $state;
+
+ if (Auth.authorized) {
+ User.read()
+ .then((user) => $root.$broadcast('user', user));
+ }
}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/Auth/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Auth/index.js b/modules/control-center-web/src/main/js/app/modules/Auth/index.js
deleted file mode 100644
index 31a2d94..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Auth/index.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.Auth', [
-
-])
-.provider('Auth', function() {
- let _auth = false;
-
- try {
- _auth = localStorage.authorized === 'true';
- }
- catch (ignore) {
- // No-op.
- }
-
- function _authorized(value) {
- try {
- return _auth = localStorage.authorized = !!value;
- } catch (ignore) {
- return _auth = !!value;
- }
- }
-
- this.$get = ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User', function($http, $root, $state, $common, gettingStarted, User) {
- return {
- get authorized() {
- return _auth;
- },
- set authorized(auth) {
- _authorized(auth);
- },
- auth(action, userInfo) {
- $http.post('/api/v1/' + action, userInfo)
- .then(User.read)
- .then((user) => {
- if (action !== 'password/forgot') {
- _authorized(true);
-
- $root.$broadcast('user', user);
-
- $state.go('base.configuration.clusters');
-
- $root.gettingStarted.tryShow();
- } else
- $state.go('password.send');
- })
- .catch(function(errMsg) {
- $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
- });
- },
- logout() {
- $http.post('/api/v1/logout')
- .then(function() {
- User.clean();
-
- _authorized(false);
-
- $state.go('login');
- })
- .catch(function(errMsg) {
- $common.showError(errMsg);
- });
- }
- };
- }];
-});
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/form.module.js b/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
new file mode 100644
index 0000000..aac831d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+// Panel.
+import igniteFormPanel from './panel/panel.directive';
+import igniteFormPanelChevron from './panel/chevron.directive';
+import igniteFormRevert from './panel/revert.directive';
+
+// Field.
+import igniteFormField from './field/field.directive';
+import igniteFormFieldLabel from './field/label.directive';
+import igniteFormFieldTooltip from './field/tooltip.directive';
+import igniteFormFieldDropdown from './field/dropdown.directive';
+import igniteFormFieldInputNumber from './field/input/number.directive';
+import igniteFormFieldInputText from './field/input/text.directive';
+import igniteFormFieldInputCheckbox from './field/input/checkbox.directive';
+import igniteFormFieldInputDatalist from './field/input/datalist.directive';
+
+// Group.
+import igniteFormGroup from './group/group.directive';
+import igniteFormGroupAdd from './group/add.directive';
+import igniteFormGroupTooltip from './group/tooltip.directive';
+
+// Validators.
+import javaKeywords from './validator/java-keywords.directive';
+import javaPackageSpecified from './validator/java-package-specified.directive';
+import javaBuiltInClass from './validator/java-built-in-class.directive';
+import javaIdentifier from './validator/java-identifier.directive';
+import javaPackageName from './validator/java-package-name.directive';
+import unique from './validator/unique.directive';
+
+// Helpers.
+import igniteFormFieldInputAutofocus from './field/input/autofocus.directive';
+import igniteFormFieldUp from './field/up.directive';
+import igniteFormFieldDown from './field/down.directive';
+import igniteFormControlFeedback from './field/form-control-feedback.directive';
+
+angular
+.module('ignite-console.Form', [
+
+])
+// Panel.
+.directive(...igniteFormPanel)
+.directive(...igniteFormPanelChevron)
+.directive(...igniteFormRevert)
+// Field.
+.directive(...igniteFormField)
+.directive(...igniteFormFieldLabel)
+.directive(...igniteFormFieldTooltip)
+.directive(...igniteFormFieldDropdown)
+.directive(...igniteFormFieldInputNumber)
+.directive(...igniteFormFieldInputText)
+.directive(...igniteFormFieldInputCheckbox)
+.directive(...igniteFormFieldInputDatalist)
+// Group.
+.directive(...igniteFormGroup)
+.directive(...igniteFormGroupAdd)
+.directive(...igniteFormGroupTooltip)
+// Validators.
+.directive(...javaKeywords)
+.directive(...javaPackageSpecified)
+.directive(...javaBuiltInClass)
+.directive(...javaIdentifier)
+.directive(...javaPackageName)
+.directive(...unique)
+// Helpers.
+.directive(...igniteFormFieldInputAutofocus)
+.directive(...igniteFormFieldUp)
+.directive(...igniteFormFieldDown)
+.directive(...igniteFormControlFeedback)
+// Generator of globally unique identifier.
+.factory('IgniteFormGUID', [() => {
+ let guid = 0;
+
+ return () => `form-field-${guid++}`;
+}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/Form/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/index.js b/modules/control-center-web/src/main/js/app/modules/Form/index.js
deleted file mode 100644
index aac831d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/index.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-// Panel.
-import igniteFormPanel from './panel/panel.directive';
-import igniteFormPanelChevron from './panel/chevron.directive';
-import igniteFormRevert from './panel/revert.directive';
-
-// Field.
-import igniteFormField from './field/field.directive';
-import igniteFormFieldLabel from './field/label.directive';
-import igniteFormFieldTooltip from './field/tooltip.directive';
-import igniteFormFieldDropdown from './field/dropdown.directive';
-import igniteFormFieldInputNumber from './field/input/number.directive';
-import igniteFormFieldInputText from './field/input/text.directive';
-import igniteFormFieldInputCheckbox from './field/input/checkbox.directive';
-import igniteFormFieldInputDatalist from './field/input/datalist.directive';
-
-// Group.
-import igniteFormGroup from './group/group.directive';
-import igniteFormGroupAdd from './group/add.directive';
-import igniteFormGroupTooltip from './group/tooltip.directive';
-
-// Validators.
-import javaKeywords from './validator/java-keywords.directive';
-import javaPackageSpecified from './validator/java-package-specified.directive';
-import javaBuiltInClass from './validator/java-built-in-class.directive';
-import javaIdentifier from './validator/java-identifier.directive';
-import javaPackageName from './validator/java-package-name.directive';
-import unique from './validator/unique.directive';
-
-// Helpers.
-import igniteFormFieldInputAutofocus from './field/input/autofocus.directive';
-import igniteFormFieldUp from './field/up.directive';
-import igniteFormFieldDown from './field/down.directive';
-import igniteFormControlFeedback from './field/form-control-feedback.directive';
-
-angular
-.module('ignite-console.Form', [
-
-])
-// Panel.
-.directive(...igniteFormPanel)
-.directive(...igniteFormPanelChevron)
-.directive(...igniteFormRevert)
-// Field.
-.directive(...igniteFormField)
-.directive(...igniteFormFieldLabel)
-.directive(...igniteFormFieldTooltip)
-.directive(...igniteFormFieldDropdown)
-.directive(...igniteFormFieldInputNumber)
-.directive(...igniteFormFieldInputText)
-.directive(...igniteFormFieldInputCheckbox)
-.directive(...igniteFormFieldInputDatalist)
-// Group.
-.directive(...igniteFormGroup)
-.directive(...igniteFormGroupAdd)
-.directive(...igniteFormGroupTooltip)
-// Validators.
-.directive(...javaKeywords)
-.directive(...javaPackageSpecified)
-.directive(...javaBuiltInClass)
-.directive(...javaIdentifier)
-.directive(...javaPackageName)
-.directive(...unique)
-// Helpers.
-.directive(...igniteFormFieldInputAutofocus)
-.directive(...igniteFormFieldUp)
-.directive(...igniteFormFieldDown)
-.directive(...igniteFormControlFeedback)
-// Generator of globally unique identifier.
-.factory('IgniteFormGUID', [() => {
- let guid = 0;
-
- return () => `form-field-${guid++}`;
-}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/JavaTypes/JavaTypes.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/JavaTypes/JavaTypes.provider.js b/modules/control-center-web/src/main/js/app/modules/JavaTypes/JavaTypes.provider.js
new file mode 100644
index 0000000..7b87ba7
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/JavaTypes/JavaTypes.provider.js
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+// Java built-in short class names.
+import JAVA_CLASSES from 'app/data/java-classes.json!';
+
+// Java built-in full class names.
+import JAVA_FULLNAME_CLASSES from 'app/data/java-fullname-classes.json!';
+
+import JAVA_KEYWORDS from 'app/data/java-keywords.json!';
+
+angular
+ .module('ignite-console.JavaTypes', [])
+ .provider('JavaTypes', function() {
+ this.$get = [function() {
+ return {
+ /**
+ * @param cls Class name to check.
+ * @returns boolean 'true' if given class name non a Java built-in type.
+ */
+ nonBuiltInClass(cls) {
+ return !(_.contains(JAVA_CLASSES, cls) || _.contains(JAVA_FULLNAME_CLASSES, cls));
+ },
+ /**
+ * @param value text to check.
+ * @returns boolean 'true' if given text is valid Java identifier.
+ */
+ validIdentifier(value) {
+ const regexp = /^(([a-zA-Z_$][a-zA-Z0-9_$]*)\.)*([a-zA-Z_$][a-zA-Z0-9_$]*)$/igm;
+
+ return value === '' || regexp.test(value);
+ },
+ /**
+ * @param value text to check.
+ * @returns boolean 'true' if given text is valid Java package.
+ */
+ validPackage(value) {
+ const regexp = /^(([a-zA-Z_$][a-zA-Z0-9_$]*)\.)*([a-zA-Z_$][a-zA-Z0-9_$]*(\.?\*)?)$/igm;
+
+ return value === '' || regexp.test(value);
+ },
+ /**
+ * @param value text to check.
+ * @returns boolean 'true' if given text non Java keyword.
+ */
+ isKeywords(value) {
+ return _.contains(JAVA_KEYWORDS, value);
+ }
+ };
+ }];
+ });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js b/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
deleted file mode 100644
index 7b87ba7..0000000
--- a/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-// Java built-in short class names.
-import JAVA_CLASSES from 'app/data/java-classes.json!';
-
-// Java built-in full class names.
-import JAVA_FULLNAME_CLASSES from 'app/data/java-fullname-classes.json!';
-
-import JAVA_KEYWORDS from 'app/data/java-keywords.json!';
-
-angular
- .module('ignite-console.JavaTypes', [])
- .provider('JavaTypes', function() {
- this.$get = [function() {
- return {
- /**
- * @param cls Class name to check.
- * @returns boolean 'true' if given class name non a Java built-in type.
- */
- nonBuiltInClass(cls) {
- return !(_.contains(JAVA_CLASSES, cls) || _.contains(JAVA_FULLNAME_CLASSES, cls));
- },
- /**
- * @param value text to check.
- * @returns boolean 'true' if given text is valid Java identifier.
- */
- validIdentifier(value) {
- const regexp = /^(([a-zA-Z_$][a-zA-Z0-9_$]*)\.)*([a-zA-Z_$][a-zA-Z0-9_$]*)$/igm;
-
- return value === '' || regexp.test(value);
- },
- /**
- * @param value text to check.
- * @returns boolean 'true' if given text is valid Java package.
- */
- validPackage(value) {
- const regexp = /^(([a-zA-Z_$][a-zA-Z0-9_$]*)\.)*([a-zA-Z_$][a-zA-Z0-9_$]*(\.?\*)?)$/igm;
-
- return value === '' || regexp.test(value);
- },
- /**
- * @param value text to check.
- * @returns boolean 'true' if given text non Java keyword.
- */
- isKeywords(value) {
- return _.contains(JAVA_KEYWORDS, value);
- }
- };
- }];
- });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/QueryNotebooks.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/QueryNotebooks.provider.js b/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/QueryNotebooks.provider.js
new file mode 100644
index 0000000..b9c1d4b
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/QueryNotebooks.provider.js
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+angular
+ .module('ignite-console.QueryNotebooks', [
+
+ ])
+ .provider('QueryNotebooks', function() {
+ const _demoNotebook = {
+ name: 'SQL demo',
+ paragraphs: [
+ {
+ name: 'Query with refresh rate',
+ cacheName: 'CarCache',
+ pageSize: 50,
+ query: 'SELECT count(*)\nFROM "CarCache".Car',
+ result: 'bar',
+ timeLineSpan: '1',
+ rate: {
+ value: 3,
+ unit: 1000,
+ installed: true
+ }
+ },
+ {
+ name: 'Simple query',
+ cacheName: 'CarCache',
+ pageSize: 50,
+ query: 'SELECT * FROM "CarCache".Car',
+ result: 'table',
+ timeLineSpan: '1',
+ rate: {
+ value: 30,
+ unit: 1000,
+ installed: false
+ }
+ },
+ {
+ name: 'Query with aggregates',
+ cacheName: 'CarCache',
+ pageSize: 50,
+ query: 'SELECT p.name, count(*) AS cnt\nFROM "ParkingCache".Parking p\nINNER JOIN "CarCache".Car c\n ON (p.id) = (c.parkingId)\nGROUP BY P.NAME',
+ result: 'table',
+ timeLineSpan: '1',
+ rate: {
+ value: 30,
+ unit: 1000,
+ installed: false
+ }
+ }
+ ],
+ expandedParagraphs: [0, 1, 2]
+ };
+
+ this.$get = ['$q', '$http', '$rootScope', ($q, $http, $rootScope) => {
+ return {
+ read(demo, noteId) {
+ if (demo)
+ return $q.when(angular.copy(_demoNotebook));
+
+ return $http.post('/api/v1/notebooks/get', {noteId})
+ .then(({data}) => {
+ return data;
+ });
+ },
+ save(demo, notebook) {
+ if (demo)
+ return $q.when();
+
+ return $http.post('/api/v1/notebooks/save', notebook).then(({data}) => {
+ return data;
+ });
+ },
+ remove(demo, nodeId) {
+ if (demo)
+ return $q.reject('Removing "SQL demo" notebook is not supported.');
+
+ return $http.post('/api/v1/notebooks/remove', {_id: nodeId})
+ .then(() => {
+ const idx = _.findIndex($rootScope.notebooks, (item) => {
+ return item._id === nodeId;
+ });
+
+ if (idx >= 0) {
+ $rootScope.notebooks.splice(idx, 1);
+
+ $rootScope.rebuildDropdown();
+
+ if (idx < $rootScope.notebooks.length)
+ return $rootScope.notebooks[idx];
+ }
+
+ if ($rootScope.notebooks.length > 0)
+ return $rootScope.notebooks[$rootScope.notebooks.length - 1];
+ });
+ }
+ };
+ }];
+ });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/index.js b/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/index.js
deleted file mode 100644
index b9c1d4b..0000000
--- a/modules/control-center-web/src/main/js/app/modules/QueryNotebooks/index.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
- .module('ignite-console.QueryNotebooks', [
-
- ])
- .provider('QueryNotebooks', function() {
- const _demoNotebook = {
- name: 'SQL demo',
- paragraphs: [
- {
- name: 'Query with refresh rate',
- cacheName: 'CarCache',
- pageSize: 50,
- query: 'SELECT count(*)\nFROM "CarCache".Car',
- result: 'bar',
- timeLineSpan: '1',
- rate: {
- value: 3,
- unit: 1000,
- installed: true
- }
- },
- {
- name: 'Simple query',
- cacheName: 'CarCache',
- pageSize: 50,
- query: 'SELECT * FROM "CarCache".Car',
- result: 'table',
- timeLineSpan: '1',
- rate: {
- value: 30,
- unit: 1000,
- installed: false
- }
- },
- {
- name: 'Query with aggregates',
- cacheName: 'CarCache',
- pageSize: 50,
- query: 'SELECT p.name, count(*) AS cnt\nFROM "ParkingCache".Parking p\nINNER JOIN "CarCache".Car c\n ON (p.id) = (c.parkingId)\nGROUP BY P.NAME',
- result: 'table',
- timeLineSpan: '1',
- rate: {
- value: 30,
- unit: 1000,
- installed: false
- }
- }
- ],
- expandedParagraphs: [0, 1, 2]
- };
-
- this.$get = ['$q', '$http', '$rootScope', ($q, $http, $rootScope) => {
- return {
- read(demo, noteId) {
- if (demo)
- return $q.when(angular.copy(_demoNotebook));
-
- return $http.post('/api/v1/notebooks/get', {noteId})
- .then(({data}) => {
- return data;
- });
- },
- save(demo, notebook) {
- if (demo)
- return $q.when();
-
- return $http.post('/api/v1/notebooks/save', notebook).then(({data}) => {
- return data;
- });
- },
- remove(demo, nodeId) {
- if (demo)
- return $q.reject('Removing "SQL demo" notebook is not supported.');
-
- return $http.post('/api/v1/notebooks/remove', {_id: nodeId})
- .then(() => {
- const idx = _.findIndex($rootScope.notebooks, (item) => {
- return item._id === nodeId;
- });
-
- if (idx >= 0) {
- $rootScope.notebooks.splice(idx, 1);
-
- $rootScope.rebuildDropdown();
-
- if (idx < $rootScope.notebooks.length)
- return $rootScope.notebooks[idx];
- }
-
- if ($rootScope.notebooks.length > 0)
- return $rootScope.notebooks[$rootScope.notebooks.length - 1];
- });
- }
- };
- }];
- });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
new file mode 100644
index 0000000..175c22c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User', function($http, $root, $state, $common, gettingStarted, User) {
+ let _auth = false;
+
+ try {
+ _auth = localStorage.authorized === 'true';
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ function _authorized(value) {
+ try {
+ return _auth = localStorage.authorized = !!value;
+ } catch (ignore) {
+ return _auth = !!value;
+ }
+ }
+
+ return {
+ get authorized() {
+ return _auth;
+ },
+ set authorized(auth) {
+ _authorized(auth);
+ },
+ auth(action, userInfo) {
+ $http.post('/api/v1/' + action, userInfo)
+ .then(User.read)
+ .then((user) => {
+ if (action !== 'password/forgot') {
+ _authorized(true);
+
+ $root.$broadcast('user', user);
+
+ $state.go('base.configuration.clusters');
+
+ $root.gettingStarted.tryShow();
+ } else
+ $state.go('password.send');
+ })
+ .catch(function(errMsg) {
+ $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
+ });
+ },
+ logout() {
+ $http.post('/api/v1/logout')
+ .then(function() {
+ User.clean();
+
+ _authorized(false);
+
+ $state.go('login');
+ })
+ .catch(function(errMsg) {
+ $common.showError(errMsg);
+ });
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/User/User.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/User.service.js b/modules/control-center-web/src/main/js/app/modules/User/User.service.js
new file mode 100644
index 0000000..dc2117e
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/User/User.service.js
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['User', ['$q', '$injector', '$rootScope', '$state', '$http', function($q, $injector, $root, $state, $http) {
+ let _user;
+
+ try {
+ _user = JSON.parse(localStorage.user);
+
+ if (_user)
+ $root.user = _user;
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return {
+ read() {
+ return $http.post('/api/v1/user').then(({data}) => {
+ if (_.isEmpty(data)) {
+ const Auth = $injector.get('Auth');
+
+ Auth.authorized = false;
+
+ $state.go('login');
+ }
+
+ try {
+ localStorage.user = JSON.stringify(data);
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return _user = $root.user = data;
+ });
+ },
+ clean() {
+ delete $root.user;
+
+ delete localStorage.user;
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/User/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/index.js b/modules/control-center-web/src/main/js/app/modules/User/index.js
deleted file mode 100644
index 6d81b65..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/index.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.User', [
-
-])
-.provider('User', function() {
- let _user;
-
- try {
- _user = JSON.parse(localStorage.user);
- }
- catch (ignore) {
- // No-op.
- }
-
- this.$get = ['$q', '$injector', '$rootScope', '$state', '$http', ($q, $injector, $root, $state, $http) => {
- if (_user)
- $root.user = _user;
-
- return {
- read() {
- return $http.post('/api/v1/user').then(({data}) => {
- if (_.isEmpty(data)) {
- const Auth = $injector.get('Auth');
-
- Auth.authorized = false;
-
- $state.go('login');
- }
-
- try {
- localStorage.user = JSON.stringify(data);
- }
- catch (ignore) {
- // No-op.
- }
-
- return _user = $root.user = data;
- });
- },
- clean() {
- delete $root.user;
-
- delete localStorage.user;
- }
- };
- }];
-});
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/User/user.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/user.module.js b/modules/control-center-web/src/main/js/app/modules/User/user.module.js
new file mode 100644
index 0000000..2387f20
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/User/user.module.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import Auth from './Auth.service';
+import User from './User.service';
+
+angular
+.module('ignite-console.user', [
+
+])
+.service(...Auth)
+.service(...User);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/Version/Version.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Version/Version.provider.js b/modules/control-center-web/src/main/js/app/modules/Version/Version.provider.js
new file mode 100644
index 0000000..4aa008e
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/Version/Version.provider.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+angular
+ .module('ignite-console.version', [])
+ .provider('IgniteVersion', function() {
+ const version = {
+ version: '1.5.0-final'
+ };
+
+ this.update = (newVersion) => {
+ version.version = newVersion;
+ };
+
+ this.$get = [() => version];
+ });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/Version/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Version/main.js b/modules/control-center-web/src/main/js/app/modules/Version/main.js
deleted file mode 100644
index 4aa008e..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Version/main.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
- .module('ignite-console.version', [])
- .provider('IgniteVersion', function() {
- const version = {
- version: '1.5.0-final'
- };
-
- this.update = (newVersion) => {
- version.version = newVersion;
- };
-
- this.$get = [() => version];
- });
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/branding.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/branding.module.js b/modules/control-center-web/src/main/js/app/modules/branding/branding.module.js
new file mode 100644
index 0000000..dc65efc
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/branding.module.js
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import IgniteLogo from './Logo.provider';
+import IgniteTerms from './Terms.provider';
+
+import ignitePoweredByApache from './powered-by-apache.directive';
+import igniteLogo from './logo.directive';
+import igniteTitle from './title.directive';
+import igniteTerms from './terms.directive';
+
+angular
+.module('ignite-console.branding', [
+
+])
+.provider(...IgniteLogo)
+.provider(...IgniteTerms)
+.directive(...ignitePoweredByApache)
+.directive(...igniteLogo)
+.directive(...igniteTitle)
+.directive(...igniteTerms);
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/logo.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/logo.directive.js b/modules/control-center-web/src/main/js/app/modules/branding/logo.directive.js
new file mode 100644
index 0000000..ff46945
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/logo.directive.js
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import templateLogo from './logo.jade!';
+
+export default ['igniteLogo', ['IgniteLogo', (IgniteLogo) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.url = IgniteLogo.url;
+ }
+
+ return {
+ restrict: 'E',
+ template: templateLogo,
+ controller,
+ controllerAs: 'logo',
+ replace: true
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/logo.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/logo.jade b/modules/control-center-web/src/main/js/app/modules/branding/logo.jade
new file mode 100644
index 0000000..b807921
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/logo.jade
@@ -0,0 +1,18 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+a(href='/')
+ img.navbar-brand(ng-src='{{logo.url}}' height='40')
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
new file mode 100644
index 0000000..fcefc7c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteLogo', [function() {
+ let poweredBy = false;
+
+ let url = '/images/ignite-logo.png';
+
+ let title = 'Management console for Apache Ignite';
+
+ this.url = (_url) => {
+ url = _url;
+
+ poweredBy = true;
+ };
+
+ this.title = (_title) => {
+ title = _title;
+ };
+
+ this.$get = [() => {
+ return {
+ url,
+ poweredBy,
+ title
+ };
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.directive.js b/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.directive.js
new file mode 100644
index 0000000..fd2ab98
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.directive.js
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import templatePoweredByApache from './powered-by-apache.jade!';
+
+export default ['ignitePoweredByApache', ['IgniteLogo', (IgniteLogo) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.show = IgniteLogo.poweredBy;
+ }
+
+ return {
+ restrict: 'E',
+ template: templatePoweredByApache,
+ controller,
+ controllerAs: 'poweredBy',
+ replace: true
+ };
+}]];
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.jade b/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.jade
new file mode 100644
index 0000000..af9aadf
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/powered-by-apache.jade
@@ -0,0 +1,18 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+a(ng-if='poweredBy.show' href='//ignite.apache.org' target='_blank')
+ img(ng-src='/images/pb-ignite.png' height='65')
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/terms.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/terms.directive.js b/modules/control-center-web/src/main/js/app/modules/branding/terms.directive.js
new file mode 100644
index 0000000..22f2977
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/terms.directive.js
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteTerms', ['IgniteTerms', (IgniteTerms) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.footerRows = IgniteTerms.footerRows;
+ ctrl.termsState = IgniteTerms.termsState;
+ }
+
+ return {
+ restrict: 'A',
+ controller,
+ controllerAs: 'terms'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
new file mode 100644
index 0000000..c9c6009
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteTerms', [function() {
+ let _rows = [
+ 'Apache Ignite Web Console',
+ '© 2016 The Apache Software Foundation.',
+ 'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
+ ];
+
+ let _state;
+
+ this.footerRows = function(rows) {
+ _rows = rows;
+ };
+
+ this.termsState = function(state) {
+ _state = state;
+ };
+
+ this.$get = [function() {
+ return {
+ footerRows: _rows,
+ termsState: _state
+ };
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/branding/title.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/title.directive.js b/modules/control-center-web/src/main/js/app/modules/branding/title.directive.js
new file mode 100644
index 0000000..83b8a7b
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/title.directive.js
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const templateTitle = `<label class= 'title'>{{::title.text}}</label>`;
+
+export default ['igniteTitle', ['IgniteLogo', (IgniteLogo) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.text = IgniteLogo.title;
+ }
+
+ return {
+ restrict: 'E',
+ template: templateTitle,
+ controller,
+ controllerAs: 'title',
+ replace: true
+ };
+}]];
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/EventGroups.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/EventGroups.provider.js b/modules/control-center-web/src/main/js/app/modules/configuration/EventGroups.provider.js
new file mode 100644
index 0000000..2bbf11f
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/configuration/EventGroups.provider.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Events groups.
+import GROUPS from 'app/data/event-types.json!';
+
+export default ['igniteEventGroups', function() {
+ const groups = GROUPS;
+
+ this.push = (data) => groups.push(data);
+
+ this.$get = [() => {
+ return groups;
+ }];
+}];
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/Sidebar.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/Sidebar.provider.js b/modules/control-center-web/src/main/js/app/modules/configuration/Sidebar.provider.js
new file mode 100644
index 0000000..8bd5ba3
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/configuration/Sidebar.provider.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+export default ['igniteSidebar', function() {
+ const items = [
+ { text: 'Clusters', sref: 'base.configuration.clusters' },
+ { text: 'Model', sref: 'base.configuration.domains' },
+ { text: 'Caches', sref: 'base.configuration.caches' },
+ { text: 'IGFS', sref: 'base.configuration.igfs' }
+ ];
+
+ this.push = function(data) {
+ items.push(data);
+ };
+
+ this.$get = [function() {
+ const r = angular.copy(items);
+
+ r.push({ text: 'Summary', sref: 'base.configuration.summary' });
+
+ return r;
+ }];
+}];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/configuration.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/configuration.module.js b/modules/control-center-web/src/main/js/app/modules/configuration/configuration.module.js
new file mode 100644
index 0000000..94bdeb8
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/configuration/configuration.module.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import igniteEventGroups from './EventGroups.provider';
+import igniteSidebar from './Sidebar.provider';
+
+import igniteSidebarDirective from './sidebar.directive';
+
+// Ignite events groups.
+angular
+.module('ignite-console.configuration', [
+
+])
+.provider(...igniteEventGroups)
+.provider(...igniteSidebar)
+.directive(...igniteSidebarDirective);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/include-event-types/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/include-event-types/main.js b/modules/control-center-web/src/main/js/app/modules/configuration/include-event-types/main.js
deleted file mode 100644
index c75e0ae..0000000
--- a/modules/control-center-web/src/main/js/app/modules/configuration/include-event-types/main.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Events groups.
-import GROUPS from 'app/data/event-types.json!';
-
-import angular from 'angular';
-
-// Ignite events groups.
-angular
- .module('ignite-console.configuration.include-event-types', [
-
- ])
-.provider('igniteIncludeEventGroups', function() {
- const groups = GROUPS;
-
- this.push = (data) => groups.push(data);
-
- this.$get = [() => {
- return groups;
- }];
-});
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/sidebar.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/sidebar.directive.js b/modules/control-center-web/src/main/js/app/modules/configuration/sidebar.directive.js
new file mode 100644
index 0000000..e51553b
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/configuration/sidebar.directive.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteSidebar', ['igniteSidebar', (igniteSidebar) => {
+ function controller() {
+ const ctrl = this;
+
+ ctrl.items = igniteSidebar;
+ }
+
+ return {
+ restrict: 'A',
+ controller,
+ controllerAs: 'sidebar'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/configuration/sidebar/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/configuration/sidebar/main.js b/modules/control-center-web/src/main/js/app/modules/configuration/sidebar/main.js
deleted file mode 100644
index 4e2c39c..0000000
--- a/modules/control-center-web/src/main/js/app/modules/configuration/sidebar/main.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-angular
-.module('ignite-console.configuration.sidebar', [
-
-])
-.provider('igniteConfigurationSidebar', function() {
- const items = [
- { text: 'Clusters', sref: 'base.configuration.clusters' },
- { text: 'Model', sref: 'base.configuration.domains' },
- { text: 'Caches', sref: 'base.configuration.caches' },
- { text: 'IGFS', sref: 'base.configuration.igfs' }
- ];
-
- this.push = function(data) {
- items.push(data);
- };
-
- this.$get = [function() {
- const r = angular.copy(items);
-
- r.push({ text: 'Summary', sref: 'base.configuration.summary' });
-
- return r;
- }];
-})
-.directive('igniteConfigurationSidebar', ['igniteConfigurationSidebar', function(igniteConfigurationSidebar) {
- function controller() {
- const ctrl = this;
-
- ctrl.items = igniteConfigurationSidebar;
- }
-
- return {
- restrict: 'A',
- controller,
- controllerAs: 'sidebar'
- };
-}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/dialog/dialog.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/dialog/dialog.module.js b/modules/control-center-web/src/main/js/app/modules/dialog/dialog.module.js
new file mode 100644
index 0000000..c9ba9f9
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/dialog/dialog.module.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import igniteDialog from './dialog.directive';
+import igniteDialogTitle from './dialog-title.directive';
+import igniteDialogContent from './dialog-content.directive';
+import IgniteDialog from './dialog.factory';
+
+angular
+.module('ignite-console.dialog', [
+
+])
+.factory(...IgniteDialog)
+.directive(...igniteDialog)
+.directive(...igniteDialogTitle)
+.directive(...igniteDialogContent);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/dialog/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/dialog/index.js b/modules/control-center-web/src/main/js/app/modules/dialog/index.js
deleted file mode 100644
index 2ca51ba..0000000
--- a/modules/control-center-web/src/main/js/app/modules/dialog/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-import igniteDialog from './dialog.directive';
-import igniteDialogTitle from './dialog-title.directive';
-import igniteDialogContent from './dialog-content.directive';
-import IgniteDialog from './dialog.factory';
-
-angular
-.module('ignite-console.dialog', [
-
-])
-.factory(...IgniteDialog)
-.directive(...igniteDialog)
-.directive(...igniteDialogTitle)
-.directive(...igniteDialogContent);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/getting-started/GettingStarted.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/getting-started/GettingStarted.provider.js b/modules/control-center-web/src/main/js/app/modules/getting-started/GettingStarted.provider.js
new file mode 100644
index 0000000..d3379a0
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/getting-started/GettingStarted.provider.js
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+// Getting started pages.
+import PAGES from 'app/data/getting-started.json!';
+
+angular
+ .module('ignite-console.getting-started', [])
+ .provider('igniteGettingStarted', function() {
+ const items = PAGES;
+
+ this.push = (before, data) => {
+ const idx = _.findIndex(items, {title: before});
+
+ if (idx < 0)
+ items.push(data);
+ else
+ items.splice(idx, 0, data);
+ };
+
+ this.update = (before, data) => {
+ const idx = _.findIndex(items, {title: before});
+
+ if (idx >= 0)
+ items[idx] = data;
+ };
+
+ this.$get = [function() {
+ return items;
+ }];
+ })
+ .service('IgniteGettingStarted', ['$rootScope', '$modal', 'igniteGettingStarted', function($root, $modal, igniteGettingStarted) {
+ const _model = igniteGettingStarted;
+
+ let _page = 0;
+
+ const scope = $root.$new();
+
+ scope.ui = {
+ showGettingStarted: false
+ };
+
+ function _fillPage() {
+ scope.title = _model[_page].title;
+ scope.message = _model[_page].message.join(' ');
+ }
+
+ scope.isFirst = () => _page === 0;
+
+ scope.isLast = () => _page === _model.length - 1;
+
+ scope.next = () => {
+ _page += 1;
+
+ _fillPage();
+ };
+
+ scope.prev = () => {
+ _page -= 1;
+
+ _fillPage();
+ };
+
+ const dialog = $modal({templateUrl: '/templates/getting-started.html', scope, placement: 'center', show: false, backdrop: 'static'});
+
+ scope.close = () => {
+ try {
+ localStorage.showGettingStarted = scope.ui.showGettingStarted;
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ dialog.hide();
+ };
+
+ return {
+ tryShow: (force) => {
+ try {
+ scope.ui.showGettingStarted = typeof localStorage.showGettingStarted === 'undefined'
+ || localStorage.showGettingStarted === 'true';
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ if (force || scope.ui.showGettingStarted) {
+ _page = 0;
+
+ _fillPage();
+
+ dialog.show();
+ }
+ }
+ };
+ }]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/getting-started/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/getting-started/main.js b/modules/control-center-web/src/main/js/app/modules/getting-started/main.js
deleted file mode 100644
index d3379a0..0000000
--- a/modules/control-center-web/src/main/js/app/modules/getting-started/main.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-// Getting started pages.
-import PAGES from 'app/data/getting-started.json!';
-
-angular
- .module('ignite-console.getting-started', [])
- .provider('igniteGettingStarted', function() {
- const items = PAGES;
-
- this.push = (before, data) => {
- const idx = _.findIndex(items, {title: before});
-
- if (idx < 0)
- items.push(data);
- else
- items.splice(idx, 0, data);
- };
-
- this.update = (before, data) => {
- const idx = _.findIndex(items, {title: before});
-
- if (idx >= 0)
- items[idx] = data;
- };
-
- this.$get = [function() {
- return items;
- }];
- })
- .service('IgniteGettingStarted', ['$rootScope', '$modal', 'igniteGettingStarted', function($root, $modal, igniteGettingStarted) {
- const _model = igniteGettingStarted;
-
- let _page = 0;
-
- const scope = $root.$new();
-
- scope.ui = {
- showGettingStarted: false
- };
-
- function _fillPage() {
- scope.title = _model[_page].title;
- scope.message = _model[_page].message.join(' ');
- }
-
- scope.isFirst = () => _page === 0;
-
- scope.isLast = () => _page === _model.length - 1;
-
- scope.next = () => {
- _page += 1;
-
- _fillPage();
- };
-
- scope.prev = () => {
- _page -= 1;
-
- _fillPage();
- };
-
- const dialog = $modal({templateUrl: '/templates/getting-started.html', scope, placement: 'center', show: false, backdrop: 'static'});
-
- scope.close = () => {
- try {
- localStorage.showGettingStarted = scope.ui.showGettingStarted;
- }
- catch (ignore) {
- // No-op.
- }
-
- dialog.hide();
- };
-
- return {
- tryShow: (force) => {
- try {
- scope.ui.showGettingStarted = typeof localStorage.showGettingStarted === 'undefined'
- || localStorage.showGettingStarted === 'true';
- }
- catch (ignore) {
- // No-op.
- }
-
- if (force || scope.ui.showGettingStarted) {
- _page = 0;
-
- _fillPage();
-
- dialog.show();
- }
- }
- };
- }]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0fc97266/modules/control-center-web/src/main/js/app/modules/logo/logo.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/logo/logo.jade b/modules/control-center-web/src/main/js/app/modules/logo/logo.jade
deleted file mode 100644
index b807921..0000000
--- a/modules/control-center-web/src/main/js/app/modules/logo/logo.jade
+++ /dev/null
@@ -1,18 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-a(href='/')
- img.navbar-brand(ng-src='{{logo.url}}' height='40')
[41/51] [abbrv] 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/d7bf9e1f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d7bf9e1f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d7bf9e1f
Branch: refs/heads/ignite-843-rc3
Commit: d7bf9e1f5a2d8e8a091210342beb8e9b3942e090
Parents: 79c6bfc 750f4b8
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Feb 9 11:36:59 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 11:36:59 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/stylesheets/style.scss | 6 +++++-
modules/control-center-web/src/main/js/views/sql/sql.jade | 8 ++++----
2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[36/51] [abbrv] 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/fa9482bb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fa9482bb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fa9482bb
Branch: refs/heads/ignite-843-rc3
Commit: fa9482bb62d0d2f5fd0c59237e20d433812e470d
Parents: 6d1c988 7dc0517
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Feb 9 10:41:43 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 10:41:43 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/views/reset.jade | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[23/51] [abbrv] ignite git commit: IGNITE-843 es6.
Posted by ak...@apache.org.
IGNITE-843 es6.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7612c220
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7612c220
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7612c220
Branch: refs/heads/ignite-843-rc3
Commit: 7612c220488a61a6ad48ea89b85bc64f450f267a
Parents: a84f6b6
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:13:46 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:13:46 2016 +0700
----------------------------------------------------------------------
.../main/js/app/modules/user/Auth.service.js | 96 ++++++++++----------
1 file changed, 46 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7612c220/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
index 3e194e7..0690cfa 100644
--- a/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
+++ b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
@@ -16,62 +16,58 @@
*/
export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
- function($http, $root, $state, $common, gettingStarted, User) {
- let _auth = false;
+ ($http, $root, $state, $common, gettingStarted, User) => {
+ let _auth = false;
- try {
- _auth = localStorage.authorized === 'true';
- }
- catch (ignore) {
- // No-op.
- }
-
- function _authorized(value) {
try {
- return _auth = localStorage.authorized = !!value;
- } catch (ignore) {
- return _auth = !!value;
+ _auth = localStorage.authorized === 'true';
+ }
+ catch (ignore) {
+ // No-op.
}
- }
- return {
- get authorized() {
- return _auth;
- },
- set authorized(auth) {
- _authorized(auth);
- },
- auth(action, userInfo) {
- $http.post('/api/v1/' + action, userInfo)
- .then(User.read)
- .then((user) => {
- if (action !== 'password/forgot') {
- _authorized(true);
+ function _authorized(value) {
+ try {
+ return _auth = localStorage.authorized = !!value;
+ } catch (ignore) {
+ return _auth = !!value;
+ }
+ }
- $root.$broadcast('user', user);
+ return {
+ get authorized() {
+ return _auth;
+ },
+ set authorized(auth) {
+ _authorized(auth);
+ },
+ auth(action, userInfo) {
+ $http.post('/api/v1/' + action, userInfo)
+ .then(User.read)
+ .then((user) => {
+ if (action !== 'password/forgot') {
+ _authorized(true);
- $state.go('base.configuration.clusters');
+ $root.$broadcast('user', user);
- $root.gettingStarted.tryShow();
- } else
- $state.go('password.send');
- })
- .catch(function(errMsg) {
- $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
- });
- },
- logout() {
- $http.post('/api/v1/logout')
- .then(function() {
- User.clean();
+ $state.go('base.configuration.clusters');
- _authorized(false);
+ $root.gettingStarted.tryShow();
+ } else
+ $state.go('password.send');
+ })
+ .catch((errMsg) => $common.showPopoverMessage(null, null, 'user_email', errMsg.data));
+ },
+ logout() {
+ $http.post('/api/v1/logout')
+ .then(() => {
+ User.clean();
- $state.go('login');
- })
- .catch(function(errMsg) {
- $common.showError(errMsg);
- });
- }
- };
-}]];
+ _authorized(false);
+
+ $state.go('login');
+ })
+ .catch((errMsg) => $common.showError(errMsg));
+ }
+ };
+ }]];
[06/51] [abbrv] 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/63f67788
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/63f67788
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/63f67788
Branch: refs/heads/ignite-843-rc3
Commit: 63f6778879f0b1f4b4f400e993e8818806fbc6a2
Parents: 57b82a1 721a116
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 10:51:54 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 10:51:54 2016 +0700
----------------------------------------------------------------------
.../src/main/js/agents/agent-manager.js | 351 ------------
.../src/main/js/agents/agent-server.js | 64 ---
modules/control-center-web/src/main/js/app.js | 164 ------
.../src/main/js/config/default.json | 26 -
modules/control-center-web/src/main/js/db.js | 534 ------------------
.../src/main/js/helpers/configuration-loader.js | 75 ---
.../src/main/js/keys/test.crt | 13 -
.../src/main/js/keys/test.key | 18 -
.../src/main/js/routes/admin.js | 119 ----
.../src/main/js/routes/agent.js | 298 ----------
.../src/main/js/routes/caches.js | 182 ------
.../src/main/js/routes/clusters.js | 167 ------
.../src/main/js/routes/domains.js | 277 ----------
.../src/main/js/routes/igfs.js | 143 -----
.../src/main/js/routes/notebooks.js | 151 -----
.../src/main/js/routes/profile.js | 85 ---
.../src/main/js/routes/public.js | 231 --------
modules/control-center-web/src/main/js/serve.js | 164 +++---
.../src/main/js/serve/agent.js | 380 +++++++++++++
.../control-center-web/src/main/js/serve/app.js | 33 ++
.../src/main/js/serve/config/default.json | 26 +
.../src/main/js/serve/configure.js | 67 +++
.../src/main/js/serve/keys/test.crt | 13 +
.../src/main/js/serve/keys/test.key | 18 +
.../src/main/js/serve/mongo.js | 551 +++++++++++++++++++
.../src/main/js/serve/routes/admin.js | 126 +++++
.../src/main/js/serve/routes/agent.js | 331 +++++++++++
.../src/main/js/serve/routes/caches.js | 196 +++++++
.../src/main/js/serve/routes/clusters.js | 181 ++++++
.../src/main/js/serve/routes/domains.js | 285 ++++++++++
.../src/main/js/serve/routes/igfs.js | 154 ++++++
.../src/main/js/serve/routes/notebooks.js | 159 ++++++
.../src/main/js/serve/routes/profile.js | 93 ++++
.../src/main/js/serve/routes/public.js | 250 +++++++++
.../src/main/js/serve/routes/routes.js | 106 ++++
.../src/main/js/serve/settings.js | 78 +++
36 files changed, 3122 insertions(+), 2987 deletions(-)
----------------------------------------------------------------------
[22/51] [abbrv] ignite git commit: IGNITE-843 changed case of dir
Posted by ak...@apache.org.
IGNITE-843 changed case of dir
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a84f6b6a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a84f6b6a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a84f6b6a
Branch: refs/heads/ignite-843-rc3
Commit: a84f6b6a61539f8a588b5291b9d386b72f3e8f46
Parents: e874214
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:10:46 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:10:46 2016 +0700
----------------------------------------------------------------------
.../js/app/modules/Form/field/down.directive.js | 45 ----------
.../modules/Form/field/dropdown.directive.js | 64 --------------
.../js/app/modules/Form/field/dropdown.jade | 51 -----------
.../main/js/app/modules/Form/field/field.css | 6 --
.../app/modules/Form/field/field.directive.js | 43 ---------
.../main/js/app/modules/Form/field/field.jade | 26 ------
.../field/form-control-feedback.directive.js | 36 --------
.../Form/field/input/autofocus.directive.js | 30 -------
.../Form/field/input/checkbox.directive.js | 60 -------------
.../app/modules/Form/field/input/checkbox.jade | 28 ------
.../Form/field/input/datalist.directive.js | 57 ------------
.../app/modules/Form/field/input/datalist.jade | 33 -------
.../Form/field/input/number.directive.js | 61 -------------
.../js/app/modules/Form/field/input/number.jade | 44 ----------
.../js/app/modules/Form/field/input/text.css | 24 -----
.../modules/Form/field/input/text.directive.js | 84 ------------------
.../js/app/modules/Form/field/input/text.jade | 38 --------
.../app/modules/Form/field/label.directive.js | 41 ---------
.../app/modules/Form/field/tooltip.directive.js | 44 ----------
.../js/app/modules/Form/field/up.directive.js | 46 ----------
.../src/main/js/app/modules/Form/form.module.js | 92 --------------------
.../js/app/modules/Form/group/add.directive.js | 40 ---------
.../app/modules/Form/group/group.directive.js | 72 ---------------
.../main/js/app/modules/Form/group/group.jade | 21 -----
.../app/modules/Form/group/table.directive.js | 29 ------
.../main/js/app/modules/Form/group/table.jade | 17 ----
.../app/modules/Form/group/tooltip.directive.js | 40 ---------
.../app/modules/Form/panel/chevron.directive.js | 53 -----------
.../app/modules/Form/panel/panel.directive.js | 37 --------
.../app/modules/Form/panel/revert.directive.js | 52 -----------
.../validator/java-built-in-class.directive.js | 31 -------
.../Form/validator/java-identifier.directive.js | 31 -------
.../Form/validator/java-keywords.directive.js | 40 ---------
.../validator/java-package-name.directive.js | 31 -------
.../java-package-specified.directive.js | 33 -------
.../modules/Form/validator/unique.directive.js | 47 ----------
.../js/app/modules/form/field/down.directive.js | 45 ++++++++++
.../modules/form/field/dropdown.directive.js | 64 ++++++++++++++
.../js/app/modules/form/field/dropdown.jade | 51 +++++++++++
.../main/js/app/modules/form/field/field.css | 6 ++
.../app/modules/form/field/field.directive.js | 43 +++++++++
.../main/js/app/modules/form/field/field.jade | 26 ++++++
.../field/form-control-feedback.directive.js | 36 ++++++++
.../form/field/input/autofocus.directive.js | 30 +++++++
.../form/field/input/checkbox.directive.js | 60 +++++++++++++
.../app/modules/form/field/input/checkbox.jade | 28 ++++++
.../form/field/input/datalist.directive.js | 57 ++++++++++++
.../app/modules/form/field/input/datalist.jade | 33 +++++++
.../form/field/input/number.directive.js | 61 +++++++++++++
.../js/app/modules/form/field/input/number.jade | 44 ++++++++++
.../js/app/modules/form/field/input/text.css | 24 +++++
.../modules/form/field/input/text.directive.js | 84 ++++++++++++++++++
.../js/app/modules/form/field/input/text.jade | 38 ++++++++
.../app/modules/form/field/label.directive.js | 41 +++++++++
.../app/modules/form/field/tooltip.directive.js | 44 ++++++++++
.../js/app/modules/form/field/up.directive.js | 46 ++++++++++
.../src/main/js/app/modules/form/form.module.js | 92 ++++++++++++++++++++
.../js/app/modules/form/group/add.directive.js | 40 +++++++++
.../app/modules/form/group/group.directive.js | 72 +++++++++++++++
.../main/js/app/modules/form/group/group.jade | 21 +++++
.../app/modules/form/group/table.directive.js | 29 ++++++
.../main/js/app/modules/form/group/table.jade | 17 ++++
.../app/modules/form/group/tooltip.directive.js | 40 +++++++++
.../app/modules/form/panel/chevron.directive.js | 53 +++++++++++
.../app/modules/form/panel/panel.directive.js | 37 ++++++++
.../app/modules/form/panel/revert.directive.js | 52 +++++++++++
.../validator/java-built-in-class.directive.js | 31 +++++++
.../form/validator/java-identifier.directive.js | 31 +++++++
.../form/validator/java-keywords.directive.js | 40 +++++++++
.../validator/java-package-name.directive.js | 31 +++++++
.../java-package-specified.directive.js | 33 +++++++
.../modules/form/validator/unique.directive.js | 47 ++++++++++
72 files changed, 1527 insertions(+), 1527 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/down.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/down.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/down.directive.js
deleted file mode 100644
index 0f21af2..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/down.directive.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-const template = `<i class='tipField fa fa-arrow-down ng-scope' ng-click='down()'></i>`;
-
-export default ['igniteFormFieldDown', ['$tooltip', ($tooltip) => {
- const link = (scope, $element) => {
- $tooltip($element, { title: 'Move item down' });
-
- scope.down = () => {
- const i = scope.models.indexOf(scope.model);
- scope.models.splice(i, 1);
- scope.models.splice(i + 1, 0, scope.model);
- };
- };
-
- return {
- restrict: 'E',
- scope: {
- model: '=ngModel',
- models: '=models'
- },
- template,
- link,
- replace: true,
- transclude: true,
- require: '^form'
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.directive.js
deleted file mode 100644
index 919da94..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.directive.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './dropdown.jade!';
-
-export default ['igniteFormFieldDropdown', ['IgniteFormGUID', (guid) => {
- const controller = () => {};
-
- const link = (scope, $element, attrs, [form]) => {
- const {id, name} = scope;
-
- scope.id = id || guid();
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!form.$pristine) return;
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- scope.$watch(() => form.$pristine, setAsDefault);
- scope.$watch('value', setAsDefault);
- };
-
- return {
- restrict: 'E',
- scope: {
- id: '@',
- name: '@',
- value: '=ngModel'
- },
- bindToController: {
- value: '=ngModel',
- placeholder: '@',
- options: '=',
- ngDisabled: '=',
- multiple: '='
- },
- link,
- template,
- controller,
- controllerAs: 'dropdown',
- replace: true,
- transclude: true,
- require: ['^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.jade
deleted file mode 100644
index 6d4dd82..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/dropdown.jade
+++ /dev/null
@@ -1,51 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-.input-tip
- button.select-toggle.form-control(
- ng-if='dropdown.multiple'
- id='{{ id }}'
- name='{{ name }}'
- data-placeholder='{{ dropdown.placeholder }}'
-
- bs-select
- bs-options='item.value as item.label for item in dropdown.options'
- data-multiple='1'
-
- ng-model='dropdown.value'
- ng-class='{ placeholder: value === undefined || value === null || !value.length }'
- ng-disabled='dropdown.ngDisabled'
-
- tabindex='0'
- )
-
- button.select-toggle.form-control(
- ng-if='!dropdown.multiple'
- id='{{ id }}'
- name='{{ name }}'
- data-placeholder='{{ dropdown.placeholder }}'
-
- bs-select
- bs-options='item.value as item.label for item in dropdown.options'
-
- ng-model='dropdown.value'
- ng-class='{ placeholder: value === undefined || value === null || !value.length }'
- ng-disabled='dropdown.ngDisabled'
-
- tabindex='0'
- )
-
- span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/field.css
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/field.css b/modules/control-center-web/src/main/js/app/modules/Form/field/field.css
deleted file mode 100644
index 66ceb90..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/field.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.indexField {
- float: left;
- line-height: 28px;
- margin-right: 5px;
- color: #ec1c24;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/field.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/field.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/field.directive.js
deleted file mode 100644
index e02bebe..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/field.directive.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './field.jade!';
-import './field.css!';
-
-export default ['igniteFormField', [() => {
- const controller = [function() {
- const ctrl = this;
-
- ctrl.type = ctrl.type || 'external';
- }];
-
- return {
- restrict: 'E',
- scope: {},
- bindToController: {
- for: '@',
- label: '@',
- type: '@'
- },
- template,
- controller,
- controllerAs: 'field',
- replace: true,
- transclude: true,
- require: '^form'
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/field.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/field.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/field.jade
deleted file mode 100644
index 6d7c04a..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/field.jade
+++ /dev/null
@@ -1,26 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-div
- div(ng-if='field.type == "external"')
- label.col-xs-4.col-sm-4.col-md-4(
- for='{{::field.for}}'
- class='{{ field.required ? "required" : "" }}'
- )
- span(ng-if='field.label') {{::field.label}}:
- .col-xs-8.col-sm-8.col-md-8(ng-transclude='')
- div(ng-if='field.type == "internal"')
- label.col-xs-12.col-sm-12.col-md-12(ng-transclude)
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/form-control-feedback.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/form-control-feedback.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/form-control-feedback.directive.js
deleted file mode 100644
index ba3e7fe..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/form-control-feedback.directive.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['formControlFeedback', [() => {
- const link = ($scope, $element, $attrs, [form]) => {
- const name = $scope.name;
- const err = $attrs.igniteError;
- const msg = $attrs.igniteErrorMessage;
-
- if (name && err && msg) {
- form.$errorMessages = form.$errorMessages || {};
- form.$errorMessages[name] = form.$errorMessages[name] || {};
- form.$errorMessages[name][err] = msg;
- }
- };
-
- return {
- restrict: 'C',
- link,
- require: ['^form']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/autofocus.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/autofocus.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/input/autofocus.directive.js
deleted file mode 100644
index eeccc3f..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/autofocus.directive.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['igniteFormFieldInputAutofocus', [() => {
- const link = (scope, el, attrs) => {
- if (typeof attrs.igniteFormFieldInputAutofocus === 'undefined' || !attrs.igniteFormFieldInputAutofocus)
- return;
-
- el.focus();
- };
-
- return {
- restrict: 'A',
- link
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.directive.js
deleted file mode 100644
index d259718..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.directive.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './checkbox.jade!';
-
-export default ['igniteFormFieldInputCheckbox', ['IgniteFormGUID', (guid) => {
- const link = (scope, el, attrs, [form, label]) => {
- const {id, name} = scope;
- const field = form[name];
-
- scope.field = field;
- label.for = scope.id = id || guid();
-
- label.type = 'internal';
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!form.$pristine) return;
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- scope.$watch(() => form.$pristine, setAsDefault);
- scope.$watch('value', setAsDefault);
- };
-
- return {
- restrict: 'E',
- scope: {
- id: '@',
- name: '@',
- required: '=ngRequired',
- disabled: '=ngDisabled',
-
- value: '=ngModel'
- },
- link,
- template,
- replace: true,
- transclude: true,
- require: ['^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.jade
deleted file mode 100644
index c3cd283..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/checkbox.jade
+++ /dev/null
@@ -1,28 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-.input-tip
- input(
- id='{{ id }}'
- name='{{ name }}'
- type='checkbox'
-
- data-ng-model='value'
- data-ng-required='required || false'
- data-ng-disabled='disabled || false'
- )
-
- span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.directive.js
deleted file mode 100644
index 9627965..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.directive.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './datalist.jade!';
-
-export default ['igniteFormFieldInputDatalist', ['IgniteFormGUID', (guid) => {
- const link = (scope, $element, attrs, [form]) => {
- const {id, name} = scope;
-
- scope.id = id || guid();
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!form.$pristine) return;
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- scope.$watch(() => form.$pristine, setAsDefault);
- scope.$watch('value', setAsDefault);
- };
-
- return {
- restrict: 'E',
- scope: {
- id: '@',
- name: '@',
- placeholder: '@',
- disabled: '=ngDisabled',
-
- options: '=',
- value: '=ngModel'
- },
- link,
- template,
- replace: true,
- transclude: true,
- require: ['^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.jade
deleted file mode 100644
index 1002d03..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/datalist.jade
+++ /dev/null
@@ -1,33 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-.input-tip
- input.form-control(
- id='{{ id }}'
- name='{{ name }}'
- placeholder='{{ placeholder }}'
- data-min-length='1'
-
- bs-typeahead
- bs-options='item for item in options'
- retain-selection
- container='body'
-
- data-ng-model='value'
- data-ng-disabled='disabled || false'
- )
-
- span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.directive.js
deleted file mode 100644
index b88425f..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.directive.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './number.jade!';
-
-export default ['igniteFormFieldInputNumber', ['IgniteFormGUID', (guid) => {
- const link = (scope, el, attrs, [form, label]) => {
- const {id, name} = scope;
- const field = form[name];
-
- scope.field = field;
- label.for = scope.id = id || guid();
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!form.$pristine) return;
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- scope.$watch(() => form.$pristine, setAsDefault);
- scope.$watch('value', setAsDefault);
- };
-
- return {
- restrict: 'E',
- scope: {
- id: '@',
- name: '@',
- placeholder: '@',
- required: '=ngRequired',
- disabled: '=ngDisabled',
-
- min: '@',
- max: '@',
- value: '=ngModel'
- },
- link,
- template,
- replace: true,
- transclude: true,
- require: ['^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.jade
deleted file mode 100644
index b032c46..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/number.jade
+++ /dev/null
@@ -1,44 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-mixin feedback(error, message)
- i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-show='field.$error.#{error}'
- bs-tooltip='"#{message}"'
- ignite-error='#{error}'
- ignite-error-message='#{message}'
- )
-
-.input-tip
- input.form-control(
- id='{{ id }}'
- name='{{ name }}'
- placeholder='{{ placeholder }}'
- type='number'
- min='{{ min || 0 }}'
- max='{{ max || Number.MAX_VALUE }}'
-
- data-ng-model='value'
- data-ng-required='required || false'
- data-ng-disabled='disabled || false'
- data-ng-model-options='{debounce: 150}'
- )
-
- +feedback('min', 'Value is less than allowable minimum')
- +feedback('max', 'Value is more than allowable maximum')
- +feedback('number', 'Invalid value. Only numbers allowed')
-
- span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.css
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.css b/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.css
deleted file mode 100644
index 9efdb2c..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.css
+++ /dev/null
@@ -1,24 +0,0 @@
-label .input-tip {
- position: initial;
-}
-
-.input-tip .fa-floppy-o {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 2;
-
- width: 34px;
- height: 34px;
-
- text-align: center;
-
- display: inline-block;
- line-height: 28px;
- pointer-events: initial;
-}
-
-.input-tip .form-control-feedback {
- height: auto;
-}
-
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.directive.js
deleted file mode 100644
index 1cb8e92..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.directive.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './text.jade!';
-import './text.css!';
-
-export default ['igniteFormFieldInputText', ['IgniteFormGUID', (guid) => {
- const link = (scope, el, attrs, [ngModel, form, label]) => {
- const {id, name} = scope;
-
- label.for = scope.id = id || guid();
-
- scope.label = label;
- scope.ngModel = ngModel;
- scope.$watch('required', (required) => {
- label.required = required || false;
- });
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!form.$pristine) return;
-
- form.$defaults = form.$defaults || {};
- form.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- scope.$watch(() => form.$pristine, setAsDefault);
- scope.$watch('value', setAsDefault);
-
- scope.ngChange = function() {
- ngModel.$setViewValue(scope.value);
-
- if (JSON.stringify(scope.value) !== JSON.stringify(form.$defaults[name]))
- ngModel.$setDirty();
- else
- ngModel.$setPristine();
-
- if (ngModel.$valid)
- el.find('input').addClass('ng-valid').removeClass('ng-invalid');
- else
- el.find('input').removeClass('ng-valid').addClass('ng-invalid');
- };
-
- ngModel.$render = function() {
- scope.value = ngModel.$modelValue;
- };
- };
-
- return {
- restrict: 'E',
- scope: {
- id: '@',
- name: '@',
- placeholder: '@',
- required: '=ngRequired',
- disabled: '=ngDisabled',
-
- ngBlur: '&',
-
- autofocus: '=igniteFormFieldInputAutofocus'
- },
- link,
- template,
- replace: true,
- transclude: true,
- require: ['ngModel', '^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.jade b/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.jade
deleted file mode 100644
index 28298ab..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/input/text.jade
+++ /dev/null
@@ -1,38 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-.input-tip
- input.form-control(
- id='{{ id }}'
- placeholder='{{ placeholder }}'
- type='text'
-
- data-ng-model='value'
- data-ng-blur='ngBlur()'
- data-ng-change='ngChange()'
- data-ng-required='required || false'
- data-ng-disabled='disabled || false'
- data-ng-model-options='{debounce: 150}'
-
- data-ignite-form-field-input-autofocus='autofocus || false'
- )
-
- i.fa.fa-exclamation-triangle.form-control-feedback(
- ng-if='!ngModel.$pristine && ngModel.$error.required'
- bs-tooltip='"{{ label.name }} could not be empty!"'
- )
-
- span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/label.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/label.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/label.directive.js
deleted file mode 100644
index d22df2c..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/label.directive.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['igniteFormFieldLabel', [() => {
- return {
- restrict: 'E',
- compile() {
- return {
- post($scope, $element, $attrs, [form, field], $transclude) {
- $transclude($scope, function(clone) {
- const text = clone.text();
-
- if (/(.*):$/.test(text))
- field.name = /(.*):$/.exec(text)[1];
-
- const $label = $element.parent().parent().find('label');
-
- $label.append(clone);
- });
- }
- };
- },
- replace: true,
- transclude: true,
- require: ['^form', '?^igniteFormField']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/tooltip.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/tooltip.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/tooltip.directive.js
deleted file mode 100644
index 78aa8fd..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/tooltip.directive.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const template = `<i class='tipField fa fa-question-circle'></i>`;
-
-export default ['igniteFormFieldTooltip', ['$tooltip', ($tooltip) => {
- const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
- const content = Array.prototype.slice.apply($transclude($scope))
- .reduce((html, el) => html += el.outerHTML, '');
-
- $tooltip($element, { title: content });
-
- // TODO cleanup css styles.
- if ($element.hasClass('tipLabel'))
- $element.removeClass('tipField');
-
- if ($element.parent('label').length)
- $element.addClass('tipLabel').removeClass('tipField');
- };
-
- return {
- restrict: 'E',
- scope: {},
- template,
- link,
- replace: true,
- transclude: true,
- require: '^form'
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/field/up.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/field/up.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/field/up.directive.js
deleted file mode 100644
index d591eac..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/field/up.directive.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-const template = `<i class='tipField fa fa-arrow-up ng-scope' ng-click='up()'></i>`;
-
-export default ['igniteFormFieldUp', ['$tooltip', ($tooltip) => {
- const link = (scope, $element) => {
- $tooltip($element, { title: 'Move item up' });
-
- scope.up = () => {
- const idx = scope.models.indexOf(scope.model);
-
- scope.models.splice(idx, 1);
- scope.models.splice(idx - 1, 0, scope.model);
- };
- };
-
- return {
- restrict: 'E',
- scope: {
- model: '=ngModel',
- models: '=models'
- },
- template,
- link,
- replace: true,
- transclude: true,
- require: '^form'
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/form.module.js b/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
deleted file mode 100644
index aac831d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/form.module.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-// Panel.
-import igniteFormPanel from './panel/panel.directive';
-import igniteFormPanelChevron from './panel/chevron.directive';
-import igniteFormRevert from './panel/revert.directive';
-
-// Field.
-import igniteFormField from './field/field.directive';
-import igniteFormFieldLabel from './field/label.directive';
-import igniteFormFieldTooltip from './field/tooltip.directive';
-import igniteFormFieldDropdown from './field/dropdown.directive';
-import igniteFormFieldInputNumber from './field/input/number.directive';
-import igniteFormFieldInputText from './field/input/text.directive';
-import igniteFormFieldInputCheckbox from './field/input/checkbox.directive';
-import igniteFormFieldInputDatalist from './field/input/datalist.directive';
-
-// Group.
-import igniteFormGroup from './group/group.directive';
-import igniteFormGroupAdd from './group/add.directive';
-import igniteFormGroupTooltip from './group/tooltip.directive';
-
-// Validators.
-import javaKeywords from './validator/java-keywords.directive';
-import javaPackageSpecified from './validator/java-package-specified.directive';
-import javaBuiltInClass from './validator/java-built-in-class.directive';
-import javaIdentifier from './validator/java-identifier.directive';
-import javaPackageName from './validator/java-package-name.directive';
-import unique from './validator/unique.directive';
-
-// Helpers.
-import igniteFormFieldInputAutofocus from './field/input/autofocus.directive';
-import igniteFormFieldUp from './field/up.directive';
-import igniteFormFieldDown from './field/down.directive';
-import igniteFormControlFeedback from './field/form-control-feedback.directive';
-
-angular
-.module('ignite-console.Form', [
-
-])
-// Panel.
-.directive(...igniteFormPanel)
-.directive(...igniteFormPanelChevron)
-.directive(...igniteFormRevert)
-// Field.
-.directive(...igniteFormField)
-.directive(...igniteFormFieldLabel)
-.directive(...igniteFormFieldTooltip)
-.directive(...igniteFormFieldDropdown)
-.directive(...igniteFormFieldInputNumber)
-.directive(...igniteFormFieldInputText)
-.directive(...igniteFormFieldInputCheckbox)
-.directive(...igniteFormFieldInputDatalist)
-// Group.
-.directive(...igniteFormGroup)
-.directive(...igniteFormGroupAdd)
-.directive(...igniteFormGroupTooltip)
-// Validators.
-.directive(...javaKeywords)
-.directive(...javaPackageSpecified)
-.directive(...javaBuiltInClass)
-.directive(...javaIdentifier)
-.directive(...javaPackageName)
-.directive(...unique)
-// Helpers.
-.directive(...igniteFormFieldInputAutofocus)
-.directive(...igniteFormFieldUp)
-.directive(...igniteFormFieldDown)
-.directive(...igniteFormControlFeedback)
-// Generator of globally unique identifier.
-.factory('IgniteFormGUID', [() => {
- let guid = 0;
-
- return () => `form-field-${guid++}`;
-}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/add.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/add.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/group/add.directive.js
deleted file mode 100644
index 6d79026..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/add.directive.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const template = `<i class='group-legend-btn fa fa-plus'></i>`;
-
-export default ['igniteFormGroupAdd', ['$tooltip', ($tooltip) => {
- const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
- const content = Array.prototype.slice
- .apply($transclude($scope))
- .reduce((html, el) => html += el.outerHTML, '');
-
- $tooltip($element, { title: content });
-
- $element.closest('.group').find('.group-legend').append($element);
- };
-
- return {
- restrict: 'E',
- scope: {},
- template,
- link,
- replace: true,
- transclude: true,
- require: ['^form', '^igniteFormGroup']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/group.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/group.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/group/group.directive.js
deleted file mode 100644
index db03503..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/group.directive.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './group.jade!';
-
-export default ['igniteFormGroup', [() => {
- const controller = [function() { }];
-
- const link = (scope, el, attrs, [ngModelCtrl, ownFormCtrl, parentFormCtrl]) => {
- const name = attrs.ngForm;
- ngModelCtrl.$name = name;
-
- parentFormCtrl.$addControl(ngModelCtrl);
- parentFormCtrl.$removeControl(ownFormCtrl);
-
- scope.value = scope.value || [];
- parentFormCtrl.$defaults = parentFormCtrl.$defaults || {};
- parentFormCtrl.$defaults[name] = _.cloneDeep(scope.value);
-
- const setAsDefault = () => {
- if (!parentFormCtrl.$pristine)
- return;
-
- scope.value = scope.value || [];
- parentFormCtrl.$defaults = parentFormCtrl.$defaults || {};
- parentFormCtrl.$defaults[name] = _.cloneDeep(scope.value);
- };
-
- const setAsDirty = () => {
- if (JSON.stringify(scope.value) !== JSON.stringify(parentFormCtrl.$defaults[name]))
- ngModelCtrl.$setDirty();
- else
- ngModelCtrl.$setPristine();
- };
-
- scope.$watch(() => parentFormCtrl.$pristine, setAsDefault);
-
- scope.$watch('value', setAsDefault);
- scope.$watch('value', setAsDirty, true);
- };
-
- return {
- restrict: 'E',
- scope: {
- value: '=ngModel'
- },
- bindToController: {
- label: '@'
- },
- link,
- template,
- controller,
- controllerAs: 'group',
- replace: true,
- transclude: true,
- require: ['ngModel', '?form', '^^form']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/group.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/group.jade b/modules/control-center-web/src/main/js/app/modules/Form/group/group.jade
deleted file mode 100644
index ba3a8f2..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/group.jade
+++ /dev/null
@@ -1,21 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-.group-section
- .group
- .group-legend
- label {{::group.label}}
- div(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/table.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/table.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/group/table.directive.js
deleted file mode 100644
index 520f8c2..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/table.directive.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import template from './table.jade!';
-
-export default ['igniteFormGroupTable', [() => {
- return {
- restrict: 'E',
- scope: {},
- template,
- replace: true,
- transclude: true,
- require: ['^form', '^igniteFormGroup']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/table.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/table.jade b/modules/control-center-web/src/main/js/app/modules/Form/group/table.jade
deleted file mode 100644
index 6f9486d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/table.jade
+++ /dev/null
@@ -1,17 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-div
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/group/tooltip.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/group/tooltip.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/group/tooltip.directive.js
deleted file mode 100644
index 5af8fb1..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/group/tooltip.directive.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const template = `<i class='group-legend-btn fa fa-question-circle'></i>`;
-
-export default ['igniteFormGroupTooltip', ['$tooltip', ($tooltip) => {
- const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
- const content = Array.prototype.slice
- .apply($transclude($scope))
- .reduce((html, el) => html += el.outerHTML, '');
-
- $tooltip($element, { title: content });
-
- $element.closest('.group').find('.group-legend').append($element);
- };
-
- return {
- restrict: 'E',
- scope: {},
- template,
- link,
- replace: true,
- transclude: true,
- require: ['^form', '^igniteFormGroup']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/panel/chevron.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/panel/chevron.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/panel/chevron.directive.js
deleted file mode 100644
index 9f7e1d0..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/panel/chevron.directive.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const template = `<i class='fa' ng-class='isOpen ? "fa-chevron-circle-down" : "fa-chevron-circle-right"'></i>`;
-
-export default ['igniteFormPanelChevron', [() => {
- const controller = [() => {}];
-
- const link = ($scope, $element, $attrs, [bsCollapseCtrl]) => {
- const $target = $element.parent().parent().find('.panel-collapse');
-
- bsCollapseCtrl.$viewChangeListeners.push(function() {
- const index = bsCollapseCtrl.$targets.reduce((acc, el, i) => {
- if (el[0] === $target[0])
- acc.push(i);
-
- return acc;
- }, [])[0];
-
- $scope.isOpen = false;
-
- const active = bsCollapseCtrl.$activeIndexes();
-
- if ((active instanceof Array) && active.indexOf(index) !== -1 || active === index)
- $scope.isOpen = true;
- });
- };
-
- return {
- restrict: 'E',
- scope: {},
- link,
- template,
- controller,
- replace: true,
- transclude: true,
- require: ['^bsCollapse']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/panel/panel.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/panel/panel.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/panel/panel.directive.js
deleted file mode 100644
index b8e7c25..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/panel/panel.directive.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['form', [() => {
- const link = (scope, $element, $attrs, [form]) => {
- const $form = $element.parent().closest('form');
-
- scope.$watch(() => {
- return $form.hasClass('ng-pristine');
- }, (value) => {
- if (!value)
- return;
-
- form.$setPristine();
- });
- };
-
- return {
- restrict: 'E',
- link,
- require: ['^form']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/panel/revert.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/panel/revert.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/panel/revert.directive.js
deleted file mode 100644
index 874b466..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/panel/revert.directive.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const template = `<i ng-show='form.$dirty' class='fa fa-undo pull-right' ng-click='revert($event)'></i>`;
-
-export default ['igniteFormRevert', ['$tooltip', ($tooltip) => {
- const link = (scope, $element, $attrs, [form]) => {
- $tooltip($element, { title: 'Undo unsaved changes' });
-
- scope.form = form;
-
- scope.revert = (e) => {
- e.stopPropagation();
-
- for (const name in form.$defaults) {
- if ({}.hasOwnProperty.call(form.$defaults, name) && form[name]) {
- form[name].$setViewValue(form.$defaults[name]);
- form[name].$setPristine();
- form[name].$render();
- }
- }
-
- form.$setPristine();
- };
- };
-
- return {
- restrict: 'E',
- scope: {
- model: '=ngModel',
- models: '=models'
- },
- template,
- link,
- replace: true,
- require: ['^form']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-built-in-class.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-built-in-class.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/java-built-in-class.directive.js
deleted file mode 100644
index caa268d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-built-in-class.directive.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['javaBuiltInClass', ['JavaTypes', (JavaTypes) => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.javaBuiltInClass === 'undefined' || !attrs.javaBuiltInClass)
- return;
-
- ngModel.$validators.javaBuiltInClass = JavaTypes.nonBuiltInClass;
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-identifier.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-identifier.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/java-identifier.directive.js
deleted file mode 100644
index 81a48a3..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-identifier.directive.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['javaIdentifier', ['JavaTypes', (JavaTypes) => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.javaIdentifier === 'undefined' || !attrs.javaIdentifier)
- return;
-
- ngModel.$validators.javaIdentifier = JavaTypes.validIdentifier;
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-keywords.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-keywords.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/java-keywords.directive.js
deleted file mode 100644
index 8faae6d..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-keywords.directive.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['javaKeywords', ['JavaTypes', (JavaTypes) => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.javaKeywords === 'undefined' || !attrs.javaKeywords)
- return;
-
- ngModel.$validators.javaKeywords = (value) => {
- if (value) {
- for (const item of value.split('.')) {
- if (JavaTypes.isKeywords(item))
- return false;
- }
- }
-
- return true;
- };
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-name.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-name.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-name.directive.js
deleted file mode 100644
index 173e118..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-name.directive.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['javaPackageName', ['JavaTypes', (JavaTypes) => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.javaPackageName === 'undefined' || !attrs.javaPackageName)
- return;
-
- ngModel.$validators.javaPackageName = JavaTypes.validPackage;
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-specified.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-specified.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-specified.directive.js
deleted file mode 100644
index 9ba43f3..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/java-package-specified.directive.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['javaPackageSpecified', [() => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.javaPackageSpecified === 'undefined' || !attrs.javaPackageSpecified)
- return;
-
- ngModel.$validators.javaPackageSpecified = (value) => {
- return !value || !(value.split('.').length < 2);
- };
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js b/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
deleted file mode 100644
index 905a595..0000000
--- a/modules/control-center-web/src/main/js/app/modules/Form/validator/unique.directive.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['igniteUnique', ['$parse', ($parse) => {
- const link = (scope, el, attrs, [ngModel]) => {
- if (typeof attrs.igniteUnique === 'undefined' || !attrs.igniteUnique)
- return;
-
- ngModel.$validators.igniteUnique = (value) => {
- const arr = $parse(attrs.igniteUnique)(scope);
-
- // Return true in case if array not exist, array empty.
- if (!arr || !arr.length)
- return true;
-
- const name = attrs.name;
- const idx = arr.indexOf(value);
-
- // In case of new element check all items.
- if (name === 'new')
- return idx < 0;
-
- // Check for $index in case of editing in-place.
- return (_.isNumber(scope.$index) && (idx < 0 || scope.$index === idx));
- };
- };
-
- return {
- restrict: 'A',
- link,
- require: ['ngModel']
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/down.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/down.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/down.directive.js
new file mode 100644
index 0000000..0f21af2
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/down.directive.js
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+const template = `<i class='tipField fa fa-arrow-down ng-scope' ng-click='down()'></i>`;
+
+export default ['igniteFormFieldDown', ['$tooltip', ($tooltip) => {
+ const link = (scope, $element) => {
+ $tooltip($element, { title: 'Move item down' });
+
+ scope.down = () => {
+ const i = scope.models.indexOf(scope.model);
+ scope.models.splice(i, 1);
+ scope.models.splice(i + 1, 0, scope.model);
+ };
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ model: '=ngModel',
+ models: '=models'
+ },
+ template,
+ link,
+ replace: true,
+ transclude: true,
+ require: '^form'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.directive.js
new file mode 100644
index 0000000..919da94
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.directive.js
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './dropdown.jade!';
+
+export default ['igniteFormFieldDropdown', ['IgniteFormGUID', (guid) => {
+ const controller = () => {};
+
+ const link = (scope, $element, attrs, [form]) => {
+ const {id, name} = scope;
+
+ scope.id = id || guid();
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!form.$pristine) return;
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ scope.$watch(() => form.$pristine, setAsDefault);
+ scope.$watch('value', setAsDefault);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ id: '@',
+ name: '@',
+ value: '=ngModel'
+ },
+ bindToController: {
+ value: '=ngModel',
+ placeholder: '@',
+ options: '=',
+ ngDisabled: '=',
+ multiple: '='
+ },
+ link,
+ template,
+ controller,
+ controllerAs: 'dropdown',
+ replace: true,
+ transclude: true,
+ require: ['^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.jade b/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.jade
new file mode 100644
index 0000000..6d4dd82
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/dropdown.jade
@@ -0,0 +1,51 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+.input-tip
+ button.select-toggle.form-control(
+ ng-if='dropdown.multiple'
+ id='{{ id }}'
+ name='{{ name }}'
+ data-placeholder='{{ dropdown.placeholder }}'
+
+ bs-select
+ bs-options='item.value as item.label for item in dropdown.options'
+ data-multiple='1'
+
+ ng-model='dropdown.value'
+ ng-class='{ placeholder: value === undefined || value === null || !value.length }'
+ ng-disabled='dropdown.ngDisabled'
+
+ tabindex='0'
+ )
+
+ button.select-toggle.form-control(
+ ng-if='!dropdown.multiple'
+ id='{{ id }}'
+ name='{{ name }}'
+ data-placeholder='{{ dropdown.placeholder }}'
+
+ bs-select
+ bs-options='item.value as item.label for item in dropdown.options'
+
+ ng-model='dropdown.value'
+ ng-class='{ placeholder: value === undefined || value === null || !value.length }'
+ ng-disabled='dropdown.ngDisabled'
+
+ tabindex='0'
+ )
+
+ span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/field.css
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/field.css b/modules/control-center-web/src/main/js/app/modules/form/field/field.css
new file mode 100644
index 0000000..66ceb90
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/field.css
@@ -0,0 +1,6 @@
+.indexField {
+ float: left;
+ line-height: 28px;
+ margin-right: 5px;
+ color: #ec1c24;
+}
\ No newline at end of file
[50/51] [abbrv] ignite git commit: IGNITE-843 Minor ui fix
Posted by ak...@apache.org.
IGNITE-843 Minor ui fix
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0a875a73
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0a875a73
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0a875a73
Branch: refs/heads/ignite-843-rc3
Commit: 0a875a7381bb2aefdd2d6996a2fd158cab439143
Parents: b58eb48
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 15:52:53 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 15:52:53 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/directives/information/information.scss | 2 ++
modules/control-center-web/src/main/js/app/index.js | 6 ++----
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a875a73/modules/control-center-web/src/main/js/app/directives/information/information.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/information/information.scss b/modules/control-center-web/src/main/js/app/directives/information/information.scss
index cf31ff7..39f3c05 100644
--- a/modules/control-center-web/src/main/js/app/directives/information/information.scss
+++ b/modules/control-center-web/src/main/js/app/directives/information/information.scss
@@ -36,6 +36,8 @@ $ignite-block-information-icon: #4a6785;
}
> .icon {
+ cursor: default;
+
color: $ignite-block-information-icon;
position: absolute;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a875a73/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 7334367..3e91ff6 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -173,9 +173,7 @@ angular
}
}])
.run(['$rootScope', ($root) => {
- $root.$on('$stateChangeStart', () => {
- _.each(angular.element('.modal'), (m) => {
- angular.element(m).scope().$hide();
- });
+ $root.$on('$stateChangeStart', () => {
+ _.each(angular.element('.modal'), (m) => angular.element(m).scope().$hide());
});
}]);
[14/51] [abbrv] ignite git commit: IGNITE-843 updated images.
Posted by ak...@apache.org.
IGNITE-843 updated images.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9c75345
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9c75345
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9c75345
Branch: refs/heads/ignite-843-rc3
Commit: a9c75345968b76c572fde15a84091a08f0a0464b
Parents: 0fc9726
Author: vsisko <vs...@gridgain.com>
Authored: Mon Feb 8 16:17:06 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 16:17:06 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/images/cache.png | Bin 46915 -> 96014 bytes
.../src/main/js/public/images/cluster.png | Bin 99129 -> 134591 bytes
.../src/main/js/public/images/domains.png | Bin 54356 -> 84759 bytes
.../src/main/js/public/images/igfs.png | Bin 48721 -> 46359 bytes
.../src/main/js/public/images/query-chart.png | Bin 46482 -> 48704 bytes
.../src/main/js/public/images/summary.png | Bin 83472 -> 125589 bytes
6 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/cache.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/cache.png b/modules/control-center-web/src/main/js/public/images/cache.png
index 1f5f952..83d19da 100755
Binary files a/modules/control-center-web/src/main/js/public/images/cache.png and b/modules/control-center-web/src/main/js/public/images/cache.png differ
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/cluster.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/cluster.png b/modules/control-center-web/src/main/js/public/images/cluster.png
index 1507c74..f8a9f00 100755
Binary files a/modules/control-center-web/src/main/js/public/images/cluster.png and b/modules/control-center-web/src/main/js/public/images/cluster.png differ
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/domains.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/domains.png b/modules/control-center-web/src/main/js/public/images/domains.png
index 3fa427f..fdf65fc 100644
Binary files a/modules/control-center-web/src/main/js/public/images/domains.png and b/modules/control-center-web/src/main/js/public/images/domains.png differ
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/igfs.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/igfs.png b/modules/control-center-web/src/main/js/public/images/igfs.png
index 53f9d37..0d21812 100644
Binary files a/modules/control-center-web/src/main/js/public/images/igfs.png and b/modules/control-center-web/src/main/js/public/images/igfs.png differ
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/query-chart.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/query-chart.png b/modules/control-center-web/src/main/js/public/images/query-chart.png
index 89adbf2..97ee928 100755
Binary files a/modules/control-center-web/src/main/js/public/images/query-chart.png and b/modules/control-center-web/src/main/js/public/images/query-chart.png differ
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c75345/modules/control-center-web/src/main/js/public/images/summary.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/summary.png b/modules/control-center-web/src/main/js/public/images/summary.png
index 20a707b..4f57ab7 100755
Binary files a/modules/control-center-web/src/main/js/public/images/summary.png and b/modules/control-center-web/src/main/js/public/images/summary.png differ
[21/51] [abbrv] ignite git commit: IGNITE-843 changed case of dir
Posted by ak...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/field.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/field.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/field.directive.js
new file mode 100644
index 0000000..e02bebe
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/field.directive.js
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './field.jade!';
+import './field.css!';
+
+export default ['igniteFormField', [() => {
+ const controller = [function() {
+ const ctrl = this;
+
+ ctrl.type = ctrl.type || 'external';
+ }];
+
+ return {
+ restrict: 'E',
+ scope: {},
+ bindToController: {
+ for: '@',
+ label: '@',
+ type: '@'
+ },
+ template,
+ controller,
+ controllerAs: 'field',
+ replace: true,
+ transclude: true,
+ require: '^form'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/field.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/field.jade b/modules/control-center-web/src/main/js/app/modules/form/field/field.jade
new file mode 100644
index 0000000..6d7c04a
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/field.jade
@@ -0,0 +1,26 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+div
+ div(ng-if='field.type == "external"')
+ label.col-xs-4.col-sm-4.col-md-4(
+ for='{{::field.for}}'
+ class='{{ field.required ? "required" : "" }}'
+ )
+ span(ng-if='field.label') {{::field.label}}:
+ .col-xs-8.col-sm-8.col-md-8(ng-transclude='')
+ div(ng-if='field.type == "internal"')
+ label.col-xs-12.col-sm-12.col-md-12(ng-transclude)
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/form-control-feedback.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/form-control-feedback.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/form-control-feedback.directive.js
new file mode 100644
index 0000000..ba3e7fe
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/form-control-feedback.directive.js
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['formControlFeedback', [() => {
+ const link = ($scope, $element, $attrs, [form]) => {
+ const name = $scope.name;
+ const err = $attrs.igniteError;
+ const msg = $attrs.igniteErrorMessage;
+
+ if (name && err && msg) {
+ form.$errorMessages = form.$errorMessages || {};
+ form.$errorMessages[name] = form.$errorMessages[name] || {};
+ form.$errorMessages[name][err] = msg;
+ }
+ };
+
+ return {
+ restrict: 'C',
+ link,
+ require: ['^form']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/autofocus.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/autofocus.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/autofocus.directive.js
new file mode 100644
index 0000000..eeccc3f
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/autofocus.directive.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteFormFieldInputAutofocus', [() => {
+ const link = (scope, el, attrs) => {
+ if (typeof attrs.igniteFormFieldInputAutofocus === 'undefined' || !attrs.igniteFormFieldInputAutofocus)
+ return;
+
+ el.focus();
+ };
+
+ return {
+ restrict: 'A',
+ link
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.directive.js
new file mode 100644
index 0000000..d259718
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.directive.js
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './checkbox.jade!';
+
+export default ['igniteFormFieldInputCheckbox', ['IgniteFormGUID', (guid) => {
+ const link = (scope, el, attrs, [form, label]) => {
+ const {id, name} = scope;
+ const field = form[name];
+
+ scope.field = field;
+ label.for = scope.id = id || guid();
+
+ label.type = 'internal';
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!form.$pristine) return;
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ scope.$watch(() => form.$pristine, setAsDefault);
+ scope.$watch('value', setAsDefault);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ id: '@',
+ name: '@',
+ required: '=ngRequired',
+ disabled: '=ngDisabled',
+
+ value: '=ngModel'
+ },
+ link,
+ template,
+ replace: true,
+ transclude: true,
+ require: ['^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.jade
new file mode 100644
index 0000000..c3cd283
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/checkbox.jade
@@ -0,0 +1,28 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+.input-tip
+ input(
+ id='{{ id }}'
+ name='{{ name }}'
+ type='checkbox'
+
+ data-ng-model='value'
+ data-ng-required='required || false'
+ data-ng-disabled='disabled || false'
+ )
+
+ span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.directive.js
new file mode 100644
index 0000000..9627965
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.directive.js
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './datalist.jade!';
+
+export default ['igniteFormFieldInputDatalist', ['IgniteFormGUID', (guid) => {
+ const link = (scope, $element, attrs, [form]) => {
+ const {id, name} = scope;
+
+ scope.id = id || guid();
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!form.$pristine) return;
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ scope.$watch(() => form.$pristine, setAsDefault);
+ scope.$watch('value', setAsDefault);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ id: '@',
+ name: '@',
+ placeholder: '@',
+ disabled: '=ngDisabled',
+
+ options: '=',
+ value: '=ngModel'
+ },
+ link,
+ template,
+ replace: true,
+ transclude: true,
+ require: ['^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.jade
new file mode 100644
index 0000000..1002d03
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/datalist.jade
@@ -0,0 +1,33 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+.input-tip
+ input.form-control(
+ id='{{ id }}'
+ name='{{ name }}'
+ placeholder='{{ placeholder }}'
+ data-min-length='1'
+
+ bs-typeahead
+ bs-options='item for item in options'
+ retain-selection
+ container='body'
+
+ data-ng-model='value'
+ data-ng-disabled='disabled || false'
+ )
+
+ span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
new file mode 100644
index 0000000..b88425f
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './number.jade!';
+
+export default ['igniteFormFieldInputNumber', ['IgniteFormGUID', (guid) => {
+ const link = (scope, el, attrs, [form, label]) => {
+ const {id, name} = scope;
+ const field = form[name];
+
+ scope.field = field;
+ label.for = scope.id = id || guid();
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!form.$pristine) return;
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ scope.$watch(() => form.$pristine, setAsDefault);
+ scope.$watch('value', setAsDefault);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ id: '@',
+ name: '@',
+ placeholder: '@',
+ required: '=ngRequired',
+ disabled: '=ngDisabled',
+
+ min: '@',
+ max: '@',
+ value: '=ngModel'
+ },
+ link,
+ template,
+ replace: true,
+ transclude: true,
+ require: ['^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
new file mode 100644
index 0000000..b032c46
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
@@ -0,0 +1,44 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+mixin feedback(error, message)
+ i.fa.fa-exclamation-triangle.form-control-feedback(
+ ng-show='field.$error.#{error}'
+ bs-tooltip='"#{message}"'
+ ignite-error='#{error}'
+ ignite-error-message='#{message}'
+ )
+
+.input-tip
+ input.form-control(
+ id='{{ id }}'
+ name='{{ name }}'
+ placeholder='{{ placeholder }}'
+ type='number'
+ min='{{ min || 0 }}'
+ max='{{ max || Number.MAX_VALUE }}'
+
+ data-ng-model='value'
+ data-ng-required='required || false'
+ data-ng-disabled='disabled || false'
+ data-ng-model-options='{debounce: 150}'
+ )
+
+ +feedback('min', 'Value is less than allowable minimum')
+ +feedback('max', 'Value is more than allowable maximum')
+ +feedback('number', 'Invalid value. Only numbers allowed')
+
+ span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.css
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.css b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.css
new file mode 100644
index 0000000..9efdb2c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.css
@@ -0,0 +1,24 @@
+label .input-tip {
+ position: initial;
+}
+
+.input-tip .fa-floppy-o {
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 2;
+
+ width: 34px;
+ height: 34px;
+
+ text-align: center;
+
+ display: inline-block;
+ line-height: 28px;
+ pointer-events: initial;
+}
+
+.input-tip .form-control-feedback {
+ height: auto;
+}
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.directive.js
new file mode 100644
index 0000000..1cb8e92
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.directive.js
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './text.jade!';
+import './text.css!';
+
+export default ['igniteFormFieldInputText', ['IgniteFormGUID', (guid) => {
+ const link = (scope, el, attrs, [ngModel, form, label]) => {
+ const {id, name} = scope;
+
+ label.for = scope.id = id || guid();
+
+ scope.label = label;
+ scope.ngModel = ngModel;
+ scope.$watch('required', (required) => {
+ label.required = required || false;
+ });
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!form.$pristine) return;
+
+ form.$defaults = form.$defaults || {};
+ form.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ scope.$watch(() => form.$pristine, setAsDefault);
+ scope.$watch('value', setAsDefault);
+
+ scope.ngChange = function() {
+ ngModel.$setViewValue(scope.value);
+
+ if (JSON.stringify(scope.value) !== JSON.stringify(form.$defaults[name]))
+ ngModel.$setDirty();
+ else
+ ngModel.$setPristine();
+
+ if (ngModel.$valid)
+ el.find('input').addClass('ng-valid').removeClass('ng-invalid');
+ else
+ el.find('input').removeClass('ng-valid').addClass('ng-invalid');
+ };
+
+ ngModel.$render = function() {
+ scope.value = ngModel.$modelValue;
+ };
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ id: '@',
+ name: '@',
+ placeholder: '@',
+ required: '=ngRequired',
+ disabled: '=ngDisabled',
+
+ ngBlur: '&',
+
+ autofocus: '=igniteFormFieldInputAutofocus'
+ },
+ link,
+ template,
+ replace: true,
+ transclude: true,
+ require: ['ngModel', '^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/text.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.jade
new file mode 100644
index 0000000..28298ab
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/text.jade
@@ -0,0 +1,38 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+.input-tip
+ input.form-control(
+ id='{{ id }}'
+ placeholder='{{ placeholder }}'
+ type='text'
+
+ data-ng-model='value'
+ data-ng-blur='ngBlur()'
+ data-ng-change='ngChange()'
+ data-ng-required='required || false'
+ data-ng-disabled='disabled || false'
+ data-ng-model-options='{debounce: 150}'
+
+ data-ignite-form-field-input-autofocus='autofocus || false'
+ )
+
+ i.fa.fa-exclamation-triangle.form-control-feedback(
+ ng-if='!ngModel.$pristine && ngModel.$error.required'
+ bs-tooltip='"{{ label.name }} could not be empty!"'
+ )
+
+ span(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/label.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/label.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/label.directive.js
new file mode 100644
index 0000000..d22df2c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/label.directive.js
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteFormFieldLabel', [() => {
+ return {
+ restrict: 'E',
+ compile() {
+ return {
+ post($scope, $element, $attrs, [form, field], $transclude) {
+ $transclude($scope, function(clone) {
+ const text = clone.text();
+
+ if (/(.*):$/.test(text))
+ field.name = /(.*):$/.exec(text)[1];
+
+ const $label = $element.parent().parent().find('label');
+
+ $label.append(clone);
+ });
+ }
+ };
+ },
+ replace: true,
+ transclude: true,
+ require: ['^form', '?^igniteFormField']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/tooltip.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/tooltip.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/tooltip.directive.js
new file mode 100644
index 0000000..78aa8fd
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/tooltip.directive.js
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const template = `<i class='tipField fa fa-question-circle'></i>`;
+
+export default ['igniteFormFieldTooltip', ['$tooltip', ($tooltip) => {
+ const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
+ const content = Array.prototype.slice.apply($transclude($scope))
+ .reduce((html, el) => html += el.outerHTML, '');
+
+ $tooltip($element, { title: content });
+
+ // TODO cleanup css styles.
+ if ($element.hasClass('tipLabel'))
+ $element.removeClass('tipField');
+
+ if ($element.parent('label').length)
+ $element.addClass('tipLabel').removeClass('tipField');
+ };
+
+ return {
+ restrict: 'E',
+ scope: {},
+ template,
+ link,
+ replace: true,
+ transclude: true,
+ require: '^form'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/field/up.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/up.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/up.directive.js
new file mode 100644
index 0000000..d591eac
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/up.directive.js
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+const template = `<i class='tipField fa fa-arrow-up ng-scope' ng-click='up()'></i>`;
+
+export default ['igniteFormFieldUp', ['$tooltip', ($tooltip) => {
+ const link = (scope, $element) => {
+ $tooltip($element, { title: 'Move item up' });
+
+ scope.up = () => {
+ const idx = scope.models.indexOf(scope.model);
+
+ scope.models.splice(idx, 1);
+ scope.models.splice(idx - 1, 0, scope.model);
+ };
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ model: '=ngModel',
+ models: '=models'
+ },
+ template,
+ link,
+ replace: true,
+ transclude: true,
+ require: '^form'
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/form.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/form.module.js b/modules/control-center-web/src/main/js/app/modules/form/form.module.js
new file mode 100644
index 0000000..aac831d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/form.module.js
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+// Panel.
+import igniteFormPanel from './panel/panel.directive';
+import igniteFormPanelChevron from './panel/chevron.directive';
+import igniteFormRevert from './panel/revert.directive';
+
+// Field.
+import igniteFormField from './field/field.directive';
+import igniteFormFieldLabel from './field/label.directive';
+import igniteFormFieldTooltip from './field/tooltip.directive';
+import igniteFormFieldDropdown from './field/dropdown.directive';
+import igniteFormFieldInputNumber from './field/input/number.directive';
+import igniteFormFieldInputText from './field/input/text.directive';
+import igniteFormFieldInputCheckbox from './field/input/checkbox.directive';
+import igniteFormFieldInputDatalist from './field/input/datalist.directive';
+
+// Group.
+import igniteFormGroup from './group/group.directive';
+import igniteFormGroupAdd from './group/add.directive';
+import igniteFormGroupTooltip from './group/tooltip.directive';
+
+// Validators.
+import javaKeywords from './validator/java-keywords.directive';
+import javaPackageSpecified from './validator/java-package-specified.directive';
+import javaBuiltInClass from './validator/java-built-in-class.directive';
+import javaIdentifier from './validator/java-identifier.directive';
+import javaPackageName from './validator/java-package-name.directive';
+import unique from './validator/unique.directive';
+
+// Helpers.
+import igniteFormFieldInputAutofocus from './field/input/autofocus.directive';
+import igniteFormFieldUp from './field/up.directive';
+import igniteFormFieldDown from './field/down.directive';
+import igniteFormControlFeedback from './field/form-control-feedback.directive';
+
+angular
+.module('ignite-console.Form', [
+
+])
+// Panel.
+.directive(...igniteFormPanel)
+.directive(...igniteFormPanelChevron)
+.directive(...igniteFormRevert)
+// Field.
+.directive(...igniteFormField)
+.directive(...igniteFormFieldLabel)
+.directive(...igniteFormFieldTooltip)
+.directive(...igniteFormFieldDropdown)
+.directive(...igniteFormFieldInputNumber)
+.directive(...igniteFormFieldInputText)
+.directive(...igniteFormFieldInputCheckbox)
+.directive(...igniteFormFieldInputDatalist)
+// Group.
+.directive(...igniteFormGroup)
+.directive(...igniteFormGroupAdd)
+.directive(...igniteFormGroupTooltip)
+// Validators.
+.directive(...javaKeywords)
+.directive(...javaPackageSpecified)
+.directive(...javaBuiltInClass)
+.directive(...javaIdentifier)
+.directive(...javaPackageName)
+.directive(...unique)
+// Helpers.
+.directive(...igniteFormFieldInputAutofocus)
+.directive(...igniteFormFieldUp)
+.directive(...igniteFormFieldDown)
+.directive(...igniteFormControlFeedback)
+// Generator of globally unique identifier.
+.factory('IgniteFormGUID', [() => {
+ let guid = 0;
+
+ return () => `form-field-${guid++}`;
+}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/add.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/add.directive.js b/modules/control-center-web/src/main/js/app/modules/form/group/add.directive.js
new file mode 100644
index 0000000..6d79026
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/add.directive.js
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const template = `<i class='group-legend-btn fa fa-plus'></i>`;
+
+export default ['igniteFormGroupAdd', ['$tooltip', ($tooltip) => {
+ const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
+ const content = Array.prototype.slice
+ .apply($transclude($scope))
+ .reduce((html, el) => html += el.outerHTML, '');
+
+ $tooltip($element, { title: content });
+
+ $element.closest('.group').find('.group-legend').append($element);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {},
+ template,
+ link,
+ replace: true,
+ transclude: true,
+ require: ['^form', '^igniteFormGroup']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/group.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/group.directive.js b/modules/control-center-web/src/main/js/app/modules/form/group/group.directive.js
new file mode 100644
index 0000000..db03503
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/group.directive.js
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './group.jade!';
+
+export default ['igniteFormGroup', [() => {
+ const controller = [function() { }];
+
+ const link = (scope, el, attrs, [ngModelCtrl, ownFormCtrl, parentFormCtrl]) => {
+ const name = attrs.ngForm;
+ ngModelCtrl.$name = name;
+
+ parentFormCtrl.$addControl(ngModelCtrl);
+ parentFormCtrl.$removeControl(ownFormCtrl);
+
+ scope.value = scope.value || [];
+ parentFormCtrl.$defaults = parentFormCtrl.$defaults || {};
+ parentFormCtrl.$defaults[name] = _.cloneDeep(scope.value);
+
+ const setAsDefault = () => {
+ if (!parentFormCtrl.$pristine)
+ return;
+
+ scope.value = scope.value || [];
+ parentFormCtrl.$defaults = parentFormCtrl.$defaults || {};
+ parentFormCtrl.$defaults[name] = _.cloneDeep(scope.value);
+ };
+
+ const setAsDirty = () => {
+ if (JSON.stringify(scope.value) !== JSON.stringify(parentFormCtrl.$defaults[name]))
+ ngModelCtrl.$setDirty();
+ else
+ ngModelCtrl.$setPristine();
+ };
+
+ scope.$watch(() => parentFormCtrl.$pristine, setAsDefault);
+
+ scope.$watch('value', setAsDefault);
+ scope.$watch('value', setAsDirty, true);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ value: '=ngModel'
+ },
+ bindToController: {
+ label: '@'
+ },
+ link,
+ template,
+ controller,
+ controllerAs: 'group',
+ replace: true,
+ transclude: true,
+ require: ['ngModel', '?form', '^^form']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/group.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/group.jade b/modules/control-center-web/src/main/js/app/modules/form/group/group.jade
new file mode 100644
index 0000000..ba3a8f2
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/group.jade
@@ -0,0 +1,21 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+.group-section
+ .group
+ .group-legend
+ label {{::group.label}}
+ div(ng-transclude='')
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/table.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/table.directive.js b/modules/control-center-web/src/main/js/app/modules/form/group/table.directive.js
new file mode 100644
index 0000000..520f8c2
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/table.directive.js
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import template from './table.jade!';
+
+export default ['igniteFormGroupTable', [() => {
+ return {
+ restrict: 'E',
+ scope: {},
+ template,
+ replace: true,
+ transclude: true,
+ require: ['^form', '^igniteFormGroup']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/table.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/table.jade b/modules/control-center-web/src/main/js/app/modules/form/group/table.jade
new file mode 100644
index 0000000..6f9486d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/table.jade
@@ -0,0 +1,17 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+div
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/group/tooltip.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/group/tooltip.directive.js b/modules/control-center-web/src/main/js/app/modules/form/group/tooltip.directive.js
new file mode 100644
index 0000000..5af8fb1
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/group/tooltip.directive.js
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const template = `<i class='group-legend-btn fa fa-question-circle'></i>`;
+
+export default ['igniteFormGroupTooltip', ['$tooltip', ($tooltip) => {
+ const link = ($scope, $element, $attrs, $ctrls, $transclude) => {
+ const content = Array.prototype.slice
+ .apply($transclude($scope))
+ .reduce((html, el) => html += el.outerHTML, '');
+
+ $tooltip($element, { title: content });
+
+ $element.closest('.group').find('.group-legend').append($element);
+ };
+
+ return {
+ restrict: 'E',
+ scope: {},
+ template,
+ link,
+ replace: true,
+ transclude: true,
+ require: ['^form', '^igniteFormGroup']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/panel/chevron.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/panel/chevron.directive.js b/modules/control-center-web/src/main/js/app/modules/form/panel/chevron.directive.js
new file mode 100644
index 0000000..9f7e1d0
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/panel/chevron.directive.js
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const template = `<i class='fa' ng-class='isOpen ? "fa-chevron-circle-down" : "fa-chevron-circle-right"'></i>`;
+
+export default ['igniteFormPanelChevron', [() => {
+ const controller = [() => {}];
+
+ const link = ($scope, $element, $attrs, [bsCollapseCtrl]) => {
+ const $target = $element.parent().parent().find('.panel-collapse');
+
+ bsCollapseCtrl.$viewChangeListeners.push(function() {
+ const index = bsCollapseCtrl.$targets.reduce((acc, el, i) => {
+ if (el[0] === $target[0])
+ acc.push(i);
+
+ return acc;
+ }, [])[0];
+
+ $scope.isOpen = false;
+
+ const active = bsCollapseCtrl.$activeIndexes();
+
+ if ((active instanceof Array) && active.indexOf(index) !== -1 || active === index)
+ $scope.isOpen = true;
+ });
+ };
+
+ return {
+ restrict: 'E',
+ scope: {},
+ link,
+ template,
+ controller,
+ replace: true,
+ transclude: true,
+ require: ['^bsCollapse']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/panel/panel.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/panel/panel.directive.js b/modules/control-center-web/src/main/js/app/modules/form/panel/panel.directive.js
new file mode 100644
index 0000000..b8e7c25
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/panel/panel.directive.js
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['form', [() => {
+ const link = (scope, $element, $attrs, [form]) => {
+ const $form = $element.parent().closest('form');
+
+ scope.$watch(() => {
+ return $form.hasClass('ng-pristine');
+ }, (value) => {
+ if (!value)
+ return;
+
+ form.$setPristine();
+ });
+ };
+
+ return {
+ restrict: 'E',
+ link,
+ require: ['^form']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/panel/revert.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/panel/revert.directive.js b/modules/control-center-web/src/main/js/app/modules/form/panel/revert.directive.js
new file mode 100644
index 0000000..874b466
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/panel/revert.directive.js
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const template = `<i ng-show='form.$dirty' class='fa fa-undo pull-right' ng-click='revert($event)'></i>`;
+
+export default ['igniteFormRevert', ['$tooltip', ($tooltip) => {
+ const link = (scope, $element, $attrs, [form]) => {
+ $tooltip($element, { title: 'Undo unsaved changes' });
+
+ scope.form = form;
+
+ scope.revert = (e) => {
+ e.stopPropagation();
+
+ for (const name in form.$defaults) {
+ if ({}.hasOwnProperty.call(form.$defaults, name) && form[name]) {
+ form[name].$setViewValue(form.$defaults[name]);
+ form[name].$setPristine();
+ form[name].$render();
+ }
+ }
+
+ form.$setPristine();
+ };
+ };
+
+ return {
+ restrict: 'E',
+ scope: {
+ model: '=ngModel',
+ models: '=models'
+ },
+ template,
+ link,
+ replace: true,
+ require: ['^form']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/java-built-in-class.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/java-built-in-class.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/java-built-in-class.directive.js
new file mode 100644
index 0000000..caa268d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/java-built-in-class.directive.js
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['javaBuiltInClass', ['JavaTypes', (JavaTypes) => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.javaBuiltInClass === 'undefined' || !attrs.javaBuiltInClass)
+ return;
+
+ ngModel.$validators.javaBuiltInClass = JavaTypes.nonBuiltInClass;
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/java-identifier.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/java-identifier.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/java-identifier.directive.js
new file mode 100644
index 0000000..81a48a3
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/java-identifier.directive.js
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['javaIdentifier', ['JavaTypes', (JavaTypes) => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.javaIdentifier === 'undefined' || !attrs.javaIdentifier)
+ return;
+
+ ngModel.$validators.javaIdentifier = JavaTypes.validIdentifier;
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/java-keywords.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/java-keywords.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/java-keywords.directive.js
new file mode 100644
index 0000000..8faae6d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/java-keywords.directive.js
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['javaKeywords', ['JavaTypes', (JavaTypes) => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.javaKeywords === 'undefined' || !attrs.javaKeywords)
+ return;
+
+ ngModel.$validators.javaKeywords = (value) => {
+ if (value) {
+ for (const item of value.split('.')) {
+ if (JavaTypes.isKeywords(item))
+ return false;
+ }
+ }
+
+ return true;
+ };
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-name.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-name.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-name.directive.js
new file mode 100644
index 0000000..173e118
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-name.directive.js
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['javaPackageName', ['JavaTypes', (JavaTypes) => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.javaPackageName === 'undefined' || !attrs.javaPackageName)
+ return;
+
+ ngModel.$validators.javaPackageName = JavaTypes.validPackage;
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-specified.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-specified.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-specified.directive.js
new file mode 100644
index 0000000..9ba43f3
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/java-package-specified.directive.js
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['javaPackageSpecified', [() => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.javaPackageSpecified === 'undefined' || !attrs.javaPackageSpecified)
+ return;
+
+ ngModel.$validators.javaPackageSpecified = (value) => {
+ return !value || !(value.split('.').length < 2);
+ };
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/a84f6b6a/modules/control-center-web/src/main/js/app/modules/form/validator/unique.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/validator/unique.directive.js b/modules/control-center-web/src/main/js/app/modules/form/validator/unique.directive.js
new file mode 100644
index 0000000..905a595
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/form/validator/unique.directive.js
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteUnique', ['$parse', ($parse) => {
+ const link = (scope, el, attrs, [ngModel]) => {
+ if (typeof attrs.igniteUnique === 'undefined' || !attrs.igniteUnique)
+ return;
+
+ ngModel.$validators.igniteUnique = (value) => {
+ const arr = $parse(attrs.igniteUnique)(scope);
+
+ // Return true in case if array not exist, array empty.
+ if (!arr || !arr.length)
+ return true;
+
+ const name = attrs.name;
+ const idx = arr.indexOf(value);
+
+ // In case of new element check all items.
+ if (name === 'new')
+ return idx < 0;
+
+ // Check for $index in case of editing in-place.
+ return (_.isNumber(scope.$index) && (idx < 0 || scope.$index === idx));
+ };
+ };
+
+ return {
+ restrict: 'A',
+ link,
+ require: ['ngModel']
+ };
+}]];
[03/51] [abbrv] ignite git commit: IGNITE-843 Refactored server side.
Posted by ak...@apache.org.
IGNITE-843 Refactored server side.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/721a1165
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/721a1165
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/721a1165
Branch: refs/heads/ignite-843-rc3
Commit: 721a116542c5bae0d891b0e674ee9f6e9ee3c1a7
Parents: 9073514
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 10:44:34 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 10:44:34 2016 +0700
----------------------------------------------------------------------
.../src/main/js/agents/agent-manager.js | 351 ------------
.../src/main/js/agents/agent-server.js | 64 ---
modules/control-center-web/src/main/js/app.js | 164 ------
.../src/main/js/config/default.json | 26 -
modules/control-center-web/src/main/js/db.js | 534 ------------------
.../src/main/js/helpers/configuration-loader.js | 75 ---
.../src/main/js/keys/test.crt | 13 -
.../src/main/js/keys/test.key | 18 -
.../src/main/js/routes/admin.js | 119 ----
.../src/main/js/routes/agent.js | 298 ----------
.../src/main/js/routes/caches.js | 182 ------
.../src/main/js/routes/clusters.js | 167 ------
.../src/main/js/routes/domains.js | 277 ----------
.../src/main/js/routes/igfs.js | 143 -----
.../src/main/js/routes/notebooks.js | 151 -----
.../src/main/js/routes/profile.js | 85 ---
.../src/main/js/routes/public.js | 231 --------
modules/control-center-web/src/main/js/serve.js | 164 +++---
.../src/main/js/serve/agent.js | 380 +++++++++++++
.../control-center-web/src/main/js/serve/app.js | 33 ++
.../src/main/js/serve/config/default.json | 26 +
.../src/main/js/serve/configure.js | 67 +++
.../src/main/js/serve/keys/test.crt | 13 +
.../src/main/js/serve/keys/test.key | 18 +
.../src/main/js/serve/mongo.js | 551 +++++++++++++++++++
.../src/main/js/serve/routes/admin.js | 126 +++++
.../src/main/js/serve/routes/agent.js | 331 +++++++++++
.../src/main/js/serve/routes/caches.js | 196 +++++++
.../src/main/js/serve/routes/clusters.js | 181 ++++++
.../src/main/js/serve/routes/domains.js | 285 ++++++++++
.../src/main/js/serve/routes/igfs.js | 154 ++++++
.../src/main/js/serve/routes/notebooks.js | 159 ++++++
.../src/main/js/serve/routes/profile.js | 93 ++++
.../src/main/js/serve/routes/public.js | 250 +++++++++
.../src/main/js/serve/routes/routes.js | 106 ++++
.../src/main/js/serve/settings.js | 78 +++
36 files changed, 3122 insertions(+), 2987 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/agents/agent-manager.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/agents/agent-manager.js b/modules/control-center-web/src/main/js/agents/agent-manager.js
deleted file mode 100644
index 354a163..0000000
--- a/modules/control-center-web/src/main/js/agents/agent-manager.js
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var WebSocketServer = require('ws').Server;
-
-var apacheIgnite = require('apache-ignite');
-
-var db = require('../db');
-
-var AgentServer = require('./agent-server').AgentServer;
-
-/**
- * @constructor
- */
-function AgentManager(srv) {
- this._clients = {};
-
- this._server = srv;
-
- this._wss = new WebSocketServer({ server: this._server });
-
- var self = this;
-
- this._wss.on('connection', function(ws) {
- new Client(ws, self);
- });
-}
-
-/**
- * @param userId
- * @param {Client} client
- */
-AgentManager.prototype._removeClient = function(userId, client) {
- var connections = this._clients[userId];
-
- if (connections) {
- removeFromArray(connections, client);
-
- if (connections.length == 0)
- delete this._clients[userId];
- }
-};
-
-/**
- * @param userId
- * @param {Client} client
- */
-AgentManager.prototype._addClient = function(userId, client) {
- var existingConnections = this._clients[userId];
-
- if (!existingConnections) {
- existingConnections = [];
-
- this._clients[userId] = existingConnections;
- }
-
- existingConnections.push(client);
-};
-
-/**
- * @param userId
- * @returns {Client}
- */
-AgentManager.prototype.findClient = function(userId) {
- var clientsList = this._clients[userId];
-
- if (!clientsList || clientsList.length == 0)
- return null;
-
- return clientsList[0];
-};
-
-/**
- * @constructor
- * @param {AgentManager} manager
- * @param {WebSocket} ws
- */
-function Client(ws, manager) {
- var self = this;
-
- this._manager = manager;
- this._ws = ws;
-
- ws.on('close', function() {
- if (self._user) {
- self._manager._removeClient(self._user._id, self);
- }
- });
-
- ws.on('message', function (msgStr) {
- var msg = JSON.parse(msgStr);
-
- self['_rmt' + msg.type](msg);
- });
-
- this._reqCounter = 0;
-
- this._cbMap = {};
-}
-
-Client.prototype._runCommand = function(method, args) {
- var self = this;
-
- return new Promise(function(resolve, reject) {
- self._invokeRmtMethod(method, args, function(error, res) {
- if (error != null)
- return reject(error);
-
- resolve(res);
- });
- });
-};
-
-/**
- * @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';
-
- if (typeof(callback) != 'function')
- throw 'callback must be a function';
-
- if (body && typeof(body) != 'string')
- throw 'body must be a string';
-
- if (headers && typeof(headers) != 'object')
- throw 'headers must be an object';
-
- if (!method)
- method = 'GET';
- else
- method = method.toUpperCase();
-
- if (method != 'GET' && method != 'POST')
- throw 'Unknown HTTP method: ' + method;
-
- const cb = function(error, restResult) {
- if (error)
- return callback(error);
-
- const restError = restResult.error;
-
- if (restError)
- return callback(restError);
-
- const restCode = restResult.restCode;
-
- if (restCode !== 200) {
- if (restCode === 401)
- 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."});
- }
-
- try {
- var nodeResponse = JSON.parse(restResult.response);
-
- if (nodeResponse.successStatus === 0)
- return callback(null, nodeResponse.response);
-
- 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});
- }
-
- callback(nodeResponse.error);
- }
- catch (e) {
- callback(e);
- }
- };
-
- this._invokeRmtMethod('executeRest', [uri, params, demo, method, headers, body], cb);
-};
-
-/**
- * @param {string} error
- */
-Client.prototype.authResult = function(error) {
- return this._runCommand('authResult', [].slice.call(arguments));
-};
-
-/**
- * @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));
-};
-
-/**
- * @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));
-};
-
-/**
- * @returns {Promise} Promise on list of jars from driver folder.
- */
-Client.prototype.availableDrivers = function() {
- return this._runCommand('availableDrivers', [].slice.call(arguments));
-};
-
-/**
- * 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');
-
- return;
- }
-
- var msg = {
- method: method,
- args: args
- };
-
- if (callback) {
- var reqId = this._reqCounter++;
-
- this._cbMap[reqId] = callback;
-
- msg.reqId = reqId;
- }
-
- this._ws.send(JSON.stringify(msg))
-};
-
-Client.prototype._rmtAuthMessage = function(msg) {
- var self = this;
-
- var fs = require('fs');
-
- fs.stat('public/agent/ignite-web-agent-1.5.0.final.zip', function(err, stats) {
- var relDate = 0;
-
- if (!err)
- relDate = stats.birthtime.getTime();
-
- if ((msg.relDate || 0) < relDate)
- self.authResult('You are using an older version of the agent. Please reload agent archive');
-
- db.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);
-
- self._user = account;
-
- self._manager._addClient(account._id, self);
-
- self._cluster = new apacheIgnite.Ignite(new AgentServer(self));
-
- self._demo = new apacheIgnite.Ignite(new AgentServer(self, true));
- }
- });
- });
-};
-
-Client.prototype._rmtCallRes = function(msg) {
- var callback = this._cbMap[msg.reqId];
-
- if (!callback) return;
-
- delete this._cbMap[msg.reqId];
-
- callback(msg.error, msg.response);
-};
-
-/**
- * @returns {Ignite}
- */
-Client.prototype.ignite = function(demo) {
- return demo ? this._demo : this._cluster;
-};
-
-function removeFromArray(arr, val) {
- var idx;
-
- while ((idx = arr.indexOf(val)) !== -1) {
- arr.splice(idx, 1);
- }
-}
-
-exports.AgentManager = AgentManager;
-
-/**
- * @type {AgentManager}
- */
-var manager = null;
-
-exports.createManager = function(srv) {
- if (manager)
- throw 'Agent manager already cleared!';
-
- manager = new AgentManager(srv);
-};
-
-/**
- * @returns {AgentManager}
- */
-exports.getAgentManager = function() {
- return manager;
-};
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/agents/agent-server.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/agents/agent-server.js b/modules/control-center-web/src/main/js/agents/agent-server.js
deleted file mode 100644
index 51303ba..0000000
--- a/modules/control-center-web/src/main/js/agents/agent-server.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-
-/**
- * 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;
-}
-
-/**
- * Run http request
- *
- * @this {AgentServer}
- * @param {Command} cmd Command
- * @param {callback} callback on finish
- */
-AgentServer.prototype.runCommand = function(cmd, callback) {
- var params = {cmd: cmd.name()};
-
- _.forEach(cmd._params, function (p) {
- params[p.key] = p.value;
- });
-
- var body = undefined;
-
- var headers = undefined;
-
- var method = 'GET';
-
- if (cmd._isPost()) {
- body = cmd.postData();
-
- method = 'POST';
-
- headers = {'JSONObject': 'application/json'};
- }
-
- this._client.executeRest("ignite", params, this._demo, method, headers, body, callback);
-};
-
-exports.AgentServer = AgentServer;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/app.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app.js b/modules/control-center-web/src/main/js/app.js
deleted file mode 100644
index c6dd247..0000000
--- a/modules/control-center-web/src/main/js/app.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var fs = require('fs');
-var express = require('express');
-var path = require('path');
-var logger = require('morgan');
-var cookieParser = require('cookie-parser');
-var bodyParser = require('body-parser');
-var session = require('express-session');
-var mongoStore = require('connect-mongo')(session);
-var forceSSL = require('express-force-ssl');
-var config = require('./helpers/configuration-loader.js');
-
-var publicRoutes = require('./routes/public');
-var notebooksRoutes = require('./routes/notebooks');
-var clustersRouter = require('./routes/clusters');
-var cachesRouter = require('./routes/caches');
-var domainsRouter = require('./routes/domains');
-var igfsRouter = require('./routes/igfs');
-var adminRouter = require('./routes/admin');
-var profileRouter = require('./routes/profile');
-var agentRouter = require('./routes/agent');
-
-var passport = require('passport');
-
-var db = require('./db');
-
-var app = express();
-
-app.use(cookieParser('keyboard cat'));
-
-app.use(bodyParser.json({limit: '50mb'}));
-app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
-
-app.use(logger('dev', {
- skip: function (req, res) {
- return res.statusCode < 400;
- }
-}));
-
-var month = 3600000 * 24 * 30;
-
-app.use(session({
- secret: 'keyboard cat',
- resave: false,
- saveUninitialized: true,
- cookie: {
- expires: new Date(Date.now() + month),
- maxAge: month
- },
- store: new mongoStore({
- mongooseConnection: db.mongoose.connection
- })
-}));
-
-app.use(passport.initialize());
-app.use(passport.session());
-
-passport.serializeUser(db.Account.serializeUser());
-passport.deserializeUser(db.Account.deserializeUser());
-
-passport.use(db.Account.createStrategy());
-
-if (config.get('server:ssl')) {
- var httpsPort = config.normalizePort(config.get('server:https-port') || 443);
-
- app.set('forceSSLOptions', {
- enable301Redirects: true,
- trustXFPHeader: true,
- httpsPort: httpsPort
- });
-
- app.use(forceSSL);
-}
-
-var mustAuthenticated = function (req, res, next) {
- req.isAuthenticated() ? next() : res.redirect('/');
-};
-
-var adminOnly = function(req, res, next) {
- req.isAuthenticated() && req.user.admin ? next() : res.sendStatus(403);
-};
-
-app.all('/configuration/*', mustAuthenticated);
-
-app.all('*', function(req, res, next) {
- req.currentUserId = function() {
- if (!req.user)
- return null;
-
- if (req.session.viewedUser && req.user.admin)
- return req.session.viewedUser._id;
-
- return req.user._id;
- };
-
- next();
-});
-
-app.use('/', publicRoutes);
-app.use('/admin', mustAuthenticated, adminOnly, adminRouter);
-app.use('/profile', mustAuthenticated, profileRouter);
-
-app.use('/configuration/clusters', clustersRouter);
-app.use('/configuration/caches', cachesRouter);
-app.use('/configuration/domains', domainsRouter);
-app.use('/configuration/igfs', igfsRouter);
-
-app.use('/agent', mustAuthenticated, agentRouter);
-app.use('/notebooks', mustAuthenticated, notebooksRoutes);
-
-config.findIgniteModules()
- .filter(function(path) { return path.match(/\/routes\/.+\.js$/); })
- .forEach(function(route) { require(route)(app); });
-
-// Catch 404 and forward to error handler.
-app.use(function (req, res, next) {
- var err = new Error('Not Found: ' + req.originalUrl);
-
- err.status = 404;
-
- next(err);
-});
-
-// Error handlers.
-
-// Development error handler: will print stacktrace.
-if (app.get('env') === 'development') {
- app.use(function (err, req, res) {
- res.status(err.status || 500);
-
- res.render('error', {
- message: err.message,
- error: err
- });
- });
-}
-
-// Production error handler: no stacktraces leaked to user.
-app.use(function (err, req, res) {
- res.status(err.status || 500);
-
- res.render('error', {
- message: err.message,
- error: {}
- });
-});
-
-module.exports = app;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/config/default.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/config/default.json b/modules/control-center-web/src/main/js/config/default.json
deleted file mode 100644
index 4be4ef5..0000000
--- a/modules/control-center-web/src/main/js/config/default.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "server": {
- "port": 3000,
- "https-port": 8443,
- "ssl": false,
- "key": "keys/test.key",
- "cert": "keys/test.crt",
- "keyPassphrase": "password"
- },
- "mongoDB": {
- "url": "mongodb://localhost/web-control-center"
- },
- "agent-server": {
- "port": 3001,
- "ssl": true,
- "key": "keys/test.key",
- "cert": "keys/test.crt",
- "keyPassphrase": "password"
- },
- "smtp": {
- "service": "",
- "username": "",
- "email": "",
- "password": ""
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
deleted file mode 100644
index ea859e1..0000000
--- a/modules/control-center-web/src/main/js/db.js
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var config = require('./helpers/configuration-loader.js');
-var path = require('path');
-
-// Mongoose for mongodb.
-var mongoose = require('mongoose'),
- Schema = mongoose.Schema,
- ObjectId = mongoose.Schema.Types.ObjectId,
- passportLocalMongoose = require('passport-local-mongoose');
-
-var deepPopulate = require('mongoose-deep-populate')( mongoose);
-
-// Connect to mongoDB database.
-mongoose.connect(config.get('mongoDB:url'), {server: {poolSize: 4}});
-
-// Define Account schema.
-var AccountSchema = new Schema({
- username: String,
- email: String,
- company: String,
- country: String,
- lastLogin: Date,
- admin: Boolean,
- token: String,
- resetPasswordToken: String
-});
-
-// Install passport plugin.
-AccountSchema.plugin(passportLocalMongoose, {usernameField: 'email', limitAttempts: true, lastLoginField: 'lastLogin',
- usernameLowerCase: true});
-
-// Configure transformation to JSON.
-AccountSchema.set('toJSON', {
- transform: function(doc, ret) {
- return {
- _id: ret._id,
- email: ret.email,
- username: ret.username,
- company: ret.company,
- country: ret.country,
- admin: ret.admin,
- token: ret.token,
- lastLogin: ret.lastLogin
- };
- }
-});
-
-// Define Account model.
-exports.Account = mongoose.model('Account', AccountSchema);
-
-// Define Space model.
-exports.Space = mongoose.model('Space', new Schema({
- name: String,
- owner: {type: ObjectId, ref: 'Account'},
- usedBy: [{
- permission: {type: String, enum: ['VIEW', 'FULL']},
- account: {type: ObjectId, ref: 'Account'}
- }]
-}));
-
-// Define Domain model schema.
-var DomainModelSchema = new Schema({
- space: {type: ObjectId, ref: 'Space'},
- caches: [{type: ObjectId, ref: 'Cache'}],
- queryMetadata: {type: String, enum: ['Annotations', 'Configuration']},
- kind: {type: String, enum: ['query', 'store', 'both']},
- databaseSchema: String,
- databaseTable: String,
- keyType: String,
- valueType: String,
- keyFields: [{databaseFieldName: String, databaseFieldType: String, javaFieldName: String, javaFieldType: String}],
- valueFields: [{databaseFieldName: String, databaseFieldType: String, javaFieldName: String, javaFieldType: String}],
- fields: [{name: String, className: String}],
- aliases: [{field: String, alias: String}],
- indexes: [{name: String, indexType: {type: String, enum: ['SORTED', 'FULLTEXT', 'GEOSPATIAL']}, fields: [{name: String, direction: Boolean}]}],
- demo: Boolean
-});
-
-// Define model of Domain models.
-exports.DomainModel = mongoose.model('DomainModel', DomainModelSchema);
-
-// Define Cache schema.
-var CacheSchema = new Schema({
- space: {type: ObjectId, ref: 'Space'},
- name: String,
- clusters: [{type: ObjectId, ref: 'Cluster'}],
- domains: [{type: ObjectId, ref: 'DomainModel'}],
- cacheMode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']},
- atomicityMode: {type: String, enum: ['ATOMIC', 'TRANSACTIONAL']},
-
- backups: Number,
- memoryMode: {type: String, enum: ['ONHEAP_TIERED', 'OFFHEAP_TIERED', 'OFFHEAP_VALUES']},
- offHeapMaxMemory: Number,
- startSize: Number,
- swapEnabled: Boolean,
-
- evictionPolicy: {
- kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
- LRU: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- },
- FIFO: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- },
- SORTED: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- }
- },
-
- rebalanceMode: {type: String, enum: ['SYNC', 'ASYNC', 'NONE']},
- rebalanceBatchSize: Number,
- rebalanceBatchesPrefetchCount: Number,
- rebalanceOrder: Number,
- rebalanceDelay: Number,
- rebalanceTimeout: Number,
- rebalanceThrottle: Number,
-
- cacheStoreFactory: {
- kind: {
- type: String,
- enum: ['CacheJdbcPojoStoreFactory', 'CacheJdbcBlobStoreFactory', 'CacheHibernateBlobStoreFactory']
- },
- CacheJdbcPojoStoreFactory: {
- dataSourceBean: String,
- dialect: {
- type: String,
- enum: ['Generic', 'Oracle', 'DB2', 'SQLServer', 'MySQL', 'PostgreSQL', 'H2']
- }
- },
- CacheJdbcBlobStoreFactory: {
- connectVia: {type: String, enum: ['URL', 'DataSource']},
- connectionUrl: String,
- user: String,
- dataSourceBean: String,
- dialect: {
- type: String,
- enum: ['Generic', 'Oracle', 'DB2', 'SQLServer', 'MySQL', 'PostgreSQL', 'H2']
- },
- initSchema: Boolean,
- createTableQuery: String,
- loadQuery: String,
- insertQuery: String,
- updateQuery: String,
- deleteQuery: String
- },
- CacheHibernateBlobStoreFactory: {
- hibernateProperties: [String]
- }
- },
- storeKeepBinary: Boolean,
- loadPreviousValue: Boolean,
- readThrough: Boolean,
- writeThrough: Boolean,
-
- writeBehindEnabled: Boolean,
- writeBehindBatchSize: Number,
- writeBehindFlushSize: Number,
- writeBehindFlushFrequency: Number,
- writeBehindFlushThreadCount: Number,
-
- invalidate: Boolean,
- defaultLockTimeout: Number,
- atomicWriteOrderMode: {type: String, enum: ['CLOCK', 'PRIMARY']},
- writeSynchronizationMode: {type: String, enum: ['FULL_SYNC', 'FULL_ASYNC', 'PRIMARY_SYNC']},
-
- sqlEscapeAll: Boolean,
- sqlSchema: String,
- sqlOnheapRowCacheSize: Number,
- longQueryWarningTimeout: Number,
- sqlFunctionClasses: [String],
- snapshotableIndex: Boolean,
- statisticsEnabled: Boolean,
- managementEnabled: Boolean,
- readFromBackup: Boolean,
- copyOnRead: Boolean,
- maxConcurrentAsyncOperations: Number,
- nearCacheEnabled: Boolean,
- nearConfiguration: {
- nearStartSize: Number,
- nearEvictionPolicy: {
- kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
- LRU: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- },
- FIFO: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- },
- SORTED: {
- batchSize: Number,
- maxMemorySize: Number,
- maxSize: Number
- }
- }
- },
- demo: Boolean
-});
-
-// Install deep populate plugin.
-CacheSchema.plugin(deepPopulate, {
- whitelist: ['domains']
-});
-
-// Define Cache model.
-exports.Cache = mongoose.model('Cache', CacheSchema);
-
-var IgfsSchema = new Schema({
- space: {type: ObjectId, ref: 'Space'},
- name: String,
- clusters: [{type: ObjectId, ref: 'Cluster'}],
- affinnityGroupSize: Number,
- blockSize: Number,
- streamBufferSize: Number,
- dataCacheName: String,
- metaCacheName: String,
- defaultMode: {type: String, enum: ['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']},
- dualModeMaxPendingPutsSize: Number,
- dualModePutExecutorService: String,
- dualModePutExecutorServiceShutdown: Boolean,
- fragmentizerConcurrentFiles: Number,
- fragmentizerEnabled: Boolean,
- fragmentizerThrottlingBlockLength: Number,
- fragmentizerThrottlingDelay: Number,
- ipcEndpointConfiguration: {
- type: {type: String, enum: ['SHMEM', 'TCP']},
- host: String,
- port: Number,
- memorySize: Number,
- tokenDirectoryPath: String
- },
- ipcEndpointEnabled: Boolean,
- maxSpaceSize: Number,
- maximumTaskRangeLength: Number,
- managementPort: Number,
- pathModes: [{path: String, mode: {type: String, enum: ['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']}}],
- perNodeBatchSize: Number,
- perNodeParallelBatchCount: Number,
- prefetchBlocks: Number,
- sequentialReadsBeforePrefetch: Number,
- trashPurgeTimeout: Number,
- secondaryFileSystemEnabled: Boolean,
- secondaryFileSystem: {
- uri: String,
- cfgPath: String,
- userName: String
- }
-});
-
-// Define IGFS model.
-exports.Igfs = mongoose.model('Igfs', IgfsSchema);
-
-// Define Cluster schema.
-var ClusterSchema = new Schema({
- space: {type: ObjectId, ref: 'Space'},
- name: String,
- localHost: String,
- discovery: {
- localAddress: String,
- localPort: Number,
- localPortRange: Number,
- addressResolver: String,
- socketTimeout: Number,
- ackTimeout: Number,
- maxAckTimeout: Number,
- networkTimeout: Number,
- joinTimeout: Number,
- threadPriority: Number,
- heartbeatFrequency: Number,
- maxMissedHeartbeats: Number,
- maxMissedClientHeartbeats: Number,
- topHistorySize: Number,
- listener: String,
- dataExchange: String,
- metricsProvider: String,
- reconnectCount: Number,
- statisticsPrintFrequency: Number,
- ipFinderCleanFrequency: Number,
- authenticator: String,
- forceServerMode: Boolean,
- clientReconnectDisabled: Boolean,
- kind: {type: String, enum: ['Vm', 'Multicast', 'S3', 'Cloud', 'GoogleStorage', 'Jdbc', 'SharedFs']},
- Vm: {
- addresses: [String]
- },
- Multicast: {
- multicastGroup: String,
- multicastPort: Number,
- responseWaitTime: Number,
- addressRequestAttempts: Number,
- localAddress: String,
- addresses: [String]
- },
- S3: {
- bucketName: String
- },
- Cloud: {
- credential: String,
- credentialPath: String,
- identity: String,
- provider: String,
- regions: [String],
- zones: [String]
- },
- GoogleStorage: {
- projectName: String,
- bucketName: String,
- serviceAccountP12FilePath: String,
- serviceAccountId: String,
- addrReqAttempts: String
- },
- Jdbc: {
- initSchema: Boolean
- },
- SharedFs: {
- path: String
- }
- },
- atomicConfiguration: {
- backups: Number,
- cacheMode: {type: String, enum: ['LOCAL', 'REPLICATED', 'PARTITIONED']},
- atomicSequenceReserveSize: Number
- },
- binaryConfiguration: {
- idMapper: String,
- serializer: String,
- typeConfigurations: [{typeName: String, idMapper: String, serializer: String, enum: Boolean}],
- compactFooter: Boolean
- },
- caches: [{type: ObjectId, ref: 'Cache'}],
- clockSyncSamples: Number,
- clockSyncFrequency: Number,
- deploymentMode: {type: String, enum: ['PRIVATE', 'ISOLATED', 'SHARED', 'CONTINUOUS']},
- discoveryStartupDelay: Number,
- igfsThreadPoolSize: Number,
- igfss: [{type: ObjectId, ref: 'Igfs'}],
- includeEventTypes: [String],
- managementThreadPoolSize: Number,
- marshaller: {
- kind: {type: String, enum: ['OptimizedMarshaller', 'JdkMarshaller']},
- OptimizedMarshaller: {
- poolSize: Number,
- requireSerializable: Boolean
- }
- },
- marshalLocalJobs: Boolean,
- marshallerCacheKeepAliveTime: Number,
- marshallerCacheThreadPoolSize: Number,
- metricsExpireTime: Number,
- metricsHistorySize: Number,
- metricsLogFrequency: Number,
- metricsUpdateFrequency: Number,
- networkTimeout: Number,
- networkSendRetryDelay: Number,
- networkSendRetryCount: Number,
- communication: {
- listener: String,
- localAddress: String,
- localPort: Number,
- localPortRange: Number,
- sharedMemoryPort: Number,
- directBuffer: Boolean,
- directSendBuffer: Boolean,
- idleConnectionTimeout: Number,
- connectTimeout: Number,
- maxConnectTimeout: Number,
- reconnectCount: Number,
- socketSendBuffer: Number,
- socketReceiveBuffer: Number,
- messageQueueLimit: Number,
- slowClientQueueLimit: Number,
- tcpNoDelay: Boolean,
- ackSendThreshold: Number,
- unacknowledgedMessagesBufferSize: Number,
- socketWriteTimeout: Number,
- selectorsCount: Number,
- addressResolver: String
- },
- connector: {
- enabled: Boolean,
- jettyPath: String,
- host: String,
- port: Number,
- portRange: Number,
- idleTimeout: Number,
- idleQueryCursorTimeout: Number,
- idleQueryCursorCheckFrequency: Number,
- receiveBufferSize: Number,
- sendBufferSize: Number,
- directBuffer: Boolean,
- noDelay: Boolean,
- selectorCount: Number,
- threadPoolSize: Number,
- messageInterceptor: String,
- secretKey: String,
- sslEnabled: Boolean,
- sslClientAuth: Boolean,
- sslFactory: String
- },
- peerClassLoadingEnabled: Boolean,
- peerClassLoadingLocalClassPathExclude: [String],
- peerClassLoadingMissedResourcesCacheSize: Number,
- peerClassLoadingThreadPoolSize: Number,
- publicThreadPoolSize: Number,
- swapSpaceSpi: {
- kind: {type: String, enum: ['FileSwapSpaceSpi']},
- FileSwapSpaceSpi: {
- baseDirectory: String,
- readStripesNumber: Number,
- maximumSparsity: Number,
- maxWriteQueueSize: Number,
- writeBufferSize: Number
- }
- },
- systemThreadPoolSize: Number,
- timeServerPortBase: Number,
- timeServerPortRange: Number,
- transactionConfiguration: {
- defaultTxConcurrency: {type: String, enum: ['OPTIMISTIC', 'PESSIMISTIC']},
- defaultTxIsolation: {type: String, enum: ['READ_COMMITTED', 'REPEATABLE_READ', 'SERIALIZABLE']},
- defaultTxTimeout: Number,
- pessimisticTxLogLinger: Number,
- pessimisticTxLogSize: Number,
- txSerializableEnabled: Boolean,
- txManagerFactory: String
- },
- sslEnabled: Boolean,
- sslContextFactory: {
- keyAlgorithm: String,
- keyStoreFilePath: String,
- keyStoreType: String,
- protocol: String,
- trustStoreFilePath: String,
- trustStoreType: String,
- trustManagers: [String]
- },
- rebalanceThreadPoolSize: Number
-});
-
-// Install deep populate plugin.
-ClusterSchema.plugin(deepPopulate, {
- whitelist: [
- 'caches',
- 'caches.domains',
- 'igfss'
- ]
-});
-
-// Define Cluster model.
-exports.Cluster = mongoose.model('Cluster', ClusterSchema);
-
-exports.ClusterDefaultPopulate = '';
-
-// Define Notebook schema.
-var NotebookSchema = new Schema({
- space: {type: ObjectId, ref: 'Space'},
- name: String,
- expandedParagraphs: [Number],
- paragraphs: [{
- name: String,
- query: String,
- editor: Boolean,
- result: {type: String, enum: ['none', 'table', 'bar', 'pie', 'line', 'area']},
- pageSize: Number,
- timeLineSpan: String,
- hideSystemColumns: Boolean,
- cacheName: String,
- chartsOptions: {barChart: {stacked: Boolean}, areaChart: {style: String}},
- rate: {
- value: Number,
- unit: Number
- }
- }]
-});
-
-// Define Notebook model.
-exports.Notebook = mongoose.model('Notebook', NotebookSchema);
-
-exports.upsert = function (model, data, cb) {
- if (data._id) {
- var id = data._id;
-
- delete data._id;
-
- model.findOneAndUpdate({_id: id}, data, cb);
- }
- else
- new model(data).save(cb);
-};
-
-exports.processed = function(err, res) {
- if (err) {
- res.status(500).send(err);
-
- return false;
- }
-
- return true;
-};
-
-config.findIgniteModules()
- .filter(function(path) { return path.match(/.+\/db\.js$/); })
- .forEach(function(db) {
- var moduleExports = require(db)(mongoose, exports);
-
- for (var name in moduleExports)
- exports[name] = moduleExports[name];
- });
-
-exports.mongoose = mongoose;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/helpers/configuration-loader.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/configuration-loader.js b/modules/control-center-web/src/main/js/helpers/configuration-loader.js
deleted file mode 100644
index 5342cc3..0000000
--- a/modules/control-center-web/src/main/js/helpers/configuration-loader.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var config = require('nconf');
-
-config.file({'file': 'config/default.json'});
-
-/**
- * Normalize a port into a number, string, or false.
- */
-config.normalizePort = function (val) {
- var port = parseInt(val, 10);
-
- if (isNaN(port)) {
- // named pipe
- return val;
- }
-
- if (port >= 0) {
- // port number
- return port;
- }
-
- return false;
-};
-
-config.findIgniteModules = function () {
- var fs = require('fs');
- var path = require('path');
-
- var igniteModules = process.env.IGNITE_MODULES || path.resolve(__dirname, 'ignite_modules');
-
- function _find (root, filter, files, prefix) {
- prefix = prefix || '';
- files = files || [];
-
- var dir = path.join(root, prefix);
-
- if (!fs.existsSync(dir))
- return files;
-
- if (fs.statSync(dir).isDirectory())
- fs.readdirSync(dir)
- .filter(function (name) { return name[0] !== '.' })
- .forEach(function (name) {
- _find(root, filter, files, path.join(prefix, name))
- });
- else
- files.push(path.join(igniteModules, prefix).replace(/\\/g, '/')); // Replace backslashes to work under Windows
-
- return files;
- }
-
- return _find(igniteModules);
-};
-
-config.address = function (username, email) {
- return username ? '"' + username + '" <' + email + '>' : email;
-};
-
-module.exports = config;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/keys/test.crt
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/keys/test.crt b/modules/control-center-web/src/main/js/keys/test.crt
deleted file mode 100644
index 50c6d5c..0000000
--- a/modules/control-center-web/src/main/js/keys/test.crt
+++ /dev/null
@@ -1,13 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIB6zCCAVQCCQDcAphbU6UcLjANBgkqhkiG9w0BAQsFADA6MRIwEAYDVQQDDAls
-b2NhbGhvc3QxJDAiBgkqhkiG9w0BCQEWFXNldmRva2ltb3ZAYXBhY2hlLm9yZzAe
-Fw0xNTA3MTQxMzAyNTNaFw0xODA2MjMxMzAyNTNaMDoxEjAQBgNVBAMMCWxvY2Fs
-aG9zdDEkMCIGCSqGSIb3DQEJARYVc2V2ZG9raW1vdkBhcGFjaGUub3JnMIGfMA0G
-CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP/zpJrdHqCj6lPpeFF6LQtzKef6UiyBBo
-rbuOtCCgW8KMJJciluBWk2126qLt9smBN4jBpSNU3pq0r9gBMUTd/LSe7aY4D5ED
-Pjp7XsypNVKeHaHbFi7KhfHy0LYxsWiNPmmHJv4dtYOp+pGK25rkXNfyJxxjgxN6
-wo34+MnZIQIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAFk9XEjcdyihws+fVmdGGUFo
-bVxI9YGH6agiNbU3WNF4B4VRzcPPW8z2mEo7eF9kgYmq/YzH4T8tgi/qkL/u8eZV
-Wmi9bg6RThLN6/hj3wVoOFKykbDQ05FFdhIJXN5UOjPmxYM97EKqg6J0W2HAb8SG
-+UekPnmAo/2HTKsLykH8
------END CERTIFICATE-----
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/keys/test.key
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/keys/test.key b/modules/control-center-web/src/main/js/keys/test.key
deleted file mode 100644
index 1b395c0..0000000
--- a/modules/control-center-web/src/main/js/keys/test.key
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,6798185330CE2EE2
-
-sOwkmD8rvjx11l09V26dJhLhl+SyPIhyeZ3TqHXrYCATKoXlzidT+uPu1jVYtrwr
-nBLA6TrIDYRrBNlEsqGZ0cSvWTIczzVW1xZKHEJo5q2vUT/W8u/Q1QQtS3P3GeKF
-dEzx496rpZqwwVw59GNbuIwyYoVvQf3iEXzfhplGmLPELYIplDFOLgNuXQyXSGx6
-rwKsCxXMLsDyrA6DCz0Odf08p2HvWk/s5Ne3DFcQlqRNtIrBVGD2O0/Fp8ZZ2I4E
-Yn2OIIWJff3HanOjLOWKdN8YAn5UleNmlEUdIHeS5qaQ68mabOxLkSef9qglV+sd
-FHTtUq0cG6t6nhxZBziexha6v1yl/xABAHHhNPOfak+HthWxRD4N9f1yFYAeTmkn
-4kwBWoSUe12XRf2pGNqhEUKN/KhDmWk85wI55i/Cu2XmNoiBFlS9BXrRYU8uVCJw
-KlxjKTDWl1opCyvxTDxJnMkt44ZT445LRePKVueGIIKSUIXNQypOE+C1I0CL0N2W
-Ts3m9nthquvLeMx92k7b8yW69BER5uac3SIlGCOJObQXsHgyk8wYiyd/zLKfjctG
-PXieaW81UKjp+GqWpvWPz3VqnKwoyUWeVOOTviurli6kYOrHuySTMqMb6hxJctw9
-grAQTT0UPiAKWcM7InLzZnRjco+v9QLLEokjVngXPba16K/CItFY16xuGlaFLW7Y
-XTc67AkL8b76HBZelMjmCsqjvSoULhuMFwTOvUMm/mSM8rMoi9asrJRLQHRMWCST
-/6RENPLzPlOMnNLBujpBbn8V3/aYzEZsHMI+6S3d27WYlTJIqpabSA==
------END RSA PRIVATE KEY-----
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/admin.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/admin.js b/modules/control-center-web/src/main/js/routes/admin.js
deleted file mode 100644
index 8c02507..0000000
--- a/modules/control-center-web/src/main/js/routes/admin.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-var router = require('express').Router();
-var nodemailer = require('nodemailer');
-
-var db = require('../db');
-var config = require('../helpers/configuration-loader.js');
-
-/**
- * Get list of user accounts.
- */
-router.post('/list', function (req, res) {
- db.Account.find({}).sort('username').exec(function (err, users) {
- if (err)
- return res.status(500).send(err.message);
-
- res.json(users);
- });
-});
-
-// Remove user.
-router.post('/remove', function (req, res) {
- var userId = req.body.userId;
-
- db.Account.findByIdAndRemove(userId, function (err, user) {
- if (err)
- return res.status(500).send(err.message);
-
- db.Space.find({owner: userId}, function(err, spaces) {
- _.forEach(spaces, function (space) {
- db.Cluster.remove({space: space._id}).exec();
- db.Cache.remove({space: space._id}).exec();
- db.DomainModel.remove({space: space._id}).exec();
- db.Notebook.remove({space: space._id}).exec();
- db.Space.remove({owner: space._id}).exec();
- });
- });
-
- var transporter = {
- service: config.get('smtp:service'),
- auth: {
- user:config.get('smtp:email'),
- pass: config.get('smtp:password')
- }
- };
-
- if (transporter.service != '' || transporter.auth.user != '' || transporter.auth.pass != '') {
- var mailer = nodemailer.createTransport(transporter);
-
- var mailOptions = {
- from: config.address(config.get('smtp:username'), config.get('smtp:email')),
- to: config.address(user.username, user.email),
- subject: 'Your account was deleted',
- text: 'You are receiving this e-mail because admin remove your account.\n\n' +
- '--------------\n' +
- '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);
-
- res.sendStatus(200);
- });
- }
- else
- res.sendStatus(200);
- });
-});
-
-// Save user.
-router.post('/save', function (req, res) {
- var userId = req.body.userId;
- var adminFlag = req.body.adminFlag;
-
- db.Account.findByIdAndUpdate(userId, {admin: adminFlag}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.sendStatus(200);
- });
-});
-
-// Become user.
-router.get('/become', function (req, res) {
- db.Account.findById(req.query.viewedUserId).exec(function (err, viewedUser) {
- if (err)
- return res.sendStatus(404);
-
- req.session.viewedUser = viewedUser;
-
- return res.sendStatus(200);
- })
-});
-
-// Become user.
-router.get('/revert/identity', function (req, res) {
- req.session.viewedUser = null;
-
- return res.sendStatus(200);
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/agent.js b/modules/control-center-web/src/main/js/routes/agent.js
deleted file mode 100644
index 8c2326c..0000000
--- a/modules/control-center-web/src/main/js/routes/agent.js
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-var router = require('express').Router();
-var agentManager = require('../agents/agent-manager');
-
-var apacheIgnite = require('apache-ignite');
-var SqlFieldsQuery = apacheIgnite.SqlFieldsQuery;
-var ScanQuery = apacheIgnite.ScanQuery;
-
-function _client(userId) {
- return new Promise(function(resolve, reject) {
- var client = agentManager.getAgentManager().findClient(userId);
-
- if (client)
- return resolve(client);
-
- reject({code: 503, message: 'Connection to Ignite Web Agent is not established'});
- });
-}
-
-function _compact(className) {
- return className.replace('java.lang.', '').replace('java.util.', '').replace('java.sql.', '');
-}
-
-function _handleException(res) {
- 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) {
- var fs = require('fs');
- var JSZip = require('jszip');
- var config = require('../helpers/configuration-loader.js');
-
- var agentFld = 'ignite-web-agent-1.5.0.final';
- var agentZip = agentFld + '.zip';
- var 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)
- return res.download(agentPathZip, agentZip);
-
- var zip = new JSZip(data);
-
- var prop = [];
-
- var 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 + ':' + config.get('agent-server:port'));
- prop.push('#Uncomment following options if needed:');
- 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('rel-date=' + stats.birthtime.getTime());
-
- zip.file(agentFld + '/default.properties', prop.join('\n'));
-
- var buffer = zip.generate({type: 'nodebuffer', platform: 'UNIX'});
-
- // Set the archive name.
- res.attachment(agentZip);
-
- res.send(buffer);
- });
- });
-});
-
-/* Get grid topology. */
-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))
- .catch(_handleException(res));
-});
-
-/* Execute query. */
-router.post('/query', function (req, res) {
- _client(req.currentUserId())
- .then((client) => {
- // Create sql query.
- var qry = new SqlFieldsQuery(req.body.query);
-
- // Set page size for query.
- qry.setPageSize(req.body.pageSize);
-
- return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
- })
- .then((cursor) => res.json({meta: cursor.fieldsMetadata(), rows: cursor.page(), queryId: cursor.queryId()}))
- .catch(_handleException(res));
-});
-
-/* Execute query getAll. */
-router.post('/query/getAll', function (req, res) {
- _client(req.currentUserId())
- .then((client) => {
- // Create sql query.
- const qry = req.body.query ? new SqlFieldsQuery(req.body.query) : new ScanQuery();
-
- // Set page size for query.
- qry.setPageSize(1024);
-
- // 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}))
- });
- })
- .then(response => res.json(response))
- .catch(_handleException(res));
-});
-
-/* Execute query. */
-router.post('/scan', function (req, res) {
- _client(req.currentUserId())
- .then((client) => {
- // Create sql query.
- var qry = new ScanQuery();
-
- // Set page size for query.
- qry.setPageSize(req.body.pageSize);
-
- // Get query cursor.
- return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).nextPage()
- })
- .then((cursor) => res.json({meta: cursor.fieldsMetadata(), rows: cursor.page(), queryId: cursor.queryId()}))
- .catch(_handleException(res));
-});
-
-/* Get next query page. */
-router.post('/query/fetch', function (req, res) {
- _client(req.currentUserId())
- .then((client) => {
- var cache = client.ignite(req.body.demo).cache(req.body.cacheName);
-
- var 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']}))
- .catch(_handleException(res));
-});
-
-/* Close query cursor by id. */
-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))
- })
- .then(() => res.sendStatus(200))
- .catch(_handleException(res));
-});
-
-/* Get metadata for cache. */
-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 fields = meta.fields[typeName];
-
- var columns = [];
-
- for (var fieldName in fields) {
- var fieldClass = _compact(fields[fieldName]);
-
- columns.push({
- type: 'field',
- name: fieldName,
- clazz: fieldClass,
- system: fieldName == "_KEY" || fieldName == "_VAL",
- cacheName: meta.cacheName,
- typeName: typeName
- });
- }
-
- var indexes = [];
-
- for (var index of meta.indexes[typeName]) {
- fields = [];
-
- for (var 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
- });
- }
-
- if (fields.length > 0)
- indexes.push({
- type: 'index',
- name: index.name,
- children: fields,
- cacheName: meta.cacheName,
- typeName: typeName
- });
- }
-
- columns = _.sortBy(columns, 'name');
-
- if (!_.isEmpty(indexes))
- columns = columns.concat({type: 'indexes', name: 'Indexes', cacheName: meta.cacheName, typeName: typeName, children: indexes });
-
- return {type: 'type', cacheName: meta.cacheName || "", typeName: typeName, children: columns };
- });
-
- if (!_.isEmpty(cacheTypes))
- types = types.concat(cacheTypes);
- }
-
- res.json(types);
- })
- .catch(_handleException(res));
-});
-
-/* Ping client. */
-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) {
- _client(req.currentUserId())
- .then((client) => client.availableDrivers())
- .then((arr) => res.json(arr))
- .catch(_handleException(res));
-});
-
-/** Get database schemas. */
-router.post('/schemas', function (req, res) {
- _client(req.currentUserId())
- .then((client) => {
- var args = req.body;
-
- args.jdbcInfo = {user: args.user, password: args.password};
-
- return client.metadataSchemas(args.jdbcDriverJar, args.jdbcDriverClass, args.jdbcUrl, args.jdbcInfo)
- })
- .then((arr) => res.json(arr))
- .catch(_handleException(res));
-});
-
-/** Get database tables. */
-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)
- })
- .then((arr) => res.json(arr))
- .catch(_handleException(res));
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/caches.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/caches.js b/modules/control-center-web/src/main/js/routes/caches.js
deleted file mode 100644
index 0fda48e..0000000
--- a/modules/control-center-web/src/main/js/routes/caches.js
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-var router = require('express').Router();
-var db = require('../db');
-
-/**
- * Get spaces and caches accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/list', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- // Get all clusters for spaces.
- db.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function (err, clusters) {
- if (db.processed(err, res)) {
- // Get all domain models for spaces.
- db.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function (err, domains) {
- if (db.processed(err, res)) {
- // Get all caches for spaces.
- db.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err, caches) {
- if (db.processed(err, res)) {
- _.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) {
- return _.find(caches, {_id: cacheId});
- });
- });
-
- _.forEach(caches, function (cache) {
- // Remove deleted clusters.
- 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) {
- return domain._id.equals(metaId);
- }) >= 0;
- });
- });
-
- res.json({
- spaces: spaces,
- clusters: clusters.map(function (cluster) {
- return {value: cluster._id, label: cluster.name, caches: cluster.caches};
- }),
- domains: domains,
- caches: caches
- });
- }
- });
- }
- });
- }
- });
- }
- });
-});
-
-/**
- * Save cache.
- */
-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) {
- db.Cache.update({_id: cacheId}, params, {upsert: true}, function (err) {
- if (db.processed(err, res))
- db.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.Cluster.update({_id: {$nin: clusters}}, {$pull: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.DomainModel.update({_id: {$nin: domains}}, {$pull: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.send(params._id);
- });
- });
- });
- });
- })
- }
- else
- db.Cache.findOne({space: params.space, name: params.name}, function (err, cache) {
- if (db.processed(err, res)) {
- if (cache)
- return res.status(500).send('Cache with name: "' + cache.name + '" already exist.');
-
- (new db.Cache(params)).save(function (err, cache) {
- if (db.processed(err, res)) {
- cacheId = cache._id;
-
- db.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.DomainModel.update({_id: {$in: domains}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.send(cacheId);
- });
- });
- }
- });
- }
- });
-});
-
-/**
- * Remove cache by ._id.
- */
-router.post('/remove', function (req, res) {
- db.Cache.remove(req.body, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- })
-});
-
-/**
- * Remove all caches.
- */
-router.post('/remove/all', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- db.Cache.remove({space: {$in: space_ids}}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- db.Cluster.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.DomainModel.update({space: {$in: space_ids}}, {caches: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- });
- });
- })
- }
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/clusters.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/clusters.js b/modules/control-center-web/src/main/js/routes/clusters.js
deleted file mode 100644
index b29af37..0000000
--- a/modules/control-center-web/src/main/js/routes/clusters.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var _ = require('lodash');
-var router = require('express').Router();
-var db = require('../db');
-
-/**
- * Get spaces and clusters accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/list', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- // Get all caches for spaces.
- db.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec(function (err, caches) {
- if (db.processed(err, res)) {
- // Get all IGFSs for spaces.
- db.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function (err, igfss) {
- if (db.processed(err, res))
- // Get all clusters for spaces.
- db.Cluster.find({space: {$in: space_ids}}).sort('name').deepPopulate(db.ClusterDefaultPopulate).exec(function (err, clusters) {
- if (db.processed(err, res)) {
- _.forEach(caches, function (cache) {
- // Remove deleted caches.
- cache.clusters = _.filter(cache.clusters, function (clusterId) {
- return _.find(clusters, {_id: clusterId});
- });
- });
-
- _.forEach(igfss, function (igfs) {
- // Remove deleted caches.
- igfs.clusters = _.filter(igfs.clusters, function (clusterId) {
- return _.find(clusters, {_id: clusterId});
- });
- });
-
- _.forEach(clusters, function (cluster) {
- // Remove deleted caches.
- 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) {
- return igfs._id.equals(igfsId);
- }) >= 0;
- });
- });
-
- res.json({spaces: spaces, caches: caches, igfss: igfss, clusters: clusters});
- }
- });
- });
- }
- });
- }
- });
-});
-
-/**
- * Save cluster.
- */
-router.post('/save', function (req, res) {
- var params = req.body;
- var clusterId = params._id;
- var caches = params.caches;
-
- if (params._id)
- db.Cluster.update({_id: params._id}, params, {upsert: true}, function (err) {
- if (db.processed(err, res))
- db.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function(err) {
- if (db.processed(err, res)) {
- db.Cache.update({_id: {$nin: caches}}, {$pull: {clusters: clusterId}}, {multi: true}, function(err) {
- if (db.processed(err, res))
- res.send(params._id);
- });
- }
- });
- });
- else {
- db.Cluster.findOne({space: params.space, name: params.name}, function (err, cluster) {
- if (db.processed(err, res)) {
- if (cluster)
- return res.status(500).send('Cluster with name: "' + cluster.name + '" already exist.');
-
- (new db.Cluster(params)).save(function (err, cluster) {
- if (db.processed(err, res)) {
- clusterId = cluster._id;
-
- db.Cache.update({_id: {$in: caches}}, {$addToSet: {clusters: clusterId}}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.send(clusterId);
- });
- }
- });
- }
- });
- }
-});
-
-/**
- * Remove cluster by ._id.
- */
-router.post('/remove', function (req, res) {
- db.Cluster.remove(req.body, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.sendStatus(200);
- })
-});
-
-/**
- * Remove all clusters.
- */
-router.post('/remove/all', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- db.Cluster.remove({space: {$in: space_ids}}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- db.Cache.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- db.Igfs.update({space: {$in: space_ids}}, {clusters: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- });
- });
- })
- }
- });
-});
-
-module.exports = router;
http://git-wip-us.apache.org/repos/asf/ignite/blob/721a1165/modules/control-center-web/src/main/js/routes/domains.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/domains.js b/modules/control-center-web/src/main/js/routes/domains.js
deleted file mode 100644
index 302cb59..0000000
--- a/modules/control-center-web/src/main/js/routes/domains.js
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var async = require('async');
-var _ = require('lodash');
-var router = require('express').Router();
-var db = require('../db');
-
-/**
- * Get spaces and domain models accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-router.post('/list', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- // Get all clusters for spaces.
- db.Cluster.find({space: {$in: space_ids}}, '_id name').sort('name').exec(function (err, clusters) {
- if (db.processed(err, res)) {
- // Get all caches for spaces.
- db.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err, caches) {
- if (db.processed(err, res)) {
- // Get all domain models for spaces.
- db.DomainModel.find({space: {$in: space_ids}}).sort('valueType').exec(function (err, domains) {
- if (db.processed(err, res)) {
- _.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) {
- 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
- });
- }
- });
- }
- });
- }
- });
- }
- });
-});
-
-function _saveDomainModel(domain, savedDomains, callback) {
- var domainId = domain._id;
- var caches = domain.caches;
-
- var cacheStoreChanges = domain.cacheStoreChanges;
-
- if (domainId)
- db.DomainModel.update({_id: domain._id}, domain, {upsert: true}, function (err) {
- if (err)
- callback(err);
- else
- db.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function (err) {
- if (err)
- callback(err);
- else
- db.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}, function (err) {
- if (err)
- callback(err);
- else {
- savedDomains.push(domain);
-
- _updateCacheStore(cacheStoreChanges, callback);
- }
- });
- });
- });
- else
- db.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 db.DomainModel(domain)).save(function (err, domain) {
- if (err)
- callback(err);
- else {
- domainId = domain._id;
-
- db.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}, function (err) {
- if (err)
- callback(err);
- else {
- savedDomains.push(domain);
-
- _updateCacheStore(cacheStoreChanges, callback);
- }
- });
- }
- });
- });
-}
-
-function _updateCacheStore(cacheStoreChanges, callback) {
- if (cacheStoreChanges && cacheStoreChanges.length > 0) {
- async.forEachOf(cacheStoreChanges, function (change, idx, callback) {
- db.Cache.update({_id: {$eq: change.cacheId}}, change.change, {}, function (err) {
- if (err)
- callback(err);
- else
- callback();
- });
- }, callback);
- }
- else
- callback();
-}
-
-function _save(domains, res) {
- var savedDomains = [];
- var generatedCaches = [];
-
- if (domains && domains.length > 0)
- async.forEachOf(domains, function(domain, idx, callback) {
- if (domain.newCache) {
- db.Cache.findOne({space: domain.space, name: domain.newCache.name}, function (err, cache) {
- if (db.processed(err, res))
- if (cache) {
- // Cache already exists, just save domain model.
- domain.caches = [cache._id];
-
- _saveDomainModel(domain, savedDomains, callback);
- }
- else {
- // If cache not found, then create it and associate with domain model.
- var newCache = domain.newCache;
- newCache.space = domain.space;
-
- (new db.Cache(newCache)).save(function (err, cache) {
- var cacheId = cache._id;
-
- if (db.processed(err, res)) {
- db.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}}, {multi: true}, function (err) {
- if (db.processed(err, res)) {
- domain.caches = [cacheId];
- generatedCaches.push(cache);
-
- _saveDomainModel(domain, savedDomains, callback);
- }
- });
- }
- });
- }
- });
- }
- else
- _saveDomainModel(domain, savedDomains, callback);
- }, function (err) {
- if (err)
- res.status(500).send(err.message);
- else
- res.send({ savedDomains: savedDomains, generatedCaches: generatedCaches });
- });
- else
- res.status(500).send('Nothing to save!');
-}
-
-/**
- * Save domain model.
- */
-router.post('/save', function (req, res) {
- _save([req.body], res);
-});
-
-/**
- * Batch save domain models.
- */
-router.post('/save/batch', function (req, res) {
- _save(req.body, res);
-});
-
-/**
- * Remove domain model by ._id.
- */
-router.post('/remove', function (req, res) {
- db.DomainModel.remove(req.body, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- })
-});
-
-/**
- * Remove all domain models.
- */
-router.post('/remove/all', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- db.DomainModel.remove({space: {$in: space_ids}}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- db.Cache.update({space: {$in: space_ids}}, {domains: []}, {multi: true}, function (err) {
- if (db.processed(err, res))
- res.sendStatus(200);
- });
- })
- }
- });
-});
-
-/**
- * Remove all generated demo domain models and caches.
- */
-router.post('/remove/demo', function (req, res) {
- var user_id = req.currentUserId();
-
- // Get owned space and all accessed space.
- db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) {
- if (db.processed(err, res)) {
- var space_ids = spaces.map(function (value) {
- return value._id;
- });
-
- // Remove all demo domain models.
- db.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- // Remove all demo caches.
- db.Cache.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.sendStatus(200);
- });
- });
- }
- });
-});
-
-
-module.exports = router;
[51/51] [abbrv] ignite git commit: IGNITE-843 Fixed caches or
templates list population.
Posted by ak...@apache.org.
IGNITE-843 Fixed caches or templates list population.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/125f5661
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/125f5661
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/125f5661
Branch: refs/heads/ignite-843-rc3
Commit: 125f56617a8555c1e80fe02467c69ba5deb8b22f
Parents: 0a875a7
Author: vsisko <vs...@gridgain.com>
Authored: Tue Feb 9 16:24:00 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 16:24:00 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/domains-controller.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/125f5661/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 066bca9..36dc602 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
@@ -623,6 +623,10 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
$http.post('/api/v1/agent/tables', preset)
.success(function (tables) {
+ _importCachesOrTemplates = [DFLT_PARTITIONED_CACHE, DFLT_REPLICATED_CACHE].concat($scope.caches);
+
+ _fillCommonCachesOrTemplates($scope.importCommon)($scope.importCommon.action);
+
_.forEach(tables, function (tbl, idx) {
tbl.id = idx;
tbl.action = IMPORT_DM_NEW_CACHE;
@@ -1094,7 +1098,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
$scope.importCommon = {};
- function _fillCommonCachesOrTemplates(item) {
+ function _fillCommonCachesOrTemplates(item) {
return function (action) {
if (item.cachesOrTemplates)
item.cachesOrTemplates.length = 0;
@@ -1132,8 +1136,6 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
$scope.caches = _mapCaches(data.caches);
$scope.domains = data.domains;
- _importCachesOrTemplates = [DFLT_PARTITIONED_CACHE, DFLT_REPLICATED_CACHE].concat($scope.caches);
-
_.forEach($scope.clusters, function (cluster) {
$scope.ui.generatedCachesClusters.push(cluster.value);
});
[11/51] [abbrv] ignite git commit: IGNITE-843 Fixed missing property
in db descriptor.
Posted by ak...@apache.org.
IGNITE-843 Fixed missing property in db descriptor.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/61fe0f7b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/61fe0f7b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/61fe0f7b
Branch: refs/heads/ignite-843-rc3
Commit: 61fe0f7b43e78a309a17268b396f43003cb5016d
Parents: d7b22cd
Author: vsisko <vs...@gridgain.com>
Authored: Mon Feb 8 15:57:04 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 15:57:04 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/mongo.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/61fe0f7b/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 edfb5f8..88ea6f4 100644
--- a/modules/control-center-web/src/main/js/serve/mongo.js
+++ b/modules/control-center-web/src/main/js/serve/mongo.js
@@ -431,6 +431,7 @@ module.exports.factory = function (deepPopulatePlugin, passportMongo, settings,
idleQueryCursorCheckFrequency: Number,
receiveBufferSize: Number,
sendBufferSize: Number,
+ sendQueueLimit: Number,
directBuffer: Boolean,
noDelay: Boolean,
selectorCount: Number,
[19/51] [abbrv] ignite git commit: IGNITE-843 Fixed agent bug.
Posted by ak...@apache.org.
IGNITE-843 Fixed agent bug.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f44371d9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f44371d9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f44371d9
Branch: refs/heads/ignite-843-rc3
Commit: f44371d90c07534e95b279b1efb77c9eeaa23696
Parents: 42807ab
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 16:50:51 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 16:50:51 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/serve/agent.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f44371d9/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 d1ffe1a..36d6324 100644
--- a/modules/control-center-web/src/main/js/serve/agent.js
+++ b/modules/control-center-web/src/main/js/serve/agent.js
@@ -118,8 +118,8 @@ module.exports.factory = function (fs, ws, apacheIgnite, mongo) {
AgentServer.prototype.runCommand = function (cmd, callback) {
var params = {cmd: cmd.name()};
- for (var key in cmd._params)
- params[key] = cmd._params[key];
+ for (var param of cmd._params)
+ params[param.key] = param.value;
var body = undefined;
[35/51] [abbrv] ignite git commit: IGNITE-843 Minor readme fixes.
Posted by ak...@apache.org.
IGNITE-843 Minor readme fixes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6d1c9884
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6d1c9884
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6d1c9884
Branch: refs/heads/ignite-843-rc3
Commit: 6d1c9884032d0235e3933c91dad7f3722edcd86c
Parents: 51ffdfd
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Feb 9 10:40:43 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 10:40:43 2016 +0700
----------------------------------------------------------------------
modules/control-center-agent/README.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6d1c9884/modules/control-center-agent/README.txt
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/README.txt b/modules/control-center-agent/README.txt
index 1d62f68..4f5833a 100644
--- a/modules/control-center-agent/README.txt
+++ b/modules/control-center-agent/README.txt
@@ -29,8 +29,8 @@ Demo of Ignite Web Agent:
2) Demo for SQL.
How to evaluate:
In this mode internal Ignite node will be started. Cache created and populated with data.
- 2.1) Go to Ignite Web Console "SQL" menu and select "SQL demo" menu item.
- 2.2) "SQL demo" notebook contains preconfigured queries: "Simple query", "Query with aggregates", "Query with refresh rate".
+ 2.1) Go to Ignite Web Console "SQL" menu and select "Demo" menu item.
+ 2.2) "Demo" notebook contains preconfigured queries: "Simple query", "Query with aggregates", "Query with refresh rate".
2.3) You can also execute any SQL queries for tables: "Country, Department, Employee", "Parking, Car".
For example:
[30/51] [abbrv] ignite git commit: IGNITE-843 updated images.
Posted by ak...@apache.org.
IGNITE-843 updated images.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c51b0e2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c51b0e2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c51b0e2
Branch: refs/heads/ignite-843-rc3
Commit: 9c51b0e24837d5619ec1f4da3b8659da457b2a94
Parents: 75d8a2a
Author: vsisko <vs...@gridgain.com>
Authored: Tue Feb 9 09:35:03 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 09:35:03 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/images/query-table.png | Bin 114270 -> 109191 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9c51b0e2/modules/control-center-web/src/main/js/public/images/query-table.png
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/images/query-table.png b/modules/control-center-web/src/main/js/public/images/query-table.png
index 348b0d6..65fe8e0 100755
Binary files a/modules/control-center-web/src/main/js/public/images/query-table.png and b/modules/control-center-web/src/main/js/public/images/query-table.png differ
[18/51] [abbrv] 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/42807ab7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/42807ab7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/42807ab7
Branch: refs/heads/ignite-843-rc3
Commit: 42807ab7f8709f0e4eba551fe36bc678176b21ce
Parents: 31e6254 a7334db
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 16:36:18 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 16:36:18 2016 +0700
----------------------------------------------------------------------
.../control-center-web/src/main/js/.eslintrc | 2 +-
.../bs-affix-update.directive.js | 34 +++++++++++++++++++
.../control-center-web/src/main/js/app/index.js | 2 ++
.../src/main/js/controllers/common-module.js | 2 +-
.../src/main/js/public/images/cache.png | Bin 46915 -> 96014 bytes
.../src/main/js/public/images/cluster.png | Bin 99129 -> 134591 bytes
.../src/main/js/public/images/domains.png | Bin 54356 -> 84759 bytes
.../src/main/js/public/images/igfs.png | Bin 48721 -> 46359 bytes
.../src/main/js/public/images/query-chart.png | Bin 46482 -> 48704 bytes
.../src/main/js/public/images/summary.png | Bin 83472 -> 125589 bytes
.../src/main/js/public/stylesheets/style.scss | 4 +++
.../src/main/js/views/configuration/caches.jade | 1 +
.../main/js/views/configuration/clusters.jade | 1 +
.../main/js/views/configuration/domains.jade | 1 +
.../src/main/js/views/configuration/igfs.jade | 1 +
.../main/js/views/configuration/summary.jade | 1 +
.../src/main/js/views/includes/controls.jade | 2 +-
17 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[27/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bdfa18f9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bdfa18f9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bdfa18f9
Branch: refs/heads/ignite-843-rc3
Commit: bdfa18f9aa171e0d698924d20ca0e23f2bfb07e5
Parents: 8b51eed
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:58:30 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:58:30 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/bdfa18f9/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 e5abf0f..766b4bf 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
@@ -64,7 +64,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
/* Get grid topology. */
router.get('/download/zip', function (req, res) {
- var agentFld = settings.agentFile;
+ var agentFld = settings.agent.file;
var agentZip = agentFld + '.zip';
var agentPathZip = 'public/agent/' + agentFld + '.zip';
[29/51] [abbrv] ignite git commit: IGNITE-843 Minor changes to import
domain modal.
Posted by ak...@apache.org.
IGNITE-843 Minor changes to import domain modal.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/75d8a2a5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/75d8a2a5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/75d8a2a5
Branch: refs/heads/ignite-843-rc3
Commit: 75d8a2a54c83633eca4b1f11e1c059ef80a98245
Parents: ace9ef7
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Feb 8 19:54:49 2016 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Feb 8 19:54:49 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/domains-controller.js | 9 ++++-----
.../main/js/views/configuration/domains-import.jade | 14 +++++++-------
2 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/75d8a2a5/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 a3f04f8..066bca9 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
@@ -441,7 +441,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
$scope.importDomain = {
demo: demo,
action: 'drivers',
- jdbcDriversFound: false,
+ jdbcDriversNotFound: false,
schemas: [],
allSchemasSelected: false,
tables: [],
@@ -476,8 +476,6 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
}
if (drivers && drivers.length > 0) {
- $scope.importDomain.jdbcDriversFound = true;
-
drivers = _.sortBy(drivers, 'jdbcDriverJar');
if ($scope.importDomain.demo) {
@@ -519,6 +517,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
});
}
else {
+ $scope.importDomain.jdbcDriversNotFound = true;
$scope.importDomain.button = 'Cancel';
}
})
@@ -984,7 +983,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
var act = $scope.importDomain.action;
- if (act === 'drivers' && !$scope.importDomain.jdbcDriversFound)
+ if (act === 'drivers' && $scope.importDomain.jdbcDriversNotFound)
importDomainModal.hide();
else if (act === 'connect') {
if ($scope.importDomain.demo && $scope.demoConnection.db !== 'H2')
@@ -1005,7 +1004,7 @@ consoleModule.controller('domainsController', function ($filter, $http, $timeout
var act = $scope.importDomain.action;
- if (act === 'drivers' && !$scope.importDomain.jdbcDriversFound)
+ if (act === 'drivers' && $scope.importDomain.jdbcDriversNotFound)
return 'Resolve issue with JDBC drivers<br>Close this dialog and try again';
if (act === 'connect') {
http://git-wip-us.apache.org/repos/asf/ignite/blob/75d8a2a5/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 3bd9688..790a789 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
@@ -30,13 +30,13 @@ mixin td-ellipses-lbl(w, lbl)
button.close(ng-click='$hide()' aria-hidden='true') ×
h4.modal-title(ng-if='!importDomain.demo') Import domain models from database
h4.modal-title(ng-if='importDomain.demo') Import domain models from demo database
- .import-domain-model-wizard-page(ng-show='importDomain.action == "drivers"' style='margin-bottom: 256px')
- div(ng-if='!importDomain.jdbcDriversFound')
- label Domain model could not be imported
- ul
- li Agent not found JDBC drivers
- li Copy required JDBC drivers into agent '\jdbc-drivers' folder and try again
- li Refer to agent README.txt for more information
+ .import-domain-model-wizard-page(ng-if='importDomain.action == "drivers" && !importDomain.jdbcDriversNotFound' style='margin-bottom: 321px')
+ .import-domain-model-wizard-page(ng-if='importDomain.action == "drivers" && importDomain.jdbcDriversNotFound' style='margin-bottom: 220px')
+ | Domain model could not be imported
+ ul
+ li Agent failed to find JDBC drivers
+ li Copy required JDBC drivers into agent '\jdbc-drivers' folder and try again
+ li Refer to agent README.txt for more information
.import-domain-model-wizard-page(ng-show='importDomain.action == "connect" && importDomain.demo' style='margin-bottom: 211px')
div(ng-if='demoConnection.db == "H2"')
label Demo description:
[25/51] [abbrv] ignite git commit: IGNITE-843 changed case
Posted by ak...@apache.org.
IGNITE-843 changed case
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ef8f70b6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ef8f70b6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ef8f70b6
Branch: refs/heads/ignite-843-rc3
Commit: ef8f70b6ce7df2140c1916adfea758a6944126ce
Parents: 91e998c
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:20:37 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:20:37 2016 +0700
----------------------------------------------------------------------
.../js/app/modules/branding/Logo.provider.js | 42 +++++++++++++++++
.../js/app/modules/branding/Terms.provider.js | 41 +++++++++++++++++
.../js/app/modules/branding/logo.provider.js | 42 -----------------
.../js/app/modules/branding/terms.provider.js | 41 -----------------
.../js/app/modules/navbar/Userbar.directive.js | 48 --------------------
.../js/app/modules/navbar/userbar.directive.js | 48 ++++++++++++++++++++
6 files changed, 131 insertions(+), 131 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/branding/Logo.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/Logo.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/Logo.provider.js
new file mode 100644
index 0000000..fcefc7c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/Logo.provider.js
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteLogo', [function() {
+ let poweredBy = false;
+
+ let url = '/images/ignite-logo.png';
+
+ let title = 'Management console for Apache Ignite';
+
+ this.url = (_url) => {
+ url = _url;
+
+ poweredBy = true;
+ };
+
+ this.title = (_title) => {
+ title = _title;
+ };
+
+ this.$get = [() => {
+ return {
+ url,
+ poweredBy,
+ title
+ };
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/branding/Terms.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/Terms.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/Terms.provider.js
new file mode 100644
index 0000000..c9c6009
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/branding/Terms.provider.js
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['IgniteTerms', [function() {
+ let _rows = [
+ 'Apache Ignite Web Console',
+ '© 2016 The Apache Software Foundation.',
+ 'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
+ ];
+
+ let _state;
+
+ this.footerRows = function(rows) {
+ _rows = rows;
+ };
+
+ this.termsState = function(state) {
+ _state = state;
+ };
+
+ this.$get = [function() {
+ return {
+ footerRows: _rows,
+ termsState: _state
+ };
+ }];
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
deleted file mode 100644
index fcefc7c..0000000
--- a/modules/control-center-web/src/main/js/app/modules/branding/logo.provider.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['IgniteLogo', [function() {
- let poweredBy = false;
-
- let url = '/images/ignite-logo.png';
-
- let title = 'Management console for Apache Ignite';
-
- this.url = (_url) => {
- url = _url;
-
- poweredBy = true;
- };
-
- this.title = (_title) => {
- title = _title;
- };
-
- this.$get = [() => {
- return {
- url,
- poweredBy,
- title
- };
- }];
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js b/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
deleted file mode 100644
index c9c6009..0000000
--- a/modules/control-center-web/src/main/js/app/modules/branding/terms.provider.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['IgniteTerms', [function() {
- let _rows = [
- 'Apache Ignite Web Console',
- '© 2016 The Apache Software Foundation.',
- 'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
- ];
-
- let _state;
-
- this.footerRows = function(rows) {
- _rows = rows;
- };
-
- this.termsState = function(state) {
- _state = state;
- };
-
- this.$get = [function() {
- return {
- footerRows: _rows,
- termsState: _state
- };
- }];
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js b/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
deleted file mode 100644
index 0e94063..0000000
--- a/modules/control-center-web/src/main/js/app/modules/navbar/Userbar.directive.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['igniteUserbar', [function() {
- return {
- restrict: 'A',
- controller: ['$rootScope', 'IgniteUserbar', function($root, IgniteUserbar) {
- const ctrl = this;
-
- ctrl.items = [
- {text: 'Profile', sref: 'settings.profile'},
- {text: 'Getting Started', click: 'gettingStarted.tryShow(true)'}
- ];
-
- const _rebuildSettings = (event, user) => {
- ctrl.items.splice(2);
-
- if (!user.becomeUsed && user.admin)
- ctrl.items.push({text: 'Admin Panel', sref: 'settings.admin'});
-
- ctrl.items.push(...IgniteUserbar);
-
- if (!user.becomeUsed)
- ctrl.items.push({text: 'Log Out', sref: 'logout'});
- };
-
- if ($root.user)
- _rebuildSettings(null, $root.user);
-
- $root.$on('user', _rebuildSettings);
- }],
- controllerAs: 'userbar'
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/ef8f70b6/modules/control-center-web/src/main/js/app/modules/navbar/userbar.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/navbar/userbar.directive.js b/modules/control-center-web/src/main/js/app/modules/navbar/userbar.directive.js
new file mode 100644
index 0000000..0e94063
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/navbar/userbar.directive.js
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['igniteUserbar', [function() {
+ return {
+ restrict: 'A',
+ controller: ['$rootScope', 'IgniteUserbar', function($root, IgniteUserbar) {
+ const ctrl = this;
+
+ ctrl.items = [
+ {text: 'Profile', sref: 'settings.profile'},
+ {text: 'Getting Started', click: 'gettingStarted.tryShow(true)'}
+ ];
+
+ const _rebuildSettings = (event, user) => {
+ ctrl.items.splice(2);
+
+ if (!user.becomeUsed && user.admin)
+ ctrl.items.push({text: 'Admin Panel', sref: 'settings.admin'});
+
+ ctrl.items.push(...IgniteUserbar);
+
+ if (!user.becomeUsed)
+ ctrl.items.push({text: 'Log Out', sref: 'logout'});
+ };
+
+ if ($root.user)
+ _rebuildSettings(null, $root.user);
+
+ $root.$on('user', _rebuildSettings);
+ }],
+ controllerAs: 'userbar'
+ };
+}]];
[09/51] [abbrv] ignite git commit: IGNITE-843 Minor getting started
fixes.
Posted by ak...@apache.org.
IGNITE-843 Minor getting started fixes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3eec50a2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3eec50a2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3eec50a2
Branch: refs/heads/ignite-843-rc3
Commit: 3eec50a272927f80933a0a7ce765fe3881ce200e
Parents: addc83d
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 14:04:08 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 14:04:08 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/data/getting-started.json | 2 +-
.../src/main/js/public/stylesheets/style.scss | 14 ++++++++++++--
.../src/main/js/views/templates/getting-started.jade | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3eec50a2/modules/control-center-web/src/main/js/app/data/getting-started.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/data/getting-started.json b/modules/control-center-web/src/main/js/app/data/getting-started.json
index 7bc8a0e..5a2fb69 100644
--- a/modules/control-center-web/src/main/js/app/data/getting-started.json
+++ b/modules/control-center-web/src/main/js/app/data/getting-started.json
@@ -3,7 +3,7 @@
"title": "With Apache Ignite Web Console You Can",
"message": [
"<img src='/images/ignite-puzzle.png' width='100%' />",
- "<ul>",
+ "<ul class='margin-top-dflt'>",
"<li>Generate cluster configuration</li>",
"<li>Import domain model from database</li>",
"<li>Configure all needed caches</li>",
http://git-wip-us.apache.org/repos/asf/ignite/blob/3eec50a2/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 e8b5a77..19589b6 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
@@ -1813,9 +1813,19 @@ treecontrol.tree-classic {
.getting-started {
margin: 15px 15px 300px;
+}
- ul {
- padding-left: 20px;
+.getting-started-footer {
+ @extend .modal-footer;
+
+ padding: 10px 15px;
+
+ .btn:last-child {
+ margin-right: 0;
+ }
+
+ .checkbox {
+ margin: 0;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/3eec50a2/modules/control-center-web/src/main/js/views/templates/getting-started.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/getting-started.jade b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
index b6a4392..0c8d316 100644
--- a/modules/control-center-web/src/main/js/views/templates/getting-started.jade
+++ b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
@@ -20,7 +20,7 @@
h4.modal-title {{title}}
.getting-started
.col-xs-12(ng-bind-html='message')
- .modal-footer
+ .getting-started-footer
.checkbox
label
input(type='checkbox' ng-model='ui.showGettingStarted')
[42/51] [abbrv] ignite git commit: IGNITE-2520 Try to fix.
Posted by ak...@apache.org.
IGNITE-2520 Try to fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d43908b3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d43908b3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d43908b3
Branch: refs/heads/ignite-843-rc3
Commit: d43908b3e6b3caf3338621cac52851a07cebfb74
Parents: d7bf9e1
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 13:11:12 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 13:11:12 2016 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/profile-controller.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d43908b3/modules/control-center-web/src/main/js/controllers/profile-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/profile-controller.js b/modules/control-center-web/src/main/js/controllers/profile-controller.js
index 1336784..e0056de 100644
--- a/modules/control-center-web/src/main/js/controllers/profile-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/profile-controller.js
@@ -40,12 +40,14 @@ consoleModule.controller('profileController',
}
$scope.profileCouldBeSaved = function () {
- return $scope.profileForm.$valid && _profileChanged();
+ return _profileChanged() && $scope.profileForm && $scope.profileForm.$valid;
};
$scope.saveBtnTipText = function () {
- return _profileChanged()
- ? ($scope.profileForm.$valid ? 'Save profile' : 'Invalid profile settings') : 'Nothing to save';
+ if (!_profileChanged())
+ return 'Nothing to save';
+
+ return $scope.profileForm && $scope.profileForm.$valid ? 'Save profile' : 'Invalid profile settings';
};
$scope.saveUser = function () {
[24/51] [abbrv] ignite git commit: IGNITE-843 Rename dir.
Posted by ak...@apache.org.
IGNITE-843 Rename dir.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/91e998c9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/91e998c9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/91e998c9
Branch: refs/heads/ignite-843-rc3
Commit: 91e998c990b166d8f3d16fe636f472c0f5b02c4e
Parents: 7612c22
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:14:39 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:14:39 2016 +0700
----------------------------------------------------------------------
modules/control-center-web/src/main/js/app/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/91e998c9/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 fac2313..0a27aff 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 './modules/Form/form.module';
+import './modules/form/form.module';
import './modules/JavaTypes/JavaTypes.provider';
import './modules/QueryNotebooks/QueryNotebooks.provider';
[39/51] [abbrv] 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/750f4b89
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/750f4b89
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/750f4b89
Branch: refs/heads/ignite-843-rc3
Commit: 750f4b89beefa58902483e41745c7fa8a47e46c9
Parents: 66cddca 6240528
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 11:16:06 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 11:16:06 2016 +0700
----------------------------------------------------------------------
modules/control-center-agent/README.txt | 4 ++--
.../states/configuration/clusters/general/discovery/cloud.jade | 4 ++--
.../js/app/modules/states/configuration/clusters/thread.jade | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[28/51] [abbrv] ignite git commit: IGNITE-843 Minor fix.
Posted by ak...@apache.org.
IGNITE-843 Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ace9ef73
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ace9ef73
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ace9ef73
Branch: refs/heads/ignite-843-rc3
Commit: ace9ef73a60a20ac088cdfc013801ded6328a68b
Parents: bdfa18f
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 18:02:27 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 18:02:27 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/ace9ef73/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 766b4bf..ce38bfd 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
@@ -84,7 +84,7 @@ module.exports.factory = function (_, express, apacheIgnite, fs, JSZip, settings
var 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.agentPort);
+ prop.push('server-uri=wss://' + host + ':' + settings.agent.port);
prop.push('#Uncomment following options if needed:');
prop.push('#node-uri=http://localhost:8080');
prop.push('#driver-folder=./jdbc-drivers');
[17/51] [abbrv] ignite git commit: IGNITE-843 Refactored modules.
Posted by ak...@apache.org.
IGNITE-843 Refactored modules.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/31e6254f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/31e6254f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/31e6254f
Branch: refs/heads/ignite-843-rc3
Commit: 31e6254f589e06802dcaf9bfd513236451293f98
Parents: 0fc9726
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 16:35:57 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 16:35:57 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/modules/User/Auth.service.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/31e6254f/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
index 175c22c..3e194e7 100644
--- a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
+++ b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
@@ -15,7 +15,8 @@
* limitations under the License.
*/
-export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User', function($http, $root, $state, $common, gettingStarted, User) {
+export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
+ function($http, $root, $state, $common, gettingStarted, User) {
let _auth = false;
try {
[43/51] [abbrv] ignite git commit: IGNITE-2520 Fixed possible npe.
Posted by ak...@apache.org.
IGNITE-2520 Fixed possible npe.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/08725201
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/08725201
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/08725201
Branch: refs/heads/ignite-843-rc3
Commit: 08725201722fcb542cd45067698e928ffed59156
Parents: d43908b
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 13:59:23 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 13:59:23 2016 +0700
----------------------------------------------------------------------
.../ignite/console/agent/handlers/RestExecutor.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/08725201/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java b/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
index 2f87726..3eb869b 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
@@ -91,10 +91,20 @@ public class RestExecutor {
String mtd, Map<String, String> headers, String body) throws IOException, URISyntaxException {
log.debug("Start execute REST command [method=" + mtd + ", uri=/" + uri + ", parameters=" + params + "]");
- if (demo)
+ final URIBuilder builder;
+
+ if (demo) {
+ // try start demo if needed.
AgentSqlDemo.testDrive(cfg);
- URIBuilder builder = new URIBuilder(demo ? cfg.demoNodeUri() : cfg.nodeUri());
+ // null if demo node not started yet.
+ if (cfg.demoNodeUri() == null)
+ return RestResult.fail(404, "Demo node is not started yet.");
+
+ builder = new URIBuilder(cfg.demoNodeUri());
+ }
+ else
+ builder = new URIBuilder(cfg.nodeUri());
if (builder.getPort() == -1)
builder.setPort(DFLT_NODE_PORT);
[47/51] [abbrv] ignite git commit: IGNITE-843 Minor ui fix
Posted by ak...@apache.org.
IGNITE-843 Minor ui fix
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9ba3e22f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9ba3e22f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9ba3e22f
Branch: refs/heads/ignite-843-rc3
Commit: 9ba3e22f4c173cef2bdf8f0608fd4d34cb36ad7c
Parents: e71b2bd
Author: Andrey <an...@gridgain.com>
Authored: Tue Feb 9 15:44:24 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Feb 9 15:44:24 2016 +0700
----------------------------------------------------------------------
.../src/main/js/public/stylesheets/style.scss | 21 ++++++++++++++++----
.../src/main/js/views/sql/sql.jade | 5 +++--
2 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9ba3e22f/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 2d36ebe..08a6082 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
@@ -626,10 +626,23 @@ button.form-control {
color: $ignite-placeholder-color;
}
- .sql-error-result {
- margin-bottom: 10px;
- text-align: center;
- color: $brand-danger;
+ .sql-next {
+ float: right;
+
+ .disabled {
+ cursor: default;
+ text-decoration: none;
+ }
+
+ a {
+ margin-right: 5px;
+ margin-bottom: 5px;
+ }
+
+ i {
+ margin-top: 3px;
+ margin-right: 10px;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9ba3e22f/modules/control-center-web/src/main/js/views/sql/sql.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade
index f4893dd..cc280d3 100644
--- a/modules/control-center-web/src/main/js/views/sql/sql.jade
+++ b/modules/control-center-web/src/main/js/views/sql/sql.jade
@@ -177,5 +177,6 @@ mixin chart-settings(mdl)
hr(style='margin-top: 0; margin-bottom: 5px')
a(ng-show='paragraph.queryArgs.type' style='float: left; margin-left: 10px; margin-bottom: 5px' ng-click='showResultQuery(paragraph)') Show query
- i.fa.fa-chevron-circle-right(ng-show=nextVisibleCondition style='float: right;margin-right: 10px; margin-top: 3px' ng-click='nextPage(paragraph)')
- a(ng-show=nextVisibleCondition ng-disabled='paragraph.loading' ng-click='!paragraph.loading && nextPage(paragraph)' style='float: right; margin-bottom: 5px;margin-right: 5px;') Next
+ .sql-next(ng-show=nextVisibleCondition )
+ i.fa.fa-chevron-circle-right(ng-class='{disabled: paragraph.loading}' ng-click='!paragraph.loading && nextPage(paragraph)')
+ a(ng-class='{disabled: paragraph.loading}' ng-click='!paragraph.loading && nextPage(paragraph)') Next
[20/51] [abbrv] ignite git commit: IGNITE-843 changed case of dir
Posted by ak...@apache.org.
IGNITE-843 changed case of dir
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e8742140
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e8742140
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e8742140
Branch: refs/heads/ignite-843-rc3
Commit: e87421405072a3f24cf18769a0df227961b974cd
Parents: f44371d
Author: Andrey <an...@gridgain.com>
Authored: Mon Feb 8 17:10:14 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Feb 8 17:10:14 2016 +0700
----------------------------------------------------------------------
.../main/js/app/modules/User/Auth.service.js | 77 --------------------
.../main/js/app/modules/User/User.service.js | 58 ---------------
.../src/main/js/app/modules/User/user.module.js | 28 -------
.../main/js/app/modules/user/Auth.service.js | 77 ++++++++++++++++++++
.../main/js/app/modules/user/User.service.js | 58 +++++++++++++++
.../src/main/js/app/modules/user/user.module.js | 28 +++++++
6 files changed, 163 insertions(+), 163 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
deleted file mode 100644
index 3e194e7..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/Auth.service.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
- function($http, $root, $state, $common, gettingStarted, User) {
- let _auth = false;
-
- try {
- _auth = localStorage.authorized === 'true';
- }
- catch (ignore) {
- // No-op.
- }
-
- function _authorized(value) {
- try {
- return _auth = localStorage.authorized = !!value;
- } catch (ignore) {
- return _auth = !!value;
- }
- }
-
- return {
- get authorized() {
- return _auth;
- },
- set authorized(auth) {
- _authorized(auth);
- },
- auth(action, userInfo) {
- $http.post('/api/v1/' + action, userInfo)
- .then(User.read)
- .then((user) => {
- if (action !== 'password/forgot') {
- _authorized(true);
-
- $root.$broadcast('user', user);
-
- $state.go('base.configuration.clusters');
-
- $root.gettingStarted.tryShow();
- } else
- $state.go('password.send');
- })
- .catch(function(errMsg) {
- $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
- });
- },
- logout() {
- $http.post('/api/v1/logout')
- .then(function() {
- User.clean();
-
- _authorized(false);
-
- $state.go('login');
- })
- .catch(function(errMsg) {
- $common.showError(errMsg);
- });
- }
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/User.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/User.service.js b/modules/control-center-web/src/main/js/app/modules/User/User.service.js
deleted file mode 100644
index dc2117e..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/User.service.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default ['User', ['$q', '$injector', '$rootScope', '$state', '$http', function($q, $injector, $root, $state, $http) {
- let _user;
-
- try {
- _user = JSON.parse(localStorage.user);
-
- if (_user)
- $root.user = _user;
- }
- catch (ignore) {
- // No-op.
- }
-
- return {
- read() {
- return $http.post('/api/v1/user').then(({data}) => {
- if (_.isEmpty(data)) {
- const Auth = $injector.get('Auth');
-
- Auth.authorized = false;
-
- $state.go('login');
- }
-
- try {
- localStorage.user = JSON.stringify(data);
- }
- catch (ignore) {
- // No-op.
- }
-
- return _user = $root.user = data;
- });
- },
- clean() {
- delete $root.user;
-
- delete localStorage.user;
- }
- };
-}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/User/user.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/User/user.module.js b/modules/control-center-web/src/main/js/app/modules/User/user.module.js
deleted file mode 100644
index 2387f20..0000000
--- a/modules/control-center-web/src/main/js/app/modules/User/user.module.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import angular from 'angular';
-
-import Auth from './Auth.service';
-import User from './User.service';
-
-angular
-.module('ignite-console.user', [
-
-])
-.service(...Auth)
-.service(...User);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
new file mode 100644
index 0000000..3e194e7
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/Auth.service.js
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['Auth', ['$http', '$rootScope', '$state', '$common', 'IgniteGettingStarted', 'User',
+ function($http, $root, $state, $common, gettingStarted, User) {
+ let _auth = false;
+
+ try {
+ _auth = localStorage.authorized === 'true';
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ function _authorized(value) {
+ try {
+ return _auth = localStorage.authorized = !!value;
+ } catch (ignore) {
+ return _auth = !!value;
+ }
+ }
+
+ return {
+ get authorized() {
+ return _auth;
+ },
+ set authorized(auth) {
+ _authorized(auth);
+ },
+ auth(action, userInfo) {
+ $http.post('/api/v1/' + action, userInfo)
+ .then(User.read)
+ .then((user) => {
+ if (action !== 'password/forgot') {
+ _authorized(true);
+
+ $root.$broadcast('user', user);
+
+ $state.go('base.configuration.clusters');
+
+ $root.gettingStarted.tryShow();
+ } else
+ $state.go('password.send');
+ })
+ .catch(function(errMsg) {
+ $common.showPopoverMessage(null, null, 'user_email', errMsg.data);
+ });
+ },
+ logout() {
+ $http.post('/api/v1/logout')
+ .then(function() {
+ User.clean();
+
+ _authorized(false);
+
+ $state.go('login');
+ })
+ .catch(function(errMsg) {
+ $common.showError(errMsg);
+ });
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/User.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/User.service.js b/modules/control-center-web/src/main/js/app/modules/user/User.service.js
new file mode 100644
index 0000000..dc2117e
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/User.service.js
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default ['User', ['$q', '$injector', '$rootScope', '$state', '$http', function($q, $injector, $root, $state, $http) {
+ let _user;
+
+ try {
+ _user = JSON.parse(localStorage.user);
+
+ if (_user)
+ $root.user = _user;
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return {
+ read() {
+ return $http.post('/api/v1/user').then(({data}) => {
+ if (_.isEmpty(data)) {
+ const Auth = $injector.get('Auth');
+
+ Auth.authorized = false;
+
+ $state.go('login');
+ }
+
+ try {
+ localStorage.user = JSON.stringify(data);
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ return _user = $root.user = data;
+ });
+ },
+ clean() {
+ delete $root.user;
+
+ delete localStorage.user;
+ }
+ };
+}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8742140/modules/control-center-web/src/main/js/app/modules/user/user.module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/user/user.module.js b/modules/control-center-web/src/main/js/app/modules/user/user.module.js
new file mode 100644
index 0000000..2387f20
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/user/user.module.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import Auth from './Auth.service';
+import User from './User.service';
+
+angular
+.module('ignite-console.user', [
+
+])
+.service(...Auth)
+.service(...User);
[37/51] [abbrv] ignite git commit: IGNITE-843 Fixed typo.
Posted by ak...@apache.org.
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/6240528b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6240528b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6240528b
Branch: refs/heads/ignite-843-rc3
Commit: 6240528b449aaaee4201d93baf4f2a3c1a32ab2e
Parents: fa9482b
Author: vsisko <vs...@gridgain.com>
Authored: Tue Feb 9 10:43:27 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Feb 9 10:43:27 2016 +0700
----------------------------------------------------------------------
.../states/configuration/clusters/general/discovery/cloud.jade | 4 ++--
.../js/app/modules/states/configuration/clusters/thread.jade | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6240528b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
index addd5d3..bca8c4e 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
@@ -69,7 +69,7 @@ div
data-ng-model='#{model}.provider'
data-ng-required='true'
)
- .details-row(ng-if='true')
+ .details-row
ignite-form-group(ng-model='#{regions}' ng-form='generalDiscoveryCloudRegions')
ignite-form-field-label
| Regions
@@ -152,7 +152,7 @@ div
.group-content-empty(ng-if='!(#{regions}.length) && !group.add.length')
| Not defined
- .details-row(ng-if='true')
+ .details-row
ignite-form-group(ng-model='#{zones}' ng-form='generalDiscoveryCloudZones')
ignite-form-field-label
| Zones
http://git-wip-us.apache.org/repos/asf/ignite/blob/6240528b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/thread.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/thread.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/thread.jade
index fbb9512..0e49742 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/thread.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/thread.jade
@@ -75,7 +75,7 @@ form.panel.panel-default(name='thread' novalidate)
ignite-form-field-tooltip
| Max count of threads can be used at rebalancing
ignite-form-field-input-number(
- data-irebalanceThreadPoolSized=''
+ data-id='rebalanceThreadPoolSize'
data-name='rebalanceThreadPoolSize'
data-ng-model='#{model}.rebalanceThreadPoolSize'
data-placeholder='1'
[04/51] [abbrv] ignite git commit: IGNITE-843 getting started.
Posted by ak...@apache.org.
IGNITE-843 getting started.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f29c2fd2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f29c2fd2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f29c2fd2
Branch: refs/heads/ignite-843-rc3
Commit: f29c2fd29419098041ff21ba58547f253c87c9fa
Parents: 9073514
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 8 10:50:56 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 8 10:50:56 2016 +0700
----------------------------------------------------------------------
.../src/main/js/app/data/getting-started.json | 39 +++++++-------------
.../src/main/js/public/stylesheets/style.scss | 8 ++++
.../js/views/templates/getting-started.jade | 2 +-
3 files changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f29c2fd2/modules/control-center-web/src/main/js/app/data/getting-started.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/data/getting-started.json b/modules/control-center-web/src/main/js/app/data/getting-started.json
index 71c152d..7bc8a0e 100644
--- a/modules/control-center-web/src/main/js/app/data/getting-started.json
+++ b/modules/control-center-web/src/main/js/app/data/getting-started.json
@@ -1,15 +1,8 @@
[
{
- "title": "What is Apache Ignite",
+ "title": "With Apache Ignite Web Console You Can",
"message": [
- "<p><b>Apache Ignite</b> is designed to deliver uncompromised performance for a wide set of in-memory computing use cases from high performance computing, to the industry most advanced data grid, highly available service grid, and streaming.</p>",
- "<img src='/images/ignite-puzzle.png' width='100%' ng-click='console.log(\"click\")' />"
- ]
- },
- {
- "title": "What is Apache Ignite Web Console",
- "message": [
- "<p>You will be able to<p>",
+ "<img src='/images/ignite-puzzle.png' width='100%' />",
"<ul>",
"<li>Generate cluster configuration</li>",
"<li>Import domain model from database</li>",
@@ -42,10 +35,8 @@
"</div>",
"<div class='col-xs-5'>",
"<ul>",
- "<li>Import domain model from database</li>",
- "<li>Try it in <span class='getting-started-demo'>Demo</span> mode</li>",
- "<li>Associate domain model with caches</li>",
- "<li>Configure SQL queries</li>",
+ "<li>Import database schemas</li>",
+ "<li>Try in <span class='getting-started-demo'>Demo</span> mode</li>",
"</ul>",
"</div>"
]
@@ -58,10 +49,8 @@
"</div>",
"<div class='col-xs-5'>",
"<ul>",
- "<li>Configure cache properties</li>",
- "<li>Associate cache with clusters</li>",
- "<li>Associate cache with domain model</li>",
- "<li>Configure cache store</li>",
+ "<li>Configure memory settings</li>",
+ "<li>Configure persistence</li>",
"</ul>",
"</div>"
]
@@ -88,11 +77,11 @@
"</div>",
"<div class='col-xs-5'>",
"<ul>",
- "<li>Preview cluster XML configuration</li>",
- "<li>Preview generated Java code</li>",
+ "<li>Preview XML Configuration</li>",
+ "<li>Preview code configuration</li>",
"<li>Preview Docker file</li>",
- "<li>Preview pom.xml</li>",
- "<li>Download ZIP with fully functional project</li>",
+ "<li>Preview POM dependencies</li>",
+ "<li>Download ready-to-use project</li>",
"</ul>",
"</div>"
]
@@ -105,10 +94,10 @@
"</div>",
"<div class='col-xs-5'>",
"<ul>",
- "<li>Execute SQL queries</li>",
- "<li>View execution plan</li>",
- "<li>View data in tabular format and charts</li>",
- "<li>View streaming charts</li>",
+ "<li>Execute SQL Queries</li>",
+ "<li>View Execution Paln</li>",
+ "<li>View In-Memory Schema</li>",
+ "<li>View Streaming Charts</li>",
"</ul>",
"</div>"
]
http://git-wip-us.apache.org/repos/asf/ignite/blob/f29c2fd2/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 a1c4347..e8b5a77 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
@@ -1811,6 +1811,14 @@ treecontrol.tree-classic {
background-image: none;
}
+.getting-started {
+ margin: 15px 15px 300px;
+
+ ul {
+ padding-left: 20px;
+ }
+}
+
.getting-started-demo {
color: $brand-info;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f29c2fd2/modules/control-center-web/src/main/js/views/templates/getting-started.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/getting-started.jade b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
index 54185cc..b6a4392 100644
--- a/modules/control-center-web/src/main/js/views/templates/getting-started.jade
+++ b/modules/control-center-web/src/main/js/views/templates/getting-started.jade
@@ -18,7 +18,7 @@
#errors-container.modal-header.header
button.close(ng-click='close()' aria-hidden='true') ×
h4.modal-title {{title}}
- .import-domain-model-wizard-page(style='margin-bottom: 280px')
+ .getting-started
.col-xs-12(ng-bind-html='message')
.modal-footer
.checkbox