mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 08:23:48 +03:00
don't show default domain on admin account page
it is a remnant from the time domains didn't have to be specific in "Destination" addresses. we still use it for as default selection for adding a new address to an account. but there's not much point in showing it so prominently. that raises more questions than it is helpful. for issue #142 by tabatinga0xffff
This commit is contained in:
parent
cef83341e5
commit
79fb72f3cd
2 changed files with 3 additions and 16 deletions
|
@ -1837,7 +1837,7 @@ const account = async (name) => {
|
||||||
}
|
}
|
||||||
return v * mult;
|
return v * mult;
|
||||||
};
|
};
|
||||||
dom._kids(page, crumbs(crumblink('Mox Admin', '#'), crumblink('Accounts', '#accounts'), name), dom.div('Default domain: ', config.Domain ? dom.a(config.Domain, attr.href('#domains/' + config.Domain)) : '(none)'), dom.br(), dom.h2('Addresses'), dom.table(dom.thead(dom.tr(dom.th('Address'), dom.th('Action'))), dom.tbody(Object.keys(config.Destinations || {}).length === 0 ? dom.tr(dom.td(attr.colspan('2'), '(None, login disabled)')) : [], Object.keys(config.Destinations || {}).map(k => {
|
dom._kids(page, crumbs(crumblink('Mox Admin', '#'), crumblink('Accounts', '#accounts'), name), dom.h2('Addresses'), dom.table(dom.thead(dom.tr(dom.th('Address'), dom.th('Action'))), dom.tbody(Object.keys(config.Destinations || {}).length === 0 ? dom.tr(dom.td(attr.colspan('2'), '(None, login disabled)')) : [], Object.keys(config.Destinations || {}).map(k => {
|
||||||
let v = k;
|
let v = k;
|
||||||
const t = k.split('@');
|
const t = k.split('@');
|
||||||
if (t.length > 1) {
|
if (t.length > 1) {
|
||||||
|
@ -1859,11 +1859,7 @@ const account = async (name) => {
|
||||||
const target = e.target;
|
const target = e.target;
|
||||||
target.disabled = true;
|
target.disabled = true;
|
||||||
try {
|
try {
|
||||||
let addr = k;
|
await client.AddressRemove(k);
|
||||||
if (!addr.includes('@')) {
|
|
||||||
addr += '@' + config.Domain;
|
|
||||||
}
|
|
||||||
await client.AddressRemove(addr);
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.log({ err });
|
console.log({ err });
|
||||||
|
|
|
@ -673,11 +673,6 @@ const account = async (name: string) => {
|
||||||
crumblink('Accounts', '#accounts'),
|
crumblink('Accounts', '#accounts'),
|
||||||
name,
|
name,
|
||||||
),
|
),
|
||||||
dom.div(
|
|
||||||
'Default domain: ',
|
|
||||||
config.Domain ? dom.a(config.Domain, attr.href('#domains/'+config.Domain)) : '(none)',
|
|
||||||
),
|
|
||||||
dom.br(),
|
|
||||||
dom.h2('Addresses'),
|
dom.h2('Addresses'),
|
||||||
dom.table(
|
dom.table(
|
||||||
dom.thead(
|
dom.thead(
|
||||||
|
@ -712,11 +707,7 @@ const account = async (name: string) => {
|
||||||
const target = e.target! as HTMLButtonElement
|
const target = e.target! as HTMLButtonElement
|
||||||
target.disabled = true
|
target.disabled = true
|
||||||
try {
|
try {
|
||||||
let addr = k
|
await client.AddressRemove(k)
|
||||||
if (!addr.includes('@')) {
|
|
||||||
addr += '@' + config.Domain
|
|
||||||
}
|
|
||||||
await client.AddressRemove(addr)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log({err})
|
console.log({err})
|
||||||
window.alert('Error: ' + errmsg(err))
|
window.alert('Error: ' + errmsg(err))
|
||||||
|
|
Loading…
Reference in a new issue