diff --git a/dashboard/public/js/index.js b/dashboard/public/js/index.js index df6ee2f0a..87261f476 100644 --- a/dashboard/public/js/index.js +++ b/dashboard/public/js/index.js @@ -83,8 +83,8 @@ app.config(['$routeProvider', function ($routeProvider) { // controller: 'EmailsController', // templateUrl: 'views/emails.html?' + window.VITE_CACHE_ID }).when('/emails-eventlog', { - controller: 'EmailsEventlogController', - templateUrl: 'views/emails-eventlog.html?' + window.VITE_CACHE_ID + // controller: 'EmailsEventlogController', + // templateUrl: 'views/emails-eventlog.html?' + window.VITE_CACHE_ID }).when('/emails-queue', { controller: 'EmailsQueueController', templateUrl: 'views/emails-queue.html?' + window.VITE_CACHE_ID diff --git a/dashboard/src/Index.vue b/dashboard/src/Index.vue index b6b5c62d9..70ade6198 100644 --- a/dashboard/src/Index.vue +++ b/dashboard/src/Index.vue @@ -9,6 +9,7 @@ import BackupsView from './views/BackupsView.vue'; import BrandingView from './views/BrandingView.vue'; import DomainsView from './views/DomainsView.vue'; import EmailsView from './views/EmailsView.vue'; +import EmailsEventlogView from './views/EmailsEventlogView.vue'; import EventlogView from './views/EventlogView.vue'; import NetworkView from './views/NetworkView.vue'; import ProfileView from './views/ProfileView.vue'; @@ -28,6 +29,7 @@ const VIEWS = { BRANDING: 'branding', DOMAINS: 'domains', EMAILS: 'email', + EMAILS_EVENTLOG: 'emails-eventlog', EVENTLOG: 'eventlog', NETWORK: 'network', PROFILE: 'profile', @@ -59,6 +61,8 @@ function onHashChange() { view.value = VIEWS.DOMAINS; } else if (v === VIEWS.EMAILS) { view.value = VIEWS.EMAILS; + } else if (v === VIEWS.EMAILS_EVENTLOG) { + view.value = VIEWS.EMAILS_EVENTLOG; } else if (v === VIEWS.EVENTLOG) { view.value = VIEWS.EVENTLOG; } else if (v === VIEWS.NETWORK) { @@ -110,6 +114,7 @@ onMounted(async () => { + diff --git a/dashboard/src/models/MailModel.js b/dashboard/src/models/MailModel.js index 91217de27..9248a318d 100644 --- a/dashboard/src/models/MailModel.js +++ b/dashboard/src/models/MailModel.js @@ -236,7 +236,18 @@ function create() { if (result.status !== 202) return [result]; return [null]; - } + }, + async eventlog(types, search, page, perPage) { + let result; + try { + result = await fetcher.get(`${API_ORIGIN}/api/v1/mailserver/eventlog`, { page, types, per_page: perPage, search, access_token: accessToken }); + } catch (e) { + return [e]; + } + + if (result.status !== 200) return [result]; + return [null, result.body.eventlogs]; + }, }; } diff --git a/dashboard/src/views/EmailsEventlogView.vue b/dashboard/src/views/EmailsEventlogView.vue new file mode 100644 index 000000000..026810713 --- /dev/null +++ b/dashboard/src/views/EmailsEventlogView.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/dashboard/src/views/EventlogView.vue b/dashboard/src/views/EventlogView.vue index ac99570cf..a139b09cf 100644 --- a/dashboard/src/views/EventlogView.vue +++ b/dashboard/src/views/EventlogView.vue @@ -104,7 +104,7 @@ const actions = reactive([]); async function onRefresh() { refreshBusy.value = true; - const [error, result] = await eventlogsModel.search(actions.map(a => a.id).join(','), search.value, page.value, perPage.value); + const [error, result] = await eventlogsModel.search(actions.join(','), search.value, page.value, perPage.value); if (error) return console.error(error); eventlogs.value = result.map(e => {