-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
229 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<script setup lang="ts"> | ||
import { defineProps } from 'vue' | ||
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js' | ||
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' | ||
import mdiAccessPoint from '@mdi/svg/svg/access-point.svg?raw' | ||
import mdiFingerprintOff from '@mdi/svg/svg/fingerprint-off.svg?raw' | ||
import mdiServerNetworkOff from '@mdi/svg/svg/server-network-off.svg?raw' | ||
import mdiNetworkStrengthOffOutline from '@mdi/svg/svg/network-strength-off-outline.svg?raw' | ||
import mdiTextBoxOutline from '@mdi/svg/svg/text-box-outline.svg?raw' | ||
import type { MailServer } from '~/type' | ||
defineProps<{ | ||
server: MailServer | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<NcAvatar | ||
v-if="server.health === 'success'" | ||
style="background-color: rgba(var(--color-success-rgb), 0.1)"> | ||
<template #icon> | ||
<NcIconSvgWrapper | ||
:svg="mdiAccessPoint" | ||
name="AccessPoint" | ||
style="color: var(--color-success); min-width: var(--size); min-height: var(--size)" /> | ||
</template> | ||
</NcAvatar> | ||
<NcAvatar | ||
v-else-if="server.health === 'unauthorized'" | ||
style="background-color: rgba(var(--color-error-rgb), 0.1)"> | ||
<template #icon> | ||
<NcIconSvgWrapper | ||
:svg="mdiFingerprintOff" | ||
name="FingerprintOff" | ||
style="color: var(--color-error); min-width: var(--size); min-height: var(--size)" /> | ||
</template> | ||
</NcAvatar> | ||
<NcAvatar | ||
v-else-if="server.health === 'bad_network'" | ||
style="background-color: rgba(var(--color-error-rgb), 0.1)"> | ||
<template #icon> | ||
<NcIconSvgWrapper | ||
:svg="mdiServerNetworkOff" | ||
name="ServerNetworkOff" | ||
style="color: var(--color-error); min-width: var(--size); min-height: var(--size)" /> | ||
</template> | ||
</NcAvatar> | ||
<NcAvatar | ||
v-else-if="server.health === 'bad_server'" | ||
style="background-color: rgba(var(--color-error-rgb), 0.1)"> | ||
<template #icon> | ||
<NcIconSvgWrapper | ||
:svg="mdiNetworkStrengthOffOutline" | ||
name="NetworkStrengthOffOutline" | ||
style="color: var(--color-error); min-width: var(--size); min-height: var(--size)" /> | ||
</template> | ||
</NcAvatar> | ||
<NcAvatar | ||
v-else | ||
style="background-color: rgba(var(--color-warning-rgb), 0.1)"> | ||
<template #icon> | ||
<NcIconSvgWrapper | ||
:svg="mdiTextBoxOutline" | ||
name="TextBoxOutline" | ||
style="color: var(--color-warning); min-width: var(--size); min-height: var(--size)" /> | ||
</template> | ||
</NcAvatar> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import ServerSelection from '~/components/ViewSelection.vue' | ||
import ServerView from '~/components/ViewServer.vue' | ||
import { useServerList } from '~/composable' | ||
import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js' | ||
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js' | ||
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js' | ||
import HealthAvatarServer from '~/components/HealthAvatarServer.vue' | ||
import PopUpEntry from '~/components/PopUpEntry.vue' | ||
import { useNextmailTranslate, useServerList } from '~/composable' | ||
const { entries, loading, active, to, edit, reload, remove, create } = useServerList() | ||
onMounted(reload) | ||
const { t } = useNextmailTranslate() | ||
</script> | ||
|
||
<template> | ||
<div id="nextmail"> | ||
<ServerSelection :servers="entries" :server="active" @update:server="e => to(e? e.id : null)" /> | ||
<ServerView | ||
<NcSettingsSection :name="t('List of servers')" | ||
:description="t('Select a server to view or edit its configuration.')" | ||
doc-url="#todo"> | ||
<NcButton :type="ButtonType.Primary" @click="() => create()"> | ||
{{ t('Create a new config!') }} | ||
</NcButton> | ||
<ul> | ||
<NcListItem | ||
v-for="server in entries" | ||
:key="server.id" | ||
:name="/^[a-z0-9-]+:\/*([a-z0-9-.]+).*$/.exec(server.endpoint)?.at(1) || server.endpoint || '?????'" | ||
:subname="server.endpoint" | ||
@click="to(server.id)"> | ||
<template #icon> | ||
<HealthAvatarServer :server="server" /> | ||
</template> | ||
</NcListItem> | ||
</ul> | ||
</NcSettingsSection> | ||
<PopUpEntry | ||
:server="active" | ||
:loading="loading" | ||
@edit="edit" | ||
@delete="remove" | ||
@create="create" /> | ||
@create="create" | ||
@close="() => to(null)" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script setup lang="ts"> | ||
import { defineEmits, defineProps } from 'vue' | ||
import NcAppSettingsDialog from '@nextcloud/vue/dist/Components/NcAppSettingsDialog.js' | ||
import NcAppSettingsSection from '@nextcloud/vue/dist/Components/NcAppSettingsSection.js' | ||
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' | ||
import mdiServer from '@mdi/svg/svg/server.svg?raw' | ||
import mdiAccount from '@mdi/svg/svg/account.svg?raw' | ||
import mdiCloseOctagon from '@mdi/svg/svg/close-octagon.svg?raw' | ||
import SectionConfig from '~/components/SectionServer.vue' | ||
import SectionStatus from '~/components/SectionStatus.vue' | ||
import type { MailServer, MailServerForm } from '~/type' | ||
import { useNextmailTranslate } from '~/composable' | ||
import SectionDanger from '~/components/SectionDanger.vue' | ||
import SectionUser from '~/components/SectionUser.vue' | ||
defineProps<{ | ||
server: MailServer | null, | ||
loading: boolean | ||
}>() | ||
defineEmits<{ | ||
(e: 'edit', server: MailServerForm): void, | ||
(e: 'delete', id: string): void | ||
(e: 'create'): void | ||
(e: 'close'): void | ||
}>() | ||
const { t } = useNextmailTranslate() | ||
</script> | ||
|
||
<template> | ||
<NcAppSettingsDialog :open="server !== null" | ||
:show-navigation="true" | ||
:name="t('Server Management')" | ||
@update:open="e => e ? undefined : $emit('close')"> | ||
<NcAppSettingsSection id="server" :name="t('Stalwart server configuration ')"> | ||
<template #icon> | ||
<NcIconSvgWrapper :svg="mdiServer" :size="20" /> | ||
</template> | ||
<SectionStatus v-if="server !== null" :server="server" /> | ||
<SectionConfig v-if="server !== null" | ||
:server="server" | ||
:loading="loading" | ||
@submit="e => $emit('edit', e)" /> | ||
</NcAppSettingsSection> | ||
<NcAppSettingsSection :name="t('Users')"> | ||
<template #icon> | ||
<NcIconSvgWrapper id="account" :svg="mdiAccount" :size="20" /> | ||
</template> | ||
<SectionUser v-if="server !== null" :server="server" /> | ||
</NcAppSettingsSection> | ||
<NcAppSettingsSection id="danger" :name="t('Danger Zone')"> | ||
<template #icon> | ||
<NcIconSvgWrapper :svg="mdiCloseOctagon" :size="20" /> | ||
</template> | ||
<SectionDanger v-if="server !== null" | ||
:server="server" | ||
:loading="loading" | ||
@delete="e => $emit('delete', e)" /> | ||
</NcAppSettingsSection> | ||
</NcAppSettingsDialog> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.