2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2020-09-15 01:40:56 +08:00
|
|
|
import Remote from 'Remote/Admin/Fetch';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
import DomainStore from 'Stores/Admin/Domain';
|
|
|
|
import PluginStore from 'Stores/Admin/Plugin';
|
|
|
|
import PackageStore from 'Stores/Admin/Package';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
import { view, ViewType } from 'Knoin/Knoin';
|
|
|
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
@view({
|
|
|
|
name: 'View/Admin/Settings/Pane',
|
|
|
|
type: ViewType.Right,
|
|
|
|
templateID: 'AdminPane'
|
|
|
|
})
|
2019-07-05 03:19:24 +08:00
|
|
|
class PaneSettingsAdminView extends AbstractViewNext {
|
2016-08-17 06:01:20 +08:00
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
2020-09-04 18:05:17 +08:00
|
|
|
this.version = ko.observable(rl.settings.app('version'));
|
2016-08-17 06:01:20 +08:00
|
|
|
|
|
|
|
this.adminManLoading = ko.computed(
|
2019-07-05 03:19:24 +08:00
|
|
|
() =>
|
|
|
|
'000' !==
|
|
|
|
[
|
|
|
|
DomainStore.domains.loading() ? '1' : '0',
|
|
|
|
PluginStore.plugins.loading() ? '1' : '0',
|
|
|
|
PackageStore.packages.loading() ? '1' : '0'
|
|
|
|
].join('')
|
2016-08-17 06:01:20 +08:00
|
|
|
);
|
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
this.adminManLoadingVisibility = ko
|
|
|
|
.computed(() => (this.adminManLoading() ? 'visible' : 'hidden'))
|
|
|
|
.extend({ rateLimit: 300 });
|
2016-08-17 06:01:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
logoutClick() {
|
2020-09-04 20:36:24 +08:00
|
|
|
Remote.adminLogout(() => rl.logoutReload());
|
2016-08-17 06:01:20 +08:00
|
|
|
}
|
|
|
|
}
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
export { PaneSettingsAdminView, PaneSettingsAdminView as default };
|