diff --git a/dashboard/public/js/index.js b/dashboard/public/js/index.js index 87261f476..b11d3caa6 100644 --- a/dashboard/public/js/index.js +++ b/dashboard/public/js/index.js @@ -86,11 +86,11 @@ app.config(['$routeProvider', function ($routeProvider) { // 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 + // controller: 'EmailsQueueController', + // templateUrl: 'views/emails-queue.html?' + window.VITE_CACHE_ID }).when('/email/:domain/:view?', { - controller: 'EmailController', - templateUrl: 'views/email.html?' + window.VITE_CACHE_ID + // controller: 'EmailController', + // templateUrl: 'views/email.html?' + window.VITE_CACHE_ID }).when('/notifications', { controller: 'NotificationsController', templateUrl: 'views/notifications.html?' + window.VITE_CACHE_ID diff --git a/dashboard/src/Index.vue b/dashboard/src/Index.vue index 70ade6198..87d118e74 100644 --- a/dashboard/src/Index.vue +++ b/dashboard/src/Index.vue @@ -8,7 +8,8 @@ import AppstoreView from './views/AppstoreView.vue'; 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 EmailView from './views/EmailView.vue'; +import EmailDomainView from './views/EmailDomainView.vue'; import EmailsEventlogView from './views/EmailsEventlogView.vue'; import EventlogView from './views/EventlogView.vue'; import NetworkView from './views/NetworkView.vue'; @@ -28,7 +29,8 @@ const VIEWS = { BACKUPS: 'backups', BRANDING: 'branding', DOMAINS: 'domains', - EMAILS: 'email', + EMAIL: 'email', + EMAIL_DOMAIN: 'email-domain', EMAILS_EVENTLOG: 'emails-eventlog', EVENTLOG: 'eventlog', NETWORK: 'network', @@ -59,10 +61,12 @@ function onHashChange() { view.value = VIEWS.BRANDING; } else if (v === VIEWS.DOMAINS) { view.value = VIEWS.DOMAINS; - } else if (v === VIEWS.EMAILS) { - view.value = VIEWS.EMAILS; + } else if (v === VIEWS.EMAIL) { + view.value = VIEWS.EMAIL; } else if (v === VIEWS.EMAILS_EVENTLOG) { view.value = VIEWS.EMAILS_EVENTLOG; + } else if (v.indexOf(VIEWS.EMAIL) === 0) { + view.value = VIEWS.EMAIL_DOMAIN; } else if (v === VIEWS.EVENTLOG) { view.value = VIEWS.EVENTLOG; } else if (v === VIEWS.NETWORK) { @@ -113,7 +117,8 @@ onMounted(async () => { - + + diff --git a/dashboard/src/models/DomainsModel.js b/dashboard/src/models/DomainsModel.js index 70b84e8a9..c7c38ee83 100644 --- a/dashboard/src/models/DomainsModel.js +++ b/dashboard/src/models/DomainsModel.js @@ -17,6 +17,17 @@ function create() { if (error || result.status !== 200) return [error || result]; return [null, result.body.domains]; }, + async get(domain) { + let error, result; + try { + result = await fetcher.get(`${API_ORIGIN}/api/v1/domains/${domain}`, { access_token: accessToken }); + } catch (e) { + error = e; + } + + if (error || result.status !== 200) return [error || result]; + return [null, result.body]; + }, async add(domain, zoneName, provider, config, fallbackCertificate, tlsConfig) { const data = { domain, provider, config, tlsConfig }; if (zoneName) data.zoneName = zoneName; diff --git a/dashboard/src/models/MailModel.js b/dashboard/src/models/MailModel.js index 9248a318d..c8acc250a 100644 --- a/dashboard/src/models/MailModel.js +++ b/dashboard/src/models/MailModel.js @@ -39,6 +39,17 @@ function create() { if (result.status !== 200) return [result]; return [null, result.body.count]; }, + async setEnabled(domain, enabled) { + let result; + try { + result = await fetcher.post(`${API_ORIGIN}/api/v1/mail/${domain}/enable`, { enabled }, { access_token: accessToken }); + } catch (e) { + return [e]; + } + + if (result.status !== 202) return [result]; + return [null]; + }, async usage(domain) { let result; try { diff --git a/dashboard/src/views/EmailDomainView.vue b/dashboard/src/views/EmailDomainView.vue new file mode 100644 index 000000000..af237e1a4 --- /dev/null +++ b/dashboard/src/views/EmailDomainView.vue @@ -0,0 +1,142 @@ + + + diff --git a/dashboard/src/views/EmailsView.vue b/dashboard/src/views/EmailView.vue similarity index 99% rename from dashboard/src/views/EmailsView.vue rename to dashboard/src/views/EmailView.vue index 4c92cf50c..56eb2fe0b 100644 --- a/dashboard/src/views/EmailsView.vue +++ b/dashboard/src/views/EmailView.vue @@ -377,7 +377,6 @@ onMounted(async () => {

{{ $t('emails.title') }}
-

diff --git a/dashboard/src/views/EmailsEventlogView.vue b/dashboard/src/views/EmailsEventlogView.vue index c7b0c047c..283d7c535 100644 --- a/dashboard/src/views/EmailsEventlogView.vue +++ b/dashboard/src/views/EmailsEventlogView.vue @@ -83,7 +83,6 @@ onMounted(async () => {

{{ $t('emails.eventlog.title') }}
-

@@ -95,9 +94,9 @@ onMounted(async () => { -