Skip to content

Commit

Permalink
don't show default domain on admin account page
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mjl- committed Mar 17, 2024
1 parent cef8334 commit 79fb72f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
8 changes: 2 additions & 6 deletions webadmin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ const account = async (name) => {
}
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;
const t = k.split('@');
if (t.length > 1) {
Expand All @@ -1859,11 +1859,7 @@ const account = async (name) => {
const target = e.target;
target.disabled = true;
try {
let addr = k;
if (!addr.includes('@')) {
addr += '@' + config.Domain;
}
await client.AddressRemove(addr);
await client.AddressRemove(k);
}
catch (err) {
console.log({ err });
Expand Down
11 changes: 1 addition & 10 deletions webadmin/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,6 @@ const account = async (name: string) => {
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(
Expand Down Expand Up @@ -712,11 +707,7 @@ const account = async (name: string) => {
const target = e.target! as HTMLButtonElement
target.disabled = true
try {
let addr = k
if (!addr.includes('@')) {
addr += '@' + config.Domain
}
await client.AddressRemove(addr)
await client.AddressRemove(k)
} catch (err) {
console.log({err})
window.alert('Error: ' + errmsg(err))
Expand Down

0 comments on commit 79fb72f

Please sign in to comment.