use prettyLongDate in the eventlog timestamps

This commit is contained in:
Girish Ramakrishnan
2025-10-08 10:54:11 +02:00
parent 90e36c4552
commit 6bc5826c86
4 changed files with 7 additions and 18 deletions
+3 -7
View File
@@ -1,9 +1,8 @@
<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import moment from 'moment';
import { Button, TextInput, MultiSelect } from '@cloudron/pankow';
import { useDebouncedRef, prettyEmailAddresses } from '@cloudron/pankow/utils';
import { useDebouncedRef, prettyEmailAddresses, prettyLongDate } from '@cloudron/pankow/utils';
import MailModel from '../models/MailModel.js';
const mailModel = MailModel.create();
@@ -22,7 +21,6 @@ const availableTypes = [
const refreshBusy = ref(false);
const eventlogs = ref([]);
const activeId = ref('');
const search = useDebouncedRef('');
const page = ref(1);
const perPage = ref(20);
@@ -79,8 +77,7 @@ onMounted(async () => {
<thead>
<tr>
<th style="width: 5%"><!-- Icon --></th>
<th style="width: 7%">{{ $t('emails.eventlog.time') }}</th>
<th style="width: 7%"></th>
<th style="width: 14%">{{ $t('emails.eventlog.time') }}</th>
<th style="width: 26%">{{ $t('emails.eventlog.mailFrom') }}</th>
<th style="width: 25%">{{ $t('emails.eventlog.rcptTo') }}</th>
<th style="width: 30%">{{ $t('emails.eventlog.details') }}</th>
@@ -101,8 +98,7 @@ onMounted(async () => {
<i class="fas fa-filter" v-if="eventlog.type === 'spam-learn'" v-tooltip="$t('emails.eventlog.type.spamFilterTrained')"></i>
<i class="fas fa-fill-drip" v-if="eventlog.type === 'quota'" v-tooltip="$t('emails.eventlog.type.quota')"></i>
</td>
<td class="no-wrap">{{ moment(eventlog.ts).format('DD.MM.YYYY') }}</td>
<td class="no-wrap">{{ moment(eventlog.ts).format('HH:mm:SS') }}</td>
<td class="no-wrap">{{ prettyLongDate(eventlog.ts) }}</td>
<td class="elide-table-cell">{{ prettyEmailAddresses(eventlog.mailFrom) || '-' }}</td>
<td class="elide-table-cell">{{ prettyEmailAddresses(eventlog.rcptTo) || eventlog.mailbox || '-' }}</td>
<td>
+2 -5
View File
@@ -1,9 +1,8 @@
<script setup>
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue';
import moment from 'moment';
import { Button, TextInput, MultiSelect } from '@cloudron/pankow';
import { useDebouncedRef, copyToClipboard } from '@cloudron/pankow/utils';
import { useDebouncedRef, copyToClipboard, prettyLongDate } from '@cloudron/pankow/utils';
import AppsModel from '../models/AppsModel.js';
import EventlogsModel from '../models/EventlogsModel.js';
import { eventlogDetails, eventlogSource } from '../utils.js';
@@ -174,7 +173,6 @@ onUnmounted(() => {
<thead>
<tr>
<th>{{ $t('eventlog.time') }}</th>
<th></th>
<th>{{ $t('eventlog.source') }}</th>
<th>{{ $t('eventlog.details') }}</th>
</tr>
@@ -182,8 +180,7 @@ onUnmounted(() => {
<tbody>
<template v-for="eventlog in eventlogs" :key="eventlog.id">
<tr @click="eventlog.isOpen = !eventlog.isOpen" :class="{ 'active': eventlog.isOpen }" >
<td style="white-space: nowrap;">{{ moment(eventlog.raw.creationTime).format('DD.MM.YYYY') }}</td>
<td style="white-space: nowrap;">{{ moment(eventlog.raw.creationTime).format('HH:mm:SS') }}</td>
<td style="white-space: nowrap;">{{ prettyLongDate(eventlog.raw.creationTime) }}</td>
<td>{{ eventlog.source }}</td>
<td v-html="eventlog.details"></td>
</tr>