mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Cleanup admin code
This commit is contained in:
parent
75c879836c
commit
3572d00a10
16 changed files with 178 additions and 244 deletions
|
|
@ -13,9 +13,6 @@ export class DomainsAdminSettings {
|
|||
this.domains = DomainAdminStore;
|
||||
|
||||
this.domainForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
|
||||
this.onDomainListChangeRequest = this.onDomainListChangeRequest.bind(this);
|
||||
this.onDomainLoadRequest = this.onDomainLoadRequest.bind(this);
|
||||
}
|
||||
|
||||
createDomain() {
|
||||
|
|
@ -28,30 +25,22 @@ export class DomainsAdminSettings {
|
|||
|
||||
deleteDomain(domain) {
|
||||
DomainAdminStore.remove(domain);
|
||||
Remote.domainDelete(this.onDomainListChangeRequest, domain.name);
|
||||
Remote.domainDelete(DomainAdminStore.fetch, domain.name);
|
||||
}
|
||||
|
||||
disableDomain(domain) {
|
||||
domain.disabled(!domain.disabled());
|
||||
Remote.domainDisable(this.onDomainListChangeRequest, domain.name, domain.disabled());
|
||||
Remote.domainDisable(DomainAdminStore.fetch, domain.name, domain.disabled());
|
||||
}
|
||||
|
||||
onBuild(oDom) {
|
||||
oDom.addEventListener('click', event => {
|
||||
let el = event.target.closestWithin('.b-admin-domains-list-table .e-item .e-action', oDom);
|
||||
el && ko.dataFor(el) && Remote.domain(this.onDomainLoadRequest, ko.dataFor(el).name);
|
||||
let el = event.target.closestWithin('.b-admin-domains-list-table .e-action', oDom);
|
||||
el && ko.dataFor(el) && Remote.domain(
|
||||
(iError, oData) => iError || showScreenPopup(DomainPopupView, [oData.Result]), ko.dataFor(el).name
|
||||
);
|
||||
});
|
||||
|
||||
DomainAdminStore.fetch();
|
||||
}
|
||||
|
||||
onDomainLoadRequest(iError, oData) {
|
||||
if (!iError) {
|
||||
showScreenPopup(DomainPopupView, [oData.Result]);
|
||||
}
|
||||
}
|
||||
|
||||
onDomainListChangeRequest() {
|
||||
DomainAdminStore.fetch();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue