2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2021-03-15 05:36:23 +08:00
|
|
|
import Remote from 'Remote/Admin/Fetch';
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2021-02-17 21:40:21 +08:00
|
|
|
export const DomainAdminStore = ko.observableArray();
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2021-03-15 05:36:23 +08:00
|
|
|
DomainAdminStore.loading = ko.observable(false);
|
|
|
|
|
|
|
|
DomainAdminStore.fetch = () => {
|
|
|
|
DomainAdminStore.loading(true);
|
2021-12-03 07:11:19 +08:00
|
|
|
Remote.request('AdminDomainList',
|
|
|
|
(iError, data) => {
|
|
|
|
DomainAdminStore.loading(false);
|
|
|
|
if (!iError) {
|
|
|
|
DomainAdminStore(
|
2022-01-10 19:57:42 +08:00
|
|
|
data.Result.map(item => {
|
|
|
|
item.disabled = ko.observable(item.disabled);
|
2022-01-28 06:07:34 +08:00
|
|
|
item.askDelete = ko.observable(false);
|
2022-01-10 19:57:42 +08:00
|
|
|
return item;
|
|
|
|
})
|
2021-12-03 07:11:19 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}, {
|
2023-01-26 17:41:55 +08:00
|
|
|
includeAliases: 1
|
2021-12-03 07:11:19 +08:00
|
|
|
});
|
2021-03-15 05:36:23 +08:00
|
|
|
};
|