Add last micE and last comment to table

This commit is contained in:
Adam Goldsmith 2019-07-13 08:48:50 -04:00
parent 93a2afc4ad
commit a7455677de
2 changed files with 13 additions and 3 deletions

View File

@ -5,8 +5,10 @@
<td>{{ formatTime(status.lastHeard) }}</td>
<td>{{ formatTime(now - status.lastHeard, true) }}</td>
<td>{{ formatTime(Math.round(status.avgDelta), true) }}</td>
<td>{{ status.lastMicE }}</td>
<td>{{ status.lastVoltage || "" }}</td>
<td>{{ status.lastTemperature || "" }}</td>
<td>{{ status.lastComment }}</td>
</template>
<template v-else>
<td>Never Heard</td>
@ -14,6 +16,8 @@
<td>Never Heard</td>
<td>Never Heard</td>
<td>Never Heard</td>
<td>Never Heard</td>
<td>Never Heard</td>
</template>
</tr>
</template>
@ -76,9 +80,13 @@ export default {
let delta = message.date.getTime() - arr[idx - 1].date.getTime();
acc.avgDelta = (acc.avgDelta * (idx - 1) + delta) / idx;
}
if ("data" in message && "analog" in message.data) {
acc.lastVoltage = message.data.analog[0] / 10;
acc.lastTemperature = message.data.analog[1];
if ("data" in message) {
if ("analog" in message.data) {
acc.lastVoltage = message.data.analog[0] / 10;
acc.lastTemperature = message.data.analog[1];
}
acc.lastMicE = message.data.mice;
acc.lastComment = message.data.comment;
}
return acc;
}, {})

View File

@ -6,8 +6,10 @@
<th>Last Heard</th>
<th>Time since Last Heard</th>
<th>Avg. Period</th>
<th>Last MicE</th>
<th>Last Voltage</th>
<th>Last Temperature</th>
<th>Last Comment</th>
</tr>
<StationRow