mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-03 21:41:46 +08:00
23 lines
580 B
JavaScript
23 lines
580 B
JavaScript
import ko from 'ko';
|
|
import Remote from 'Remote/Admin/Fetch';
|
|
|
|
export const DomainAdminStore = ko.observableArray();
|
|
|
|
DomainAdminStore.loading = ko.observable(false);
|
|
|
|
DomainAdminStore.fetch = () => {
|
|
DomainAdminStore.loading(true);
|
|
Remote.domainList((iError, data) => {
|
|
DomainAdminStore.loading(false);
|
|
if (!iError && data && data.Result) {
|
|
DomainAdminStore(
|
|
Object.entries(data.Result).map(([name, [enabled, alias]]) => ({
|
|
name: name,
|
|
disabled: ko.observable(!enabled),
|
|
alias: alias,
|
|
deleteAccess: ko.observable(false)
|
|
}))
|
|
);
|
|
}
|
|
});
|
|
};
|