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
|
|
|
|
2021-02-17 21:40:21 +08:00
|
|
|
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
|
|
|
import { PluginAdminStore } from 'Stores/Admin/Plugin';
|
|
|
|
import { PackageAdminStore } from 'Stores/Admin/Package';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2021-01-24 17:25:23 +08:00
|
|
|
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
|
|
|
|
2021-02-17 16:33:41 +08:00
|
|
|
import { leftPanelDisabled } from 'Common/Globals';
|
|
|
|
|
2021-01-24 17:25:23 +08:00
|
|
|
class PaneSettingsAdminView extends AbstractViewRight {
|
2016-08-17 06:01:20 +08:00
|
|
|
constructor() {
|
2021-01-24 17:25:23 +08:00
|
|
|
super('Admin/Settings/Pane', 'AdminPane');
|
2016-08-17 06:01:20 +08:00
|
|
|
|
2020-09-04 18:05:17 +08:00
|
|
|
this.version = ko.observable(rl.settings.app('version'));
|
2016-08-17 06:01:20 +08:00
|
|
|
|
2021-02-17 16:33:41 +08:00
|
|
|
this.leftPanelDisabled = leftPanelDisabled;
|
2016-08-17 06:01:20 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
this.adminManLoadingVisibility = ko
|
2021-02-17 21:40:21 +08:00
|
|
|
.computed(() => (DomainAdminStore.loading()
|
|
|
|
|| PluginAdminStore.loading()
|
|
|
|
|| PackageAdminStore.loading()) ? 'visible' : 'hidden')
|
2019-07-05 03:19:24 +08:00
|
|
|
.extend({ rateLimit: 300 });
|
2016-08-17 06:01:20 +08:00
|
|
|
}
|
|
|
|
|
2021-02-17 16:33:41 +08:00
|
|
|
hideLeft(item, event) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
leftPanelDisabled(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
showLeft(item, event) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
leftPanelDisabled(false);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2021-01-22 23:32:08 +08:00
|
|
|
export { PaneSettingsAdminView };
|