http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/demo/domains.json ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/demo/domains.json b/modules/web-console/src/main/js/serve/routes/demo/domains.json deleted file mode 100644 index 980d8d1..0000000 --- a/modules/web-console/src/main/js/serve/routes/demo/domains.json +++ /dev/null @@ -1,307 +0,0 @@ -[ - { - "keyType": "Integer", - "valueType": "model.Parking", - "queryMetadata": "Configuration", - "databaseSchema": "CARS", - "databaseTable": "PARKING", - "indexes": [], - "aliases": [], - "fields": [ - { - "name": "name", - "className": "String" - }, - { - "name": "capacity", - "className": "Integer" - } - ], - "valueFields": [ - { - "databaseFieldName": "NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "name", - "javaFieldType": "String" - }, - { - "databaseFieldName": "CAPACITY", - "databaseFieldType": "INTEGER", - "javaFieldName": "capacity", - "javaFieldType": "int" - } - ], - "keyFields": [ - { - "databaseFieldName": "ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "id", - "javaFieldType": "int" - } - ], - "caches": [] - }, - { - "keyType": "Integer", - "valueType": "model.Department", - "queryMetadata": "Configuration", - "databaseSchema": "PUBLIC", - "databaseTable": "DEPARTMENT", - "indexes": [], - "aliases": [], - "fields": [ - { - "name": "countryId", - "className": "Integer" - }, - { - "name": "name", - "className": "String" - } - ], - "valueFields": [ - { - "databaseFieldName": "COUNTRY_ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "countryId", - "javaFieldType": "int" - }, - { - "databaseFieldName": "NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "name", - "javaFieldType": "String" - } - ], - "keyFields": [ - { - "databaseFieldName": "ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "id", - "javaFieldType": "int" - } - ], - "caches": [] - }, - { - "keyType": "Integer", - "valueType": "model.Employee", - "queryMetadata": "Configuration", - "databaseSchema": "PUBLIC", - "databaseTable": "EMPLOYEE", - "indexes": [ - { - "name": "EMP_NAMES", - "indexType": "SORTED", - "fields": [ - { - "name": "firstName", - "direction": true - }, - { - "name": "lastName", - "direction": true - } - ] - }, - { - "name": "EMP_SALARY", - "indexType": "SORTED", - "fields": [ - { - "name": "salary", - "direction": true - } - ] - } - ], - "aliases": [], - "fields": [ - { - "name": "departmentId", - "className": "Integer" - }, - { - "name": "managerId", - "className": "Integer" - }, - { - "name": "firstName", - "className": "String" - }, - { - "name": "lastName", - "className": "String" - }, - { - "name": "email", - "className": "String" - }, - { - "name": "phoneNumber", - "className": "String" - }, - { - "name": "hireDate", - "className": "Date" - }, - { - "name": "job", - "className": "String" - }, - { - "name": "salary", - "className": "Double" - } - ], - "valueFields": [ - { - "databaseFieldName": "DEPARTMENT_ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "departmentId", - "javaFieldType": "int" - }, - { - "databaseFieldName": "MANAGER_ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "managerId", - "javaFieldType": "Integer" - }, - { - "databaseFieldName": "FIRST_NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "firstName", - "javaFieldType": "String" - }, - { - "databaseFieldName": "LAST_NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "lastName", - "javaFieldType": "String" - }, - { - "databaseFieldName": "EMAIL", - "databaseFieldType": "VARCHAR", - "javaFieldName": "email", - "javaFieldType": "String" - }, - { - "databaseFieldName": "PHONE_NUMBER", - "databaseFieldType": "VARCHAR", - "javaFieldName": "phoneNumber", - "javaFieldType": "String" - }, - { - "databaseFieldName": "HIRE_DATE", - "databaseFieldType": "DATE", - "javaFieldName": "hireDate", - "javaFieldType": "Date" - }, - { - "databaseFieldName": "JOB", - "databaseFieldType": "VARCHAR", - "javaFieldName": "job", - "javaFieldType": "String" - }, - { - "databaseFieldName": "SALARY", - "databaseFieldType": "DOUBLE", - "javaFieldName": "salary", - "javaFieldType": "Double" - } - ], - "keyFields": [ - { - "databaseFieldName": "ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "id", - "javaFieldType": "int" - } - ], - "caches": [] - }, - { - "keyType": "Integer", - "valueType": "model.Country", - "queryMetadata": "Configuration", - "databaseSchema": "PUBLIC", - "databaseTable": "COUNTRY", - "indexes": [], - "aliases": [], - "fields": [ - { - "name": "name", - "className": "String" - }, - { - "name": "population", - "className": "Integer" - } - ], - "valueFields": [ - { - "databaseFieldName": "NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "name", - "javaFieldType": "String" - }, - { - "databaseFieldName": "POPULATION", - "databaseFieldType": "INTEGER", - "javaFieldName": "population", - "javaFieldType": "int" - } - ], - "keyFields": [ - { - "databaseFieldName": "ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "id", - "javaFieldType": "int" - } - ], - "caches": [] - }, - { - "keyType": "Integer", - "valueType": "model.Car", - "queryMetadata": "Configuration", - "databaseSchema": "CARS", - "databaseTable": "CAR", - "indexes": [], - "aliases": [], - "fields": [ - { - "name": "parkingId", - "className": "Integer" - }, - { - "name": "name", - "className": "String" - } - ], - "valueFields": [ - { - "databaseFieldName": "PARKING_ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "parkingId", - "javaFieldType": "int" - }, - { - "databaseFieldName": "NAME", - "databaseFieldType": "VARCHAR", - "javaFieldName": "name", - "javaFieldType": "String" - } - ], - "keyFields": [ - { - "databaseFieldName": "ID", - "databaseFieldType": "INTEGER", - "javaFieldName": "id", - "javaFieldType": "int" - } - ], - "caches": [] - } -]
http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/demo/igfss.json ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/demo/igfss.json b/modules/web-console/src/main/js/serve/routes/demo/igfss.json deleted file mode 100644 index cd128a6..0000000 --- a/modules/web-console/src/main/js/serve/routes/demo/igfss.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "ipcEndpointEnabled": true, - "fragmentizerEnabled": true, - "name": "igfs", - "dataCacheName": "igfs-data", - "metaCacheName": "igfs-meta", - "clusters": [] - } -] http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/domains.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/domains.js b/modules/web-console/src/main/js/serve/routes/domains.js deleted file mode 100644 index 9dbf418..0000000 --- a/modules/web-console/src/main/js/serve/routes/domains.js +++ /dev/null @@ -1,195 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'domains-routes', - inject: ['require(lodash)', 'require(express)', 'mongo'] -}; - -module.exports.factory = (_, express, mongo) => { - return new Promise((factoryResolve) => { - const router = new express.Router(); - - /** - * Get spaces and domain models accessed for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/list', (req, res) => { - const result = {}; - let spacesIds = []; - - mongo.spaces(req.currentUserId(), req.header('IgniteDemoMode')) - .then((spaces) => { - result.spaces = spaces; - spacesIds = spaces.map((space) => space._id); - - return mongo.Cluster.find({space: {$in: spacesIds}}, '_id name').sort('name').lean().exec(); - }) - .then((clusters) => { - result.clusters = clusters; - - return mongo.Cache.find({space: {$in: spacesIds}}).sort('name').lean().exec(); - }) - .then((caches) => { - result.caches = caches; - - return mongo.DomainModel.find({space: {$in: spacesIds}}).sort('valueType').lean().exec(); - }) - .then((domains) => { - result.domains = domains; - - res.json(result); - }) - .catch((err) => mongo.handleError(res, err)); - }); - - function _updateCacheStore(cacheStoreChanges) { - const promises = []; - - _.forEach(cacheStoreChanges, (change) => - promises.push(mongo.Cache.update({_id: {$eq: change.cacheId}}, change.change, {}).exec()) - ); - - return Promise.all(promises); - } - - const _saveDomainModel = (domain, savedDomains) => { - const caches = domain.caches; - const cacheStoreChanges = domain.cacheStoreChanges; - const domainId = domain._id; - - return mongo.DomainModel.findOne({space: domain.space, valueType: domain.valueType}).exec() - .then((_domain) => { - if (_domain && domainId !== _domain._id.toString()) - throw new Error('Domain model with value type: "' + _domain.valueType + '" already exist.'); - - if (domainId) { - return mongo.DomainModel.update({_id: domain._id}, domain, {upsert: true}).exec() - .then(() => mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi: true}).exec()) - .then(() => mongo.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}}, {multi: true}).exec()) - .then(() => { - savedDomains.push(domain); - - return _updateCacheStore(cacheStoreChanges); - }); - } - - return (new mongo.DomainModel(domain)).save() - .then((savedDomain) => { - savedDomains.push(savedDomain); - - return mongo.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: savedDomain._id}}, {multi: true}).exec(); - }) - .then(() => _updateCacheStore(cacheStoreChanges)); - }); - }; - - const _save = (domains, res) => { - if (domains && domains.length > 0) { - const savedDomains = []; - const generatedCaches = []; - const promises = []; - - _.forEach(domains, (domain) => { - if (domain.newCache) { - promises.push( - mongo.Cache.findOne({space: domain.space, name: domain.newCache.name}).exec() - .then((cache) => { - if (cache) - return Promise.resolve(cache); - - // If cache not found, then create it and associate with domain model. - const newCache = domain.newCache; - newCache.space = domain.space; - - return (new mongo.Cache(newCache)).save() - .then((_cache) => { - generatedCaches.push(_cache); - - return mongo.Cluster.update({_id: {$in: _cache.clusters}}, {$addToSet: {caches: _cache._id}}, {multi: true}).exec() - .then(() => Promise.resolve(_cache)); - }); - }) - .then((cache) => { - domain.caches = [cache._id]; - - return _saveDomainModel(domain, savedDomains); - }) - .catch((err) => mongo.handleError(res, err)) - ); - } - else - promises.push(_saveDomainModel(domain, savedDomains)); - }); - - Promise.all(promises) - .then(() => res.send({savedDomains, generatedCaches})) - .catch((err) => mongo.handleError(res, err)); - } - else - res.status(500).send('Nothing to save!'); - }; - - /** - * Save domain model. - */ - router.post('/save', (req, res) => { - _save([req.body], res); - }); - - /** - * Batch save domain models. - */ - router.post('/save/batch', (req, res) => { - _save(req.body, res); - }); - - /** - * Remove domain model by ._id. - */ - router.post('/remove', (req, res) => { - const params = req.body; - const domainId = params._id; - - mongo.DomainModel.findOne(params).exec() - .then((domain) => mongo.Cache.update({_id: {$in: domain.caches}}, {$pull: {domains: domainId}}, {multi: true}).exec()) - .then(() => mongo.DomainModel.remove(params).exec()) - .then(() => res.sendStatus(200)) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Remove all domain models. - */ - router.post('/remove/all', (req, res) => { - mongo.spaceIds(req.currentUserId(), req.header('IgniteDemoMode')) - .then((spaceIds) => mongo.Cache.update({space: {$in: spaceIds}}, {domains: []}, {multi: true}).exec() - .then(() => mongo.DomainModel.remove({space: {$in: spaceIds}}).exec())) - .then(() => res.sendStatus(200)) - .catch((err) => mongo.handleError(res, err)); - }); - - factoryResolve(router); - }); -}; - http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/igfs.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/igfs.js b/modules/web-console/src/main/js/serve/routes/igfs.js deleted file mode 100644 index f590273..0000000 --- a/modules/web-console/src/main/js/serve/routes/igfs.js +++ /dev/null @@ -1,122 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'igfs-routes', - inject: ['require(lodash)', 'require(express)', 'mongo'] -}; - -module.exports.factory = function(_, express, mongo) { - return new Promise((factoryResolve) => { - const router = new express.Router(); - - /** - * Get spaces and IGFSs accessed for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/list', (req, res) => { - const result = {}; - let spaceIds = []; - - // Get owned space and all accessed space. - mongo.spaces(req.currentUserId(), req.header('IgniteDemoMode')) - .then((spaces) => { - result.spaces = spaces; - spaceIds = spaces.map((space) => space._id); - - return mongo.Cluster.find({space: {$in: spaceIds}}, '_id name').sort('name').lean().exec(); - }) - .then((clusters) => { - result.clusters = clusters; - - return mongo.Igfs.find({space: {$in: spaceIds}}).sort('name').lean().exec(); - }) - .then((igfss) => { - result.igfss = igfss; - - res.json(result); - }) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Save IGFS. - */ - router.post('/save', (req, res) => { - const params = req.body; - const clusters = params.clusters; - - mongo.Igfs.findOne({space: params.space, name: params.name}).exec() - .then((_igfs) => { - const igfsId = params._id; - - if (_igfs && igfsId !== _igfs._id.toString()) - return res.status(500).send('IGFS with name: "' + params.name + '" already exist.'); - - if (params._id) { - return mongo.Igfs.update({_id: igfsId}, params, {upsert: true}).exec() - .then(() => mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfsId}}, {multi: true}).exec()) - .then(() => mongo.Cluster.update({_id: {$nin: clusters}}, {$pull: {igfss: igfsId}}, {multi: true}).exec()) - .then(() => res.send(igfsId)); - } - - return (new mongo.Igfs(params)).save() - .then((igfs) => - mongo.Cluster.update({_id: {$in: clusters}}, {$addToSet: {igfss: igfs._id}}, {multi: true}).exec() - .then(() => res.send(igfs._id)) - ); - }) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Remove IGFS by ._id. - */ - router.post('/remove', (req, res) => { - const params = req.body; - const igfsId = params._id; - - mongo.Cluster.update({igfss: {$in: [igfsId]}}, {$pull: {igfss: igfsId}}, {multi: true}).exec() - .then(() => mongo.Igfs.remove(params).exec()) - .then(() => res.sendStatus(200)) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Remove all IGFSs. - */ - router.post('/remove/all', (req, res) => { - // Get owned space and all accessed space. - mongo.spaceIds(req.currentUserId(), req.header('IgniteDemoMode')) - .then((spaceIds) => - mongo.Cluster.update({space: {$in: spaceIds}}, {igfss: []}, {multi: true}).exec() - .then(() => mongo.Igfs.remove({space: {$in: spaceIds}}).exec()) - ) - .then(() => res.sendStatus(200)) - .catch((err) => mongo.handleError(res, err)); - }); - - factoryResolve(router); - }); -}; - http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/notebooks.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/notebooks.js b/modules/web-console/src/main/js/serve/routes/notebooks.js deleted file mode 100644 index 37665bf..0000000 --- a/modules/web-console/src/main/js/serve/routes/notebooks.js +++ /dev/null @@ -1,121 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'notebooks-routes', - inject: ['require(express)', 'mongo'] -}; - -module.exports.factory = function(express, mongo) { - return new Promise((factoryResolve) => { - const router = new express.Router(); - - /** - * Get notebooks names accessed for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/list', (req, res) => { - mongo.spaces(req.currentUserId()) - .then((spaces) => mongo.Notebook.find({space: {$in: spaces.map((value) => value._id)}}).select('_id name').sort('name').lean().exec()) - .then((notebooks) => res.json(notebooks)) - .catch((err) => mongo.handleError(res, err)); - - }); - - /** - * Get notebook accessed for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/get', (req, res) => { - mongo.spaces(req.currentUserId()) - .then((spaces) => mongo.Notebook.findOne({space: {$in: spaces.map((value) => value._id)}, _id: req.body.noteId}).lean().exec()) - .then((notebook) => res.json(notebook)) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Save notebook accessed for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/save', (req, res) => { - const note = req.body; - - mongo.Notebook.findOne({space: note.space, name: note.name}).exec() - .then((notebook) => { - const noteId = note._id; - - if (notebook && noteId !== notebook._id.toString()) - throw new Error('Notebook with name: "' + notebook.name + '" already exist.'); - - if (noteId) { - return mongo.Notebook.update({_id: noteId}, note, {upsert: true}).exec() - .then(() => res.send(noteId)) - .catch((err) => mongo.handleError(res, err)); - } - - return (new mongo.Notebook(req.body)).save(); - }) - .then((notebook) => res.send(notebook._id)) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Remove notebook by ._id. - * - * @param req Request. - * @param res Response. - */ - router.post('/remove', (req, res) => { - mongo.Notebook.remove(req.body).exec() - .then(() => res.sendStatus(200)) - .catch((err) => mongo.handleError(res, err)); - }); - - /** - * Create new notebook for user account. - * - * @param req Request. - * @param res Response. - */ - router.post('/new', (req, res) => { - mongo.spaceIds(req.currentUserId()) - .then((spaceIds) => - mongo.Notebook.findOne({space: spaceIds[0], name: req.body.name}) - .then((notebook) => { - if (notebook) - throw new Error('Notebook with name: "' + notebook.name + '" already exist.'); - - return spaceIds; - })) - .then((spaceIds) => (new mongo.Notebook({space: spaceIds[0], name: req.body.name})).save()) - .then((notebook) => res.send(notebook._id)) - .catch((err) => mongo.handleError(res, err)); - }); - - factoryResolve(router); - }); -}; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/profile.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/profile.js b/modules/web-console/src/main/js/serve/routes/profile.js deleted file mode 100644 index 5563a2b..0000000 --- a/modules/web-console/src/main/js/serve/routes/profile.js +++ /dev/null @@ -1,102 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'profile-routes', - inject: ['require(lodash)', 'require(express)', 'mongo', 'agent-manager'] -}; - -/** - * - * @param _ Lodash module - * @param express Express module - * @param mongo - * @param {AgentManager} agentMgr - * @returns {Promise} - */ -module.exports.factory = function(_, express, mongo, agentMgr) { - return new Promise((resolveFactory) => { - const router = new express.Router(); - - /** - * Save user profile. - */ - router.post('/save', (req, res) => { - const params = req.body; - - if (params.password && _.isEmpty(params.password)) - return res.status(500).send('Wrong value for new password!'); - - mongo.Account.findById(params._id).exec() - .then((user) => { - if (!params.password) - return Promise.resolve(user); - - return new Promise((resolve, reject) => { - user.setPassword(params.password, (err, _user) => { - if (err) - return reject(err); - - delete params.password; - - resolve(_user); - }); - }); - }) - .then((user) => { - if (!params.email || user.email === params.email) - return Promise.resolve(user); - - return new Promise((resolve, reject) => { - mongo.Account.findOne({email: params.email}, (err, _user) => { - // TODO send error to admin - if (err) - reject(new Error('Failed to check email!')); - - if (_user && _user._id !== user._id) - reject(new Error('User with this email already registered!')); - - resolve(user); - }); - }); - }) - .then((user) => { - if (params.token && user.token !== params.token) - agentMgr.close(user._id, user.token); - - _.extend(user, params); - - return user.save(); - }) - .then((user) => { - const becomeUsed = req.session.viewedUser && req.user.admin; - - if (becomeUsed) - req.session.viewedUser = user; - - res.sendStatus(200); - }) - .catch((err) => mongo.handleError(res, err)); - }); - - resolveFactory(router); - }); -}; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/public.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/public.js b/modules/web-console/src/main/js/serve/routes/public.js deleted file mode 100644 index 207289a..0000000 --- a/modules/web-console/src/main/js/serve/routes/public.js +++ /dev/null @@ -1,235 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'public-routes', - inject: ['require(express)', 'require(passport)', 'require(nodemailer)', 'settings', 'mail', 'mongo'] -}; - -module.exports.factory = function(express, passport, nodemailer, settings, mail, mongo) { - return new Promise((factoryResolve) => { - const router = new 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', (req, res) => { - const becomeUsed = req.session.viewedUser && req.user.admin; - - let user = req.user; - - if (becomeUsed) { - user = req.session.viewedUser; - - user.becomeUsed = true; - } - else if (user) - user = user.toJSON(); - else - return res.json(user); - - mongo.Space.findOne({owner: user._id, demo: true}).exec() - .then((demoSpace) => { - if (user && demoSpace) - user.demoCreated = true; - - res.json(user); - }) - .catch((err) => { - res.status(401).send(err.message); - }); - }); - - /** - * Register new account. - */ - router.post('/signup', (req, res) => { - mongo.Account.count().exec() - .then((cnt) => { - req.body.admin = cnt === 0; - - req.body.token = _randomString(); - - return new mongo.Account(req.body); - }) - .then((account) => { - return new Promise((resolve, reject) => { - mongo.Account.register(account, req.body.password, (err, _account) => { - if (err) - reject(err); - - if (!_account) - reject(new Error('Failed to create account.')); - - resolve(_account); - }); - }); - }) - .then((account) => new mongo.Space({name: 'Personal space', owner: account._id}).save() - .then(() => account) - ) - .then((account) => { - return new Promise((resolve, reject) => { - req.logIn(account, {}, (err) => { - if (err) - reject(err); - - resolve(account); - }); - }); - }) - .then((account) => { - res.sendStatus(200); - - account.resetPasswordToken = _randomString(); - - return account.save() - .then(() => { - const resetLink = `http://${req.headers.host}/password/reset?token=${account.resetPasswordToken}`; - - mail.send(account, `Thanks for signing up for ${settings.smtp.username}.`, - `Hello ${account.firstName} ${account.lastName}!<br><br>` + - `You are receiving this email because you have signed up to use <a href="http://${req.headers.host}">${settings.smtp.username}</a>.<br><br>` + - 'If you have not done the sign up and do not know what this email is about, please ignore it.<br>' + - 'You may reset the password by clicking on the following link, or paste this into your browser:<br><br>' + - `<a href="${resetLink}">${resetLink}</a>`); - }); - }) - .catch((err) => { - res.status(401).send(err.message); - }); - }); - - /** - * Sign in into exist account. - */ - router.post('/signin', (req, res, next) => { - passport.authenticate('local', (errAuth, user) => { - if (errAuth) - return res.status(401).send(errAuth.message); - - if (!user) - return res.status(401).send('Invalid email or password'); - - req.logIn(user, {}, (errLogIn) => { - if (errLogIn) - return res.status(401).send(errLogIn.message); - - return res.sendStatus(200); - }); - })(req, res, next); - }); - - /** - * Logout. - */ - router.post('/logout', (req, res) => { - req.logout(); - - res.sendStatus(200); - }); - - /** - * Send e-mail to user with reset token. - */ - router.post('/password/forgot', (req, res) => { - mongo.Account.findOne({email: req.body.email}).exec() - .then((user) => { - if (!user) - throw new Error('Account with that email address does not exists!'); - - user.resetPasswordToken = _randomString(); - - return user.save(); - }) - .then((user) => { - const resetLink = `http://${req.headers.host}/password/reset?token=${user.resetPasswordToken}`; - - mail.send(user, 'Password Reset', - `Hello ${user.firstName} ${user.lastName}!<br><br>` + - 'You are receiving this because you (or someone else) have requested the reset of the password for your account.<br><br>' + - 'Please click on the following link, or paste this into your browser to complete the process:<br><br>' + - `<a href="${resetLink}">${resetLink}</a><br><br>` + - 'If you did not request this, please ignore this email and your password will remain unchanged.', - 'Failed to send email with reset link!'); - }) - .then(() => res.status(200).send('An email has been sent with further instructions.')) - .catch((err) => { - // TODO IGNITE-843 Send email to admin - return res.status(401).send(err.message); - }); - }); - - /** - * Change password with given token. - */ - router.post('/password/reset', (req, res) => { - mongo.Account.findOne({resetPasswordToken: req.body.token}).exec() - .then((user) => { - if (!user) - throw new Error('Failed to find account with this token! Please check link from email.'); - - return new Promise((resolve, reject) => { - user.setPassword(req.body.password, (err, _user) => { - if (err) - return reject(new Error('Failed to reset password: ' + err.message)); - - _user.resetPasswordToken = undefined; // eslint-disable-line no-undefined - - resolve(_user.save()); - }); - }); - }) - .then((user) => mail.send(user, 'Your password has been changed', - `Hello ${user.firstName} ${user.lastName}!<br><br>` + - `This is a confirmation that the password for your account on <a href="http://${req.headers.host}">${settings.smtp.username}</a> has just been changed.<br><br>`, - 'Password was changed, but failed to send confirmation email!')) - .then((user) => res.status(200).send(user.email)) - .catch((err) => res.status(401).send(err.message)); - }); - - /* GET reset password page. */ - router.post('/password/validate/token', (req, res) => { - const token = req.body.token; - - mongo.Account.findOne({resetPasswordToken: token}).exec() - .then((user) => { - if (!user) - throw new Error('Invalid token for password reset!'); - - return res.json({token, email: user.email}); - }) - .catch((err) => res.status(401).send(err.message)); - }); - - factoryResolve(router); - }); -}; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/serve/routes/routes.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/routes/routes.js b/modules/web-console/src/main/js/serve/routes/routes.js deleted file mode 100644 index cbee8bb..0000000 --- a/modules/web-console/src/main/js/serve/routes/routes.js +++ /dev/null @@ -1,103 +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. - */ - -'use strict'; - -// Fire me up! - -module.exports = { - implements: 'routes', - inject: [ - 'public-routes', - 'admin-routes', - 'profile-routes', - 'demo-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, demoRoutes, - 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, profileRoutes); - app.use('/demo', _mustAuthenticated, demoRoutes); - - 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 (const name in pluginRoutes) { - if (pluginRoutes.hasOwnProperty(name)) - pluginRoutes[name].register(app, _mustAuthenticated, _adminOnly); - } - - // Catch 404 and forward to error handler. - app.use((req, res, next) => { - const err = new Error('Not Found: ' + req.originalUrl); - - err.status = 404; - - next(err); - }); - - // Production error handler: no stacktraces leaked to user. - app.use((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/6af6560a/modules/web-console/src/main/js/serve/settings.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/settings.js b/modules/web-console/src/main/js/serve/settings.js deleted file mode 100644 index 5b14bcc..0000000 --- a/modules/web-console/src/main/js/serve/settings.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. - */ - -'use strict'; - -// Fire me up! - -/** - * Module with server-side configuration. - */ -module.exports = { - implements: 'settings', - inject: ['require(nconf)', 'require(fs)'] -}; - -module.exports.factory = function(nconf, fs) { - nconf.file({file: './serve/config/settings.json'}); - - /** - * Normalize a port into a number, string, or false. - */ - const _normalizePort = function(val) { - const port = parseInt(val, 10); - - // named pipe - if (isNaN(port)) - return val; - - // port number - if (port >= 0) - return port; - - return false; - }; - - return { - agent: { - dists: 'serve/agent_dists', - port: _normalizePort(nconf.get('agent-server:port') || 3002), - legacyPort: _normalizePort(nconf.get('agent-server:legacyPort')), - 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') || 3000), - SSLOptions: nconf.get('server:ssl') && { - enable301Redirects: true, - trustXFPHeader: true, - 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'), - sign: nconf.get('smtp:sign'), - email: nconf.get('smtp:email'), - password: nconf.get('smtp:password'), - address: (username, email) => username ? '"' + username + '" <' + email + '>' : email - }, - mongoUrl: nconf.get('mongoDB:url') || 'mongodb://localhost/console', - cookieTTL: 3600000 * 24 * 30, - sessionSecret: 'keyboard cat', - tokenLength: 20 - }; -}; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/base.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/base.jade b/modules/web-console/src/main/js/views/base.jade deleted file mode 100644 index a910d1b..0000000 --- a/modules/web-console/src/main/js/views/base.jade +++ /dev/null @@ -1,22 +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. - -include includes/header - -.container.body-container - .main-content(ui-view='') - -include includes/footer http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/caches.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/caches.jade b/modules/web-console/src/main/js/views/configuration/caches.jade deleted file mode 100644 index a5b331f..0000000 --- a/modules/web-console/src/main/js/views/configuration/caches.jade +++ /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. - -include ../../app/helpers/jade/mixins.jade - -.docs-header - h1 Configure Ignite Caches -.docs-body(ng-controller='cachesController') - ignite-information - ul - li Configure #[a(href='https://apacheignite.readme.io/docs/data-grid' target='_blank') memory] settings - li Configure persistence - div(ignite-loading='loadingCachesScreen' ignite-loading-text='Loading caches...' ignite-loading-position='top') - div(ng-show='ui.ready') - hr - +main-table('caches', 'caches', 'cacheName', 'selectItem(row)', '{{$index + 1}}) {{row.label}}', 'label') - .padding-top-dflt(bs-affix) - .panel-tip-container(data-placement='bottom' bs-tooltip='' data-title='Create new cache') - button.btn.btn-primary(id='new-item' ng-click='createItem()') Add cache - +save-remove-clone-undo-buttons('cache') - hr - .bs-affix-fix - div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') - form.form-horizontal(name='ui.inputForm' ng-show='contentVisible()' novalidate) - .panel-group - ignite-configuration-caches-general - ignite-configuration-caches-memory - ignite-configuration-caches-query - ignite-configuration-caches-store - - +advanced-options-toggle-default - - div(ng-show='ui.expanded') - ignite-configuration-caches-concurrency - ignite-configuration-caches-rebalance - ignite-configuration-caches-server-near-cache - ignite-configuration-caches-statistics - - +advanced-options-toggle-default http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/clusters.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/clusters.jade b/modules/web-console/src/main/js/views/configuration/clusters.jade deleted file mode 100644 index 6450163..0000000 --- a/modules/web-console/src/main/js/views/configuration/clusters.jade +++ /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. - -include ../../app/helpers/jade/mixins.jade - -.docs-header - h1 Configure Ignite Clusters -.docs-body(ng-controller='clustersController') - 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 - div(ignite-loading='loadingClustersScreen' ignite-loading-text='Loading clusters...' ignite-loading-position='top') - div(ng-show='ui.ready') - hr - +main-table('clusters', 'clusters', 'clusterName', 'selectItem(row)', '{{$index + 1}}) {{row.label}}', 'label') - .padding-top-dflt(bs-affix) - .panel-tip-container(data-placement='bottom' bs-tooltip='' data-title='Create new cluster') - button.btn.btn-primary(id='new-item' ng-click='createItem()') Add cluster - +save-remove-clone-undo-buttons('cluster') - hr - .bs-affix-fix - div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') - form.form-horizontal(name='ui.inputForm' ng-show='contentVisible()' novalidate) - .panel-group - ignite-configuration-clusters-general - - +advanced-options-toggle-default - - div(ng-show='ui.expanded') - ignite-configuration-clusters-atomic - ignite-configuration-clusters-binary - ignite-configuration-clusters-collision - ignite-configuration-clusters-communication - ignite-configuration-clusters-connector - ignite-configuration-clusters-deployment - ignite-configuration-clusters-discovery - ignite-configuration-clusters-events - ignite-configuration-clusters-failover - ignite-configuration-clusters-igfs - ignite-configuration-clusters-logger - ignite-configuration-clusters-marshaller - ignite-configuration-clusters-metrics - ignite-configuration-clusters-ssl - ignite-configuration-clusters-swap - ignite-configuration-clusters-thread - ignite-configuration-clusters-time - ignite-configuration-clusters-transactions - ignite-configuration-user-attributes - - +advanced-options-toggle-default http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/domains-import.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/domains-import.jade b/modules/web-console/src/main/js/views/configuration/domains-import.jade deleted file mode 100644 index ccaeb27..0000000 --- a/modules/web-console/src/main/js/views/configuration/domains-import.jade +++ /dev/null @@ -1,211 +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. - -include ../../app/helpers/jade/mixins.jade - -mixin chk(mdl, change, tip) - input(type='checkbox' ng-model=mdl ng-change=change bs-tooltip='' data-title=tip data-trigger='hover' data-placement='top') - -mixin td-ellipses-lbl(w, lbl) - td.td-ellipsis(width='#{w}' style='min-width: #{w}; max-width: #{w}') - label #{lbl} - -.modal.modal-domain-import.center(role='dialog') - .modal-dialog.domains-import-dialog - .modal-content(ignite-loading='importDomainFromDb' ignite-loading-text='{{importDomain.loadingOptions.text}}') - #errors-container.modal-header.header - 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 - .modal-body - .import-domain-model-wizard-page(ng-if='importDomain.action == "drivers" && !importDomain.jdbcDriversNotFound') - .import-domain-model-wizard-page(ng-if='importDomain.action == "drivers" && importDomain.jdbcDriversNotFound') - | 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') - div(ng-if='demoConnection.db == "H2"') - label Demo description: - ul - li In-memory H2 database server will be started inside agent - li Database will be populated with sample tables - li You could test domain model generation with this demo database - li Click "Next" to continue - div(ng-if='demoConnection.db != "H2"') - label Demo could not be started - ul - li Agent failed to resolve H2 database jar - li Copy h2-x.x.x.jar 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') - form.form-horizontal(name='connectForm' novalidate) - .settings-row - label.col-xs-4.col-sm-2.col-md-2 Driver JAR: - .col-xs-8.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Select appropriate JAR with JDBC driver<br> To add another driver you need to place it into "/jdbc-drivers" folder of Ignite Web Agent<br> Refer to Ignite Web Agent README.txt for for more information') - .input-tip - button.select-toggle.form-control(id='jdbcDriverJar' bs-select data-container='.modal-domain-import' ng-model='ui.selectedJdbcDriverJar' ng-class='{placeholder: !(jdbcDriverJars && jdbcDriverJars.length > 0)}' placeholder='Choose JDBC driver' bs-options='item.value as item.label for item in jdbcDriverJars') - .settings-row - label.col-xs-4.col-sm-2.col-md-2 JDBC Driver: - .col-xs-8.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Fully qualified class name of JDBC driver that will be used to connect to database') - .input-tip - input.form-control(id='jdbcDriverClass' type='text' ng-model='selectedPreset.jdbcDriverClass' placeholder='JDBC driver fully qualified class name' required=true) - .settings-row - label.col-xs-4.col-sm-2.col-md-2 JDBC URL: - .col-xs-8.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='JDBC URL for connecting to database<br>Refer to your database documentation for details') - .input-tip - input.form-control(id='jdbcUrl' type='text' ng-model='selectedPreset.jdbcUrl' placeholder='JDBC URL' required=true) - .settings-row - label.col-xs-4.col-sm-2.col-md-2 User: - .col-xs-8.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='User name for connecting to database') - .input-tip - input.form-control(id='user' type='text' ng-model='selectedPreset.user') - .settings-row - label.col-xs-4.col-sm-2.col-md-2 Password: - .col-xs-8.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Password for connecting to database<br>Note, password would not be saved in preferences for security reasons') - .input-tip - input.form-control(id='password' type='password' ng-model='selectedPreset.password' ignite-on-enter='importDomainNext()') - .settings-row - .checkbox - label - input(id='tablesOnly' type='checkbox' ng-model='selectedPreset.tablesOnly') - | Tables only - i.tipLabel.fa.fa-question-circle(bs-tooltip='' data-title='If selected, then only tables metadata will be parsed<br>Otherwise table and view metadata will be parsed') - .import-domain-model-wizard-page(ng-show='importDomain.action == "schemas"') - table.table.metadata(st-table='importDomain.displayedSchemas' st-safe-src='importDomain.schemas') - thead - tr - th.header(colspan='2') - .col-sm-4.pull-right(style='margin-bottom: 5px') - input.form-control(type='text' st-search='name' placeholder='Filter schemas...' ng-model='importDomain.displayedSchemasFilter' ng-change='selectSchema()') - tr - th(width='30px') - +chk('importDomain.allSchemasSelected', 'selectAllSchemas()', 'Select all schemas') - th - label Schema - tbody - tr - td(colspan='2') - .scrollable-y(style='height: 213px') - table.table-modal-striped(id='importSchemasData') - tbody - tr(ng-repeat='schema in importDomain.displayedSchemas') - td(width='30px') - input(type='checkbox' ng-model='schema.use' ng-change='selectSchema()') - td - label {{schema.name}} - .import-domain-model-wizard-page(ng-show='importDomain.action == "tables"') - table.table.metadata(st-table='importDomain.displayedTables' st-safe-src='importDomain.tables') - thead - tr - th.header(colspan='6') - .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') - +chk('importDomain.allTablesSelected', 'selectAllTables()', 'Select all tables') - th(width='130px') - label Schema - th(width='160px') - label Table name - th(colspan=2 width='288px') - label Cache - th - tbody - tr - td(colspan='6') - .scrollable-y(style='height: 143px') - table.table-modal-striped(id='importTableData') - tbody - tr(ng-repeat='table in importDomain.displayedTables track by $index') - td(width='30px' style='min-width: 30px; max-width: 30px') - input(type='checkbox' ng-model='table.use' ng-change='selectTable()') - +td-ellipses-lbl('130px', '{{table.schema}}') - +td-ellipses-lbl('160px', '{{table.tbl}}') - td(colspan='2' width='288px' style='min-width: 160px; max-width: 160px') - div.td-ellipsis - a(ng-if='!table.edit' ng-click='startEditDbTableCache(table)') {{tableActionView(table)}} - div(style='display: flex' ng-if='table.edit') - button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' data-container='.modal-domain-import' bs-options='item.value as item.shortLabel for item in importActions') - button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in table.cachesOrTemplates') - td - .settings-row - label Defaults to be applied for filtered tables - i.tipLabel.fa.fa-question-circle(bs-tooltip='' data-title='Select and apply options for caches generation') - .settings-row - .col-sm-11 - .col-sm-6(style='padding-right: 5px') - button.select-toggle.form-control(bs-select ng-model='importCommon.action' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importActions') - .col-sm-6(style='padding-left: 5px; padding-right: 5px') - button.select-toggle.form-control(bs-select ng-model='importCommon.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importCommon.cachesOrTemplates') - .col-sm-1(style='padding-left: 5px') - button.btn.btn-primary(ng-click='applyDefaults()') Apply - .import-domain-model-wizard-page(ng-show='importDomain.action == "options"') - form.form-horizontal(name='optionsForm' novalidate) - .settings-row - .col-xs-3.col-sm-2.col-md-2.required - label.required Package: - .col-xs-9.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Package that will be used for POJOs generation') - .input-tip - ignite-form-field-input-text( - data-id='domainPackageName' - data-name='domainPackageName' - data-ng-model='ui.packageName' - data-ignite-label-name='Package' - data-ng-required='true' - data-placeholder='Enter package name' - data-java-keywords='true' - data-java-package-name='package-only' - ng-model-options='{allowInvalid: true}' - ) - +error-feedback('optionsForm.$error.javaPackageName', 'javaPackageName', 'Package name is invalid') - +error-feedback('optionsForm.$error.javaKeywords', 'javaKeywords', 'Package name could not contains reserved java keyword') - .settings-row - .checkbox - label - input(id='domainBuiltinKeys' type='checkbox' ng-model='ui.builtinKeys') - | Use Java built-in types for keys - i.tipLabel.fa.fa-question-circle(bs-tooltip='' data-title='Use Java built-in types like "Integer", "Long", "String" instead of POJO generation in case when table primary key contains only one field') - .settings-row - .checkbox - label - input(id='domainUsePrimitives' type='checkbox' ng-model='ui.usePrimitives') - | Use primitive types for NOT NULL table columns - i.tipLabel.fa.fa-question-circle(bs-tooltip='' data-title='Use primitive types like "int", "long", "double" for POJOs fields generation in case of NOT NULL columns') - .settings-row - .checkbox - label - input(id='domainGenerateAliases' type='checkbox' ng-model='ui.generateAliases') - | Generate aliases for query fields - i.tipLabel.fa.fa-question-circle(bs-tooltip='' data-title='Generate aliases for query fields with names from database fields') - .settings-row - .col-xs-3.col-sm-2.col-md-2.required - label Clusters: - .col-xs-9.col-sm-10.col-md-10 - i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Choose clusters that will be associated with generated caches') - .input-tip - button.select-toggle.form-control(id='generatedCachesClusters' bs-select ng-model='ui.generatedCachesClusters' ng-class='{placeholder: !(ui.generatedCachesClusters && ui.generatedCachesClusters.length > 0)}' data-container='.modal-domain-import' data-multiple='1' placeholder='Choose clusters for generated caches' bs-options='item.value as item.label for item in clusters') - .modal-footer - label(ng-hide='importDomain.action == "drivers" || (importDomain.action == "connect" && importDomain.demo)').labelField {{importDomain.info}} - a.btn.btn-primary(ng-hide='importDomain.action == "drivers" || importDomain.action == "connect"' ng-click='importDomainPrev()' bs-tooltip='' data-title='{{prevTooltipText()}}' data-placement='bottom') Prev - a.btn.btn-primary(ng-click='importDomainNext()' ng-disabled='!importDomainNextAvailable()' bs-tooltip='' data-title='{{nextTooltipText()}}' data-placement='bottom') {{importDomain.button}} http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/domains.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/domains.jade b/modules/web-console/src/main/js/views/configuration/domains.jade deleted file mode 100644 index 7f3253e..0000000 --- a/modules/web-console/src/main/js/views/configuration/domains.jade +++ /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. - -include ../../app/helpers/jade/mixins.jade - -.docs-header - h1 Configure Domain Model And SQL Queries -.docs-body(ng-controller='domainsController') - ignite-information - ul: li Import database schemas - li Configure indexed types - div(ignite-loading='loadingDomainModelsScreen' ignite-loading-text='Loading domain models...' ignite-loading-position='top') - div(ng-show='ui.ready') - hr - .padding-bottom-dflt(ng-show='domains && domains.length > 0') - table.links(st-table='displayedRows' st-safe-src='domains') - thead - tr - th - .col-sm-9 - .col-sm-6 - lable.labelHeader.labelFormField {{domainModelTitle()}} - .col-sm-6 - .pull-right.labelLogin.additional-filter(ng-if='(domains | domainsValidation:false:true).length > 0') - a.labelFormField(ng-if='ui.showValid' ng-click='toggleValid()' bs-tooltip='' data-title='{{::ui.invalidKeyFieldsTooltip}}') Key fields should be configured: {{(displayedRows | domainsValidation:false:true).length}}  - a.labelFormField(ng-if='!ui.showValid' ng-click='toggleValid()') Show all domain models: {{displayedRows.length}}  - .col-sm-3 - input.form-control.pull-right(type='text' st-search='valueType' placeholder='Filter domain models...') - tbody - tr - td - .scrollable-y(ng-show='(displayedRows | domainsValidation:ui.showValid:true).length > 0' style='max-height: 200px') - table - tbody - tr(ng-repeat='row in (displayedRows | domainsValidation:ui.showValid:true) track by row._id' ignite-bs-affix-update) - td - a(ng-class='{active: row._id == selectedItem._id}' ng-click='selectItem(row)') {{$index + 1}}) {{row.valueType}} - label.placeholder(ng-show='(displayedRows | domainsValidation:ui.showValid:true).length == 0') No domain models found - .padding-top-dflt(bs-affix) - .panel-tip-container(data-placement='bottom' bs-tooltip='' data-title='Create new domain model') - button.btn.btn-primary(id='new-item' ng-click='createItem()') Add domain model - .panel-tip-container(bs-tooltip='' data-title='Import domain models from database' data-placement='bottom') - button.btn.btn-primary(ng-click='showImportDomainModal()') Import from database - +save-remove-clone-undo-buttons('domain model') - .btn-group.panel-tip-container.pull-right(bs-tooltip='' data-title='Import domain models from demo database' data-placement='bottom') - hr - .bs-affix-fix - div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') - form.form-horizontal(name='ui.inputForm' ng-show='contentVisible()' novalidate) - .panel-group - ignite-configuration-domains-general - ignite-configuration-domains-query - ignite-configuration-domains-store http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/igfs.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/igfs.jade b/modules/web-console/src/main/js/views/configuration/igfs.jade deleted file mode 100644 index b889a97..0000000 --- a/modules/web-console/src/main/js/views/configuration/igfs.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. - -include ../../app/helpers/jade/mixins.jade - -.docs-header - h1 Configure Ignite In-memory File Systems -.docs-body(ng-controller='igfsController') - ignite-information(data-title='Configure IGFS only if you are going to use In-memory File System') - ul - li Ignite File System (#[a(href='https://apacheignite-fs.readme.io/docs/in-memory-file-system' target='_blank') IGFS]) is an in-memory file system allowing work with files and directories over existing cache infrastructure - li IGFS can either work as purely in-memory file system, or delegate to another file system (e.g. various Hadoop file system implementations) acting as a caching layer (see #[a(href='https://apacheignite-fs.readme.io/docs/secondary-file-system' target='_blank') secondary file system] for more detail) - li In addition IGFS provides API to execute map-reduce tasks over file system data - div(ignite-loading='loadingIgfsScreen' ignite-loading-text='Loading IGFS screen...' ignite-loading-position='top') - div(ng-show='ui.ready') - hr - +main-table('IGFS', 'igfss', 'igfsName', 'selectItem(row)', '{{$index + 1}}) {{row.name}}', 'name') - .padding-top-dflt(bs-affix) - .panel-tip-container(data-placement='bottom' bs-tooltip='' data-title='Create new IGFS') - button.btn.btn-primary(id='new-item' ng-click='createItem()') Add IGFS - +save-remove-clone-undo-buttons('IGFS') - hr - .bs-affix-fix - div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') - form.form-horizontal(name='ui.inputForm' ng-show='contentVisible()' novalidate) - .panel-group - ignite-configuration-igfs-general - - +advanced-options-toggle-default - - div(ng-show='ui.expanded') - ignite-configuration-igfs-secondary - ignite-configuration-igfs-ipc - ignite-configuration-igfs-fragmentizer - ignite-configuration-igfs-dual - ignite-configuration-igfs-misc - - +advanced-options-toggle-default http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/sidebar.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/sidebar.jade b/modules/web-console/src/main/js/views/configuration/sidebar.jade deleted file mode 100644 index bba6b25..0000000 --- a/modules/web-console/src/main/js/views/configuration/sidebar.jade +++ /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. - -.row - .col-xs-3.col-sm-3.col-md-2.border-right.section-left.greedy - .sidebar-nav(bs-affix) - ul.menu(ignite-sidebar) - li(ng-repeat='item in sidebar.items') - a(ui-sref-active='active' ui-sref='{{::item.sref}}') - span.fa-stack - i.fa.fa-circle-thin.fa-stack-2x - i.fa.fa-stack-1x {{::$index + 1}} - | {{::item.text}} - - .col-xs-9.col-sm-9.col-md-10.border-left.section-right - .docs-content(ui-view='') http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/views/configuration/summary-project-structure.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/summary-project-structure.jade b/modules/web-console/src/main/js/views/configuration/summary-project-structure.jade deleted file mode 100644 index aa09437..0000000 --- a/modules/web-console/src/main/js/views/configuration/summary-project-structure.jade +++ /dev/null @@ -1,27 +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. -.popover.summary-project-structure - h3.popover-title - label.labelField Project structure - button.close(id='summary-project-structure-close' ng-click='$hide()') × - .popover-content - treecontrol.tree-classic(tree-model='projectStructure' options='projectStructureOptions' expanded-nodes='projectStructureExpanded') - span(ng-switch='' on='node.type') - span(ng-switch-when='folder') - label {{node.name}} - span(ng-switch-when='file') - i.fa.fa-file-text-o - label {{node.name}}
