From 0443be52b4f3c4475aa3308bbe410b5a3f6d9ea3 Mon Sep 17 00:00:00 2001 From: sipp11 Date: Thu, 20 Aug 2015 05:05:30 +0700 Subject: [PATCH] jarvis implementation --- api/controllers/FlagController.js | 1 + api/controllers/ObjReferenceController.js | 11 +++++++++++ api/controllers/ObjRevisionController.js | 11 +++++++++++ api/controllers/UserActivityController.js | 11 +++++++++++ api/models/ObjReference.js | 14 ++++++++++++++ api/models/ObjRevision.js | 14 ++++++++++++++ api/models/UserActivity.js | 14 ++++++++++++++ config/bootstrap.js | 1 + config/connections.js | 13 ++++++++++--- config/env/development.js | 3 ++- config/env/production.js | 1 + config/env/production/connections.js | 12 ++++++++++-- views/homepage.ejs | 2 +- 13 files changed, 101 insertions(+), 7 deletions(-) create mode 100644 api/controllers/ObjReferenceController.js create mode 100644 api/controllers/ObjRevisionController.js create mode 100644 api/controllers/UserActivityController.js create mode 100644 api/models/ObjReference.js create mode 100644 api/models/ObjRevision.js create mode 100644 api/models/UserActivity.js diff --git a/api/controllers/FlagController.js b/api/controllers/FlagController.js index db10fa7..d3d2073 100644 --- a/api/controllers/FlagController.js +++ b/api/controllers/FlagController.js @@ -17,6 +17,7 @@ module.exports = { or: [ {english: {contains: word}}, {thai: {contains: word}}, + {iso2: word}, ] }, sort: { diff --git a/api/controllers/ObjReferenceController.js b/api/controllers/ObjReferenceController.js new file mode 100644 index 0000000..64bb4b2 --- /dev/null +++ b/api/controllers/ObjReferenceController.js @@ -0,0 +1,11 @@ +/** + * ObjReferenceController + * + * @description :: Server-side logic for managing objreferences + * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers + */ + +module.exports = { + +}; + diff --git a/api/controllers/ObjRevisionController.js b/api/controllers/ObjRevisionController.js new file mode 100644 index 0000000..98dc699 --- /dev/null +++ b/api/controllers/ObjRevisionController.js @@ -0,0 +1,11 @@ +/** + * ObjRevisionController + * + * @description :: Server-side logic for managing objrevisions + * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers + */ + +module.exports = { + +}; + diff --git a/api/controllers/UserActivityController.js b/api/controllers/UserActivityController.js new file mode 100644 index 0000000..30a8642 --- /dev/null +++ b/api/controllers/UserActivityController.js @@ -0,0 +1,11 @@ +/** + * UserActivityController + * + * @description :: Server-side logic for managing useractivities + * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers + */ + +module.exports = { + +}; + diff --git a/api/models/ObjReference.js b/api/models/ObjReference.js new file mode 100644 index 0000000..26fe866 --- /dev/null +++ b/api/models/ObjReference.js @@ -0,0 +1,14 @@ +/** +* ObjReference.js +* +* @description :: TODO: You might write a short summary of how this model works and what it represents here. +* @docs :: http://sailsjs.org/#!documentation/models +*/ + +module.exports = { + connection: 'jarvisBlackboard', + attributes: { + + } +}; + diff --git a/api/models/ObjRevision.js b/api/models/ObjRevision.js new file mode 100644 index 0000000..6d0dddc --- /dev/null +++ b/api/models/ObjRevision.js @@ -0,0 +1,14 @@ +/** +* ObjRevision.js +* +* @description :: TODO: You might write a short summary of how this model works and what it represents here. +* @docs :: http://sailsjs.org/#!documentation/models +*/ + +module.exports = { + connection: 'jarvisBlackboard', + attributes: { + + } +}; + diff --git a/api/models/UserActivity.js b/api/models/UserActivity.js new file mode 100644 index 0000000..85d4f51 --- /dev/null +++ b/api/models/UserActivity.js @@ -0,0 +1,14 @@ +/** +* UserActivity.js +* +* @description :: TODO: You might write a short summary of how this model works and what it represents here. +* @docs :: http://sailsjs.org/#!documentation/models +*/ + +module.exports = { + connection: 'jarvisBlackboard', + attributes: { + + } +}; + diff --git a/config/bootstrap.js b/config/bootstrap.js index 96208a1..73c8608 100644 --- a/config/bootstrap.js +++ b/config/bootstrap.js @@ -13,5 +13,6 @@ module.exports.bootstrap = function(cb) { // It's very important to trigger this callback method when you are finished // with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap) + sails.hooks.http.app.set('trust proxy', true); cb(); }; diff --git a/config/connections.js b/config/connections.js index 4d01565..ab998e1 100644 --- a/config/connections.js +++ b/config/connections.js @@ -59,13 +59,20 @@ module.exports.connections = { hackintoshMongo: { adapter: 'sails-mongo', - host: '10hackintosh.vnll', + host: '10hackintosh', port: 27017, // user: 'username', // password: 'password', - database: 'feeder', + database: 'sails', + }, + jarvisBlackboard: { + adapter: 'sails-mongo', + host: '10hackintosh', + port: 27017, + // user: 'username', + // password: 'password', + database: 'jarvis-bb', }, - /*************************************************************************** * * * PostgreSQL is another officially supported relational database. * diff --git a/config/env/development.js b/config/env/development.js index aa48a95..cd7f81d 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -18,7 +18,8 @@ module.exports = { ***************************************************************************/ models: { - connection: 'hackintoshMongo' + connection: 'jarvisBlackboard', + connection: 'hackintoshMongo', } }; diff --git a/config/env/production.js b/config/env/production.js index b07275e..e1aab85 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -18,6 +18,7 @@ module.exports = { ***************************************************************************/ models: { + connection: 'jarvisBlackboard', connection: 'nj2mongo' }, diff --git a/config/env/production/connections.js b/config/env/production/connections.js index a4d1479..bc8e965 100644 --- a/config/env/production/connections.js +++ b/config/env/production/connections.js @@ -1,12 +1,20 @@ module.exports.connections = { - njMongo: { + nj2mongo: { adapter: 'sails-mongo', host: 'nj2', port: 27017, // user: 'username', // password: 'password', database: 'bbSailer', - } + }, + jarvisBlackboard: { + adapter: 'sails-mongo', + host: 'nj2', + port: 27017, + // user: 'username', + // password: 'password', + database: 'jarvis-bb', + }, }; diff --git a/views/homepage.ejs b/views/homepage.ejs index 99e6639..1b96393 100644 --- a/views/homepage.ejs +++ b/views/homepage.ejs @@ -13,7 +13,7 @@ setTimeout(function sunrise () {

<%= __('A brand new app.') %>

-

You're looking at: <%= view.pathFromApp + '.' +view.ext %>

+

You're looking at: <%= view.pathFromApp + '.' +view.ext %> <%= req.ip %>