mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Latest changes
This commit is contained in:
@ -201,13 +201,13 @@ function filterClientsByFrequency(month, frequency) {
|
|||||||
|
|
||||||
Object.keys(client.frequencies).forEach(function(frequencyName) {
|
Object.keys(client.frequencies).forEach(function(frequencyName) {
|
||||||
var monthData = client.frequencies[frequencyName];
|
var monthData = client.frequencies[frequencyName];
|
||||||
if (monthData[month] || month === undefined) {
|
|
||||||
|
if (month ? monthData[month] : _.some(monthData, Boolean)) {
|
||||||
if (!frequency || frequency == frequencyName) {
|
if (!frequency || frequency == frequencyName) {
|
||||||
enabledFrequencies.push(frequencyName);
|
enabledFrequencies.push(frequencyName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (enabledFrequencies.length > 0) {
|
if (enabledFrequencies.length > 0) {
|
||||||
client.frequencies = enabledFrequencies;
|
client.frequencies = enabledFrequencies;
|
||||||
results.push(client);
|
results.push(client);
|
||||||
|
@ -23,6 +23,13 @@ module.exports = function(app, auth, piler, calendar, directory, config) {
|
|||||||
piler.addJsFile("/js/filters.js");
|
piler.addJsFile("/js/filters.js");
|
||||||
piler.addJsFile("/js/services.js");
|
piler.addJsFile("/js/services.js");
|
||||||
|
|
||||||
|
app.get('/crash', function(req, res) {
|
||||||
|
console.log('Commiting Suicide for Science!');
|
||||||
|
process.nextTick(function() {
|
||||||
|
throw new Error("Ermergerd!");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
app.all('/api/*', auth.requiresApiAccess);
|
app.all('/api/*', auth.requiresApiAccess);
|
||||||
|
|
||||||
var posts = require('../app/controllers/posts');
|
var posts = require('../app/controllers/posts');
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<option value="Sterilizer - TT">Sterilizer - TT</option>
|
<option value="Sterilizer - TT">Sterilizer - TT</option>
|
||||||
<option value="Vaporizer">Vaporizer</option>
|
<option value="Vaporizer">Vaporizer</option>
|
||||||
<option value="Waste Management System">Waste Management System</option>
|
<option value="Waste Management System">Waste Management System</option>
|
||||||
|
<option value="legacy">legacy</option>
|
||||||
<select>
|
<select>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<span class="toolbelt-text">Month:</span>
|
<span class="toolbelt-text">Month:</span>
|
||||||
@ -63,7 +64,7 @@
|
|||||||
<tr ng-show="loading"><td colspan="3" class="table-loading"><i class="loader"></i></td></tr>
|
<tr ng-show="loading"><td colspan="3" class="table-loading"><i class="loader"></i></td></tr>
|
||||||
<tr ng-hide="loading || pms.length"><td colspan="3" class="table-message">There is no information to display.</td></tr>
|
<tr ng-hide="loading || pms.length"><td colspan="3" class="table-message">There is no information to display.</td></tr>
|
||||||
<tr ng-hide="loading" ng-repeat="pm in pms | orderBy : sort.column : sort.descending">
|
<tr ng-hide="loading" ng-repeat="pm in pms | orderBy : sort.column : sort.descending">
|
||||||
<td>{{pm.name}} ({{pm.identifier | uppercase}})</td>
|
<td><a href="/clients/{{pm._id}}">{{pm.name}} ({{pm.identifier | uppercase}})</a></td>
|
||||||
<td>{{pm.contacts[0].name}}</td>
|
<td>{{pm.contacts[0].name}}</td>
|
||||||
<td>{{pm.contacts[0].phone}}</td>
|
<td>{{pm.contacts[0].phone}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
36
server.js
36
server.js
@ -73,5 +73,37 @@ require('./config/routes')(app, auth, piler, calendar, directory, config);
|
|||||||
GLOBAL.health = 'OK'
|
GLOBAL.health = 'OK'
|
||||||
|
|
||||||
var port = process.env.PORT || 9000
|
var port = process.env.PORT || 9000
|
||||||
server.listen(port)
|
|
||||||
console.log('Express app started on port ' + port)
|
server.on('error', function(e) {
|
||||||
|
if (e.code == 'EADDRINUSE') {
|
||||||
|
console.log('Address in use, retrying...');
|
||||||
|
setTimeout(function() {
|
||||||
|
server.close();
|
||||||
|
server.listen(port, onListen);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
server.listen(port, onListen);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function onListen() {
|
||||||
|
var p = new pushover({
|
||||||
|
user: 'aJmPD4KigO0vLwim76n3WqWKwbKA3k',
|
||||||
|
token: 'YxspDLz3WinbPmwBThuZXCME9QmkDb'
|
||||||
|
});
|
||||||
|
|
||||||
|
var message = {
|
||||||
|
title: 'Portal is running',
|
||||||
|
message: 'Process was reset on ' + new Date(),
|
||||||
|
sound: 'bugle'
|
||||||
|
};
|
||||||
|
p.send(message, function(err, result) {
|
||||||
|
if (err) {
|
||||||
|
log.emergency('Error while sending pushover notification');
|
||||||
|
log.emergency(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
3
start_this_bitch.sh
Executable file
3
start_this_bitch.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
NODE_ENV='prod' node/bin/node launcher.js >> server.log
|
Reference in New Issue
Block a user