mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
26 lines
615 B
JavaScript
26 lines
615 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.request('AdminDomainList',
|
|
(iError, data) => {
|
|
DomainAdminStore.loading(false);
|
|
if (!iError) {
|
|
DomainAdminStore(
|
|
data.Result.map(item => {
|
|
item.name = IDN.toUnicode(item.name);
|
|
item.disabled = ko.observable(item.disabled);
|
|
item.askDelete = ko.observable(false);
|
|
return item;
|
|
})
|
|
);
|
|
}
|
|
}, {
|
|
includeAliases: 1
|
|
});
|
|
};
|