diff --git a/src/components/pages/NodePage.vue b/src/components/pages/NodePage.vue index 9577967..5e67dd1 100644 --- a/src/components/pages/NodePage.vue +++ b/src/components/pages/NodePage.vue @@ -53,6 +53,7 @@ +
Position
+ +
+
Device Metrics
+ +
+ @@ -121,6 +178,15 @@ export default { getRoleName: (roleId) => NodeUtils.getRoleName(roleId), getHardwareName: (roleId) => NodeUtils.getHardwareName(roleId), latLongIntegerToLatLong: (latLongInteger) => NodeUtils.latLongIntegerToLatLong(latLongInteger), + formatUptimeSeconds: function(secondsToFormat) { + secondsToFormat = Number(secondsToFormat); + const days = Math.floor(secondsToFormat / (3600 * 24)); + const hours = Math.floor((secondsToFormat % (3600 * 24)) / 3600); + const minutes = Math.floor((secondsToFormat % 3600) / 60); + const seconds = Math.floor(secondsToFormat % 60); + const daysPlural = days === 1 ? 'day' : 'days'; + return `${days} ${daysPlural} ${hours}h ${minutes}m ${seconds}s`; + }, onNodeDeleted() { // go back to main page