webmail: show link to webaccount interface in top right

only if account web interface is enabled on the same listener and same http/https scheme.
This commit is contained in:
Mechiel Lukkien
2024-04-19 17:44:31 +02:00
parent 70adf353ee
commit 8a1d81c29a
11 changed files with 46 additions and 17 deletions

View File

@ -5681,6 +5681,7 @@ type listMailboxes = () => api.Mailbox[]
const init = async () => {
let connectionElem: HTMLElement // SSE connection status/error. Empty when connected.
let layoutElem: HTMLSelectElement // Select dropdown for layout.
let accountElem: HTMLElement
let loginAddressElem: HTMLElement
let msglistscrollElem: HTMLElement
@ -6257,6 +6258,8 @@ const init = async () => {
' ',
dom.clickbutton('Settings', attr.title('Change settings for composing messages.'), clickCmd(cmdSettings, shortcuts)),
' ',
accountElem=dom.span(),
' ',
loginAddressElem=dom.span(),
' ',
dom.clickbutton('Logout', attr.title('Logout, invalidating this session.'), async function click(e: MouseEvent) {
@ -6751,8 +6754,9 @@ const init = async () => {
connecting = false
sseID = start.SSEID
loginAddress = start.LoginAddress
dom._kids(loginAddressElem, formatEmail(loginAddress))
dom._kids(accountElem, start.AccountPath ? dom.a(attr.href(start.AccountPath), 'Account') : [])
const loginAddr = formatEmail(loginAddress)
dom._kids(loginAddressElem, loginAddr)
accountAddresses = start.Addresses || []
accountAddresses.sort((a, b) => {
if (formatEmail(a) === loginAddr) {