Commit 29887a39 by Arturo Montejo Ráez

Merge branch 'develop' of http://gitlab.ujaen.es/yotta/pictogram into develop

parents e2cd9219 f0cb0996
@reboot /home/ubuntu/pictogram/sails/bootstrap.sh @reboot /home/ubuntu/pictogram/sails/bootstrap.sh
# Let's encrypt certs autorenew # Let's encrypt certs autorenew
@monthly /home/ubuntu/cron/renewcerts.sh @monthly /home/ubuntu/pictogram/sails/cron/renewcerts.sh
# AWS Volume backups # AWS Volume backups
@daily /home/ubuntu/cron/aws-missing-tools/ec2-automate-backup/ec2-automate-backup.sh -c /home/ubuntu/cron/cron-primer.sh -v vol-0cd5c496 -k 30 -p -u -r "eu-central-1" #@daily /home/ubuntu/pictogram/sails/cron/aws-missing-tools/ec2-automate-backup/ec2-automate-backup.sh -c /home/ubuntu/pictogram/sails/cron/cron-primer.sh -v vol-0cd5c496 -k 30 -p -u -r "eu-central-1"
# Log rotation
@daily /usr/sbin/logrotate /home/ubuntu/pictogram/sails/cron/logrotate.conf
/home/ubuntu/pictogram/sails/logs/error.json /home/ubuntu/pictogram/sails/logs/debug.json /home/ubuntu/pictogram/sails/logs/silly.json /home/ubuntu/pictogram/sails/logs/info.json {
size 4M
rotate 7
dateext
mail amontejo@ujaen.es
compress
create 700 ubuntu ubuntu
postrotate
/home/ubuntu/pictogram/sails/cron/report.sh
endscript
}
...@@ -572,17 +572,12 @@ module.exports = { ...@@ -572,17 +572,12 @@ module.exports = {
}, },
/* /*
* Updates legend in student pictos * Updates legend in all student pictos for one id_grid
* legend is not updated for categories
*/ */
update_legend: function(id_grid, legend_value, cb) { update_legend: function(id_grid, legend_value, cb) {
var query='UPDATE stu_picto' + var query='UPDATE stu_picto' +
' SET attributes = json_set(attributes, \'$.legend\',\''+legend_value+'\')' + ' SET attributes = json_set(attributes, \'$.legend\',\''+legend_value+'\')' +
' WHERE id_grid=' + id_grid + ' AND ' + ' WHERE id_grid=' + id_grid + ';'
' (json_extract(attributes, \'$.id_cat\') LIKE \'null\' AND ' +
' json_extract(attributes, \'$.coord_y\') = 0 OR ' +
' json_extract(attributes, \'$.id_cat\') NOT LIKE \'null\' AND ' +
' json_extract(attributes, \'$.coord_y\') >= 0);'
; ;
StuPicto.query(query, function(err, result) { StuPicto.query(query, function(err, result) {
......
...@@ -25,10 +25,10 @@ if(clientBrowser[0] == "Chrome" && parseInt(clientBrowser[1]) >= 45 ) ...@@ -25,10 +25,10 @@ if(clientBrowser[0] == "Chrome" && parseInt(clientBrowser[1]) >= 45 )
validBrowser = true; validBrowser = true;
if(clientBrowser[0] == "Opera" && parseInt(clientBrowser[1]) >= 35 ) if(clientBrowser[0] == "Opera" && parseInt(clientBrowser[1]) >= 35 )
validBrowser = true; validBrowser = true;
if(clientBrowser[0] == "Edge" )
validBrowser = true;
if(clientBrowser[0] == "Safari" && parseInt(clientBrowser[1]) >= 10 ) if(clientBrowser[0] == "Safari" && parseInt(clientBrowser[1]) >= 10 )
validBrowser = true; validBrowser = true;
/*if(clientBrowser[0] == "Edge" )
validBrowser = true;*/
// Redirect to view // Redirect to view
if(!validBrowser) window.location = "browserNotCompatible.html"; if(!validBrowser) window.location = "browserNotCompatible.html";
...@@ -147,14 +147,13 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -147,14 +147,13 @@ dashboardControllers.controller('AddPictoCtrl', function (
// Load pictos owned by the actual supervisor // Load pictos owned by the actual supervisor
// //
$scope.load_own_pictos = function () { $scope.load_own_pictos = function () {
$scope.pictos = [];
$scope.source = 'ownpictos'; $scope.source = 'ownpictos';
$http.get(config.backend + '/sup/' + supervisor.id + '/pictos') $http.get(config.backend + '/sup/' + supervisor.id + '/pictos')
.success(function (data) { .success(function (data) {
if (data) { if (data) {
$scope.pictos = data; $scope.pictos = data;
} else {
$scope.pictos = [];
} }
}) })
.error(function () { .error(function () {
......
...@@ -150,7 +150,6 @@ ...@@ -150,7 +150,6 @@
<div class="form-group"> <div class="form-group">
<label translate>gender</label> <label translate>gender</label>
<select class="form-control" name="student_gender" id="student_gender" ng-model="formUser.gender" required> <select class="form-control" name="student_gender" id="student_gender" ng-model="formUser.gender" required>
<option value=" " disabled></option>
<option value="F" translate>woman</option> <option value="F" translate>woman</option>
<option value="M" translate>man</option> <option value="M" translate>man</option>
</select> </select>
......
...@@ -34,7 +34,7 @@ module.exports.http = { ...@@ -34,7 +34,7 @@ module.exports.http = {
* * * *
***************************************************************************/ ***************************************************************************/
order: ['timeout'] order: ['timeout'],
// 'startRequestTimer', // 'startRequestTimer',
// 'cookieParser', // 'cookieParser',
// 'session', // 'session',
...@@ -59,10 +59,12 @@ module.exports.http = { ...@@ -59,10 +59,12 @@ module.exports.http = {
* * * *
****************************************************************************/ ****************************************************************************/
// myRequestLogger: function (req, res, next) { myRequestLogger: function (req, res, next) {
// console.log("Requested :: ", req.method, req.url); res.on("finish", function() {
// return next(); sails.log.info(req.method, req.url, res.statusCode, req.allParams());
// } });
return next();
},
......
...@@ -55,6 +55,19 @@ customLogger.add(winston.transports.File, { ...@@ -55,6 +55,19 @@ customLogger.add(winston.transports.File, {
filename: path.resolve(__dirname, '../..', 'logs', 'error.json') filename: path.resolve(__dirname, '../..', 'logs', 'error.json')
}); });
customLogger.add(winston.transports.File, {
name: 'info-json',
silent: false,
colorize: false,
level: 'info',
showLevel: true,
timestamp: true,
json: true,
tailable: true,
maxsize: 20 * 1024 * 1024, // 20 MegaByte
filename: path.resolve(__dirname, '../..', 'logs', 'info.json')
});
module.exports.log = { module.exports.log = {
level: 'silly', level: 'silly',
inspect: false, inspect: false,
......
...@@ -20,6 +20,13 @@ ...@@ -20,6 +20,13 @@
* http://sailsjs.org/#/documentation/concepts/Routes/RouteTargetSyntax.html * http://sailsjs.org/#/documentation/concepts/Routes/RouteTargetSyntax.html
*/ */
module.exports.routes = { module.exports.routes = {
// This is to log to info every access
// '/*': function(req, res, next) {
// sails.log.info(req.method, req.url, req.allParams());
// next();
// },
// Grouped by API url (/a, /b, ...) // Grouped by API url (/a, /b, ...)
// Sorted by HTTP method (GET, PUT, POST and DELETE) // Sorted by HTTP method (GET, PUT, POST and DELETE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment