Skip to content

Commit

Permalink
Optimize Mail Flow Table
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager committed Jul 22, 2024
1 parent 4c314e0 commit 9d2386f
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions src/Frontend/src/components/MailFlowTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const columns : QTableProps['columns'] = [
{
name: 'dateTime',
align: 'left',
label: 'Time',
label: 'Time (UTC)',
field: 'dateTime',
sortable: false
},
Expand All @@ -49,31 +49,17 @@ const columns : QTableProps['columns'] = [
sortable: false
},
{
name: 'byDomain',
name: 'by',
align: 'left',
label: 'By Domain',
field: 'byDomain',
label: 'By',
field: 'by',
sortable: false
},
{
name: 'byIpAddress',
name: 'from',
align: 'left',
label: 'By IpAddress',
field: 'byIpAddress',
sortable: false
},
{
name: 'fromDomain',
align: 'left',
label: 'From Domain',
field: 'fromDomain',
sortable: false
},
{
name: 'fromIpAddress',
align: 'left',
label: 'From IpAddress',
field: 'fromIpAddress',
label: 'From',
field: 'from',
sortable: false
},
{
Expand All @@ -88,7 +74,8 @@ const columns : QTableProps['columns'] = [
align: 'left',
label: 'With',
field: 'with',
sortable: false
sortable: false,
style: 'white-space: pre-wrap;'
},
{
name: 'id',
Expand All @@ -106,6 +93,20 @@ const columns : QTableProps['columns'] = [
}
]
function formatDate (date: Date): string {
const options : Intl.DateTimeFormatOptions = {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZone: 'UTC'
}
return new Intl.DateTimeFormat(undefined, options).format(date)
}
</script>

<template>
Expand All @@ -120,7 +121,19 @@ const columns : QTableProps['columns'] = [
>
<template #body-cell-dateTime="props">
<q-td>
{{ props.row.dateTime.toISOString() }}
{{ formatDate(props.row.dateTime) }}
</q-td>
</template>
<template #body-cell-by="props">
<q-td>
{{ props.row.byDomain }}<br>
{{ props.row.byIpAddress }}
</q-td>
</template>
<template #body-cell-from="props">
<q-td>
{{ props.row.fromDomain }}<br>
{{ props.row.fromIpAddress }}
</q-td>
</template>
<template #body-cell-delay="props">
Expand Down

0 comments on commit 9d2386f

Please sign in to comment.