-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All node data CSV export & other fixes/improves
Export all node data (csv) Add "excel timestamp" columns in CSV exports Datepicker support for export date range popup Settings description + tooltips Settings page listview trigger create bug fix Moved "Restart App" in main menu Moved "Uptime" status after main menu Added _example.js event override sample fixed README.md titles Fixed AM/PM bug in SMS messages Updated exports.timeoutOffset Setup script mkdir /data/db so pi would chown it
- Loading branch information
1 parent
8dc5e1c
commit 52bcc24
Showing
8 changed files
with
216 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ global.sendEmail = function(SUBJECT, BODY) { | |
|
||
global.sendSMS = function(SUBJECT, BODY) { | ||
var mailOptions = { | ||
from: 'Moteino Gateway <[email protected]>', | ||
from: 'Gateway <[email protected]>', | ||
to: settings.credentials.smsAlertsTo.value, //your mobile carrier should have an email address that will generate a SMS to your phone | ||
subject: SUBJECT, | ||
text: BODY | ||
|
@@ -297,7 +297,7 @@ io.sockets.on('connection', function (socket) { | |
if (entries.length == 1) | ||
{ | ||
var dbNode = entries[0]; | ||
Object.keys(dbNode.metrics).forEach(function(mKey,index) { | ||
Object.keys(dbNode.metrics).forEach(function(mKey,index) { //syncronous/blocking call | ||
if (dbNode.metrics[mKey].graph == 1) | ||
dbLog.removeMetricLog(path.join(__dirname, dbDir, dbLog.getLogName(dbNode._id, mKey))); | ||
}); | ||
|
@@ -405,7 +405,29 @@ io.sockets.on('connection', function (socket) { | |
else | ||
socket.emit('GRAPHDATAREADY', { graphData:graphData, options : graphOptions }); | ||
}); | ||
|
||
|
||
socket.on('EXPORTNODELOGSCSV', function (nodeId, start, end, howManyPoints) { | ||
var sts = Math.floor(start / 1000); //get timestamp in whole seconds | ||
var ets = Math.floor(end / 1000); //get timestamp in whole seconds | ||
var sets = []; | ||
|
||
db.find({ _id : nodeId }, function (err, entries) { | ||
if (entries.length == 1) | ||
{ | ||
var dbNode = entries[0]; | ||
Object.keys(dbNode.metrics).forEach(function(mKey,index) { //syncronous/blocking call | ||
if (dbNode.metrics[mKey].graph == 1) { | ||
var logfile = path.join(__dirname, dbDir, dbLog.getLogName(dbNode._id, mKey)); | ||
var theData = dbLog.getData(logfile, sts, ets, howManyPoints /*settings.general.graphMaxPoints.value*/); | ||
theData.label = dbNode.metrics[mKey].label || mKey; | ||
sets.push(theData); //100k points when exporting, more points is really pointless | ||
} | ||
}); | ||
socket.emit('EXPORTNODELOGSCSVREADY', { sets:sets }); | ||
} | ||
}); | ||
}); | ||
|
||
socket.on('UPDATESETTINGSDEF', function (newSettings) { | ||
var settings = nconf.get('settings'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.