Skip to content

Commit

Permalink
status: add timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed May 10, 2024
1 parent 2c9ac89 commit d38df2b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions framework/ndn-testbed-status/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<th>HTTPS</th>

<th>Revision</th>
<th>Status</th>

<th>NFD Version</th>
<th>NLSR Version</th>

Expand Down Expand Up @@ -37,6 +39,8 @@
{{ router.status?.revision }}
</a>
</td>
<td>{{ getFromNow(router.status?.timestamp) }}</td>

<td>{{ router.status?.nfd?.version }}</td>
<td>{{ router.status?.nlsr?.version }}</td>

Expand Down Expand Up @@ -172,6 +176,13 @@ export default defineComponent({
getRevUrl(router: IRouter) {
return `${TESTBED_REPO}/commit/${router.status!.revision}`;
},
getFromNow(timestamp: number | undefined) {
if (!timestamp) return String();
const diff = Math.round(Date.now() / 1000 - timestamp);
return `${diff}s`;
},
},
});
</script>
Expand Down

0 comments on commit d38df2b

Please sign in to comment.