Full implemantation

This commit is contained in:
2022-11-28 22:56:21 -03:00
parent 30ef4c6a35
commit c53eb4c7a6
55 changed files with 1505 additions and 1011 deletions

View File

@ -13,8 +13,13 @@
get: function() {
const uri = '/mailboxes/registered'
this.draw().loading()
return Send.get(uri).then(response => {
this.mailboxes = response.mailboxes
return Send.get(uri).then((response, status, jqXHR) => {
if (parseInt(jqXHR.status / 100) !== 2) {
return
}
if (jqXHR.status === 200) {
this.mailboxes = response.mailboxes
}
this.draw().list()
})
},
@ -38,6 +43,10 @@
list: () => {
const parent = $(this.div_id)
parent.html('')
if (this.mailboxes.length === 0) {
parent.html('No mailboxes registered.')
return
}
const list = $('<div></div>').addClass('ui list')
this.mailboxes.forEach(mb => {
list.append(