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 { 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-03-10 18:44:48 +08:00
|
|
|
import { leftPanelDisabled, Settings } from 'Common/Globals';
|
2021-02-17 16:33:41 +08:00
|
|
|
|
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
|
|
|
|
2021-03-10 18:44:48 +08:00
|
|
|
this.version = ko.observable(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-03-15 05:36:23 +08:00
|
|
|
.computed(() => PackageAdminStore.loading() ? 'visible' : 'hidden');
|
2016-08-17 06:01:20 +08:00
|
|
|
}
|
|
|
|
|
2021-03-05 23:46:40 +08:00
|
|
|
toggleLeft(item, event) {
|
2021-02-17 16:33:41 +08:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
2021-03-05 23:46:40 +08:00
|
|
|
leftPanelDisabled(!leftPanelDisabled());
|
2021-02-17 16:33:41 +08:00
|
|
|
}
|
|
|
|
|
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 };
|