Skip to content

Commit

Permalink
fix(client): add fetch time to result row
Browse files Browse the repository at this point in the history
Fixes #211
  • Loading branch information
harlan-zw committed Apr 24, 2024
1 parent 5524701 commit 9c5de2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/client/components/Cell/CellRouteName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ watch(isModalOpen, () => {
function openEditorRequest() {
fetch(`${apiUrl}/__launch?file=${props.report.route.definition.component}`)
}
const fetchTime = computed(() => {
// use Intl to format the date
const date = new Date(props.report.report.fetchTime)
return new Intl.DateTimeFormat('en-US', {
dateStyle: 'medium',
timeStyle: 'short',
}).format(date)
})
</script>

<template>
Expand Down Expand Up @@ -53,6 +62,9 @@ function openEditorRequest() {
Redirected
</div>
</div>
<div class="opacity-60 mt-2">
{{ fetchTime }}
</div>
</div>
</div>
<teleport v-if="isModalOpen && showingModal" to="#modal-portal">
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/puppeteer/tasks/lighthouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function normaliseLighthouseResult(route: UnlighthouseRouteReport, result
}
}),
...pick(result, [
'fetchTime',
'audits.redirects',
// core web vitals
'audits.layout-shift-elements',
Expand Down

0 comments on commit 9c5de2c

Please sign in to comment.