2014-09-06 05:44:29 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
import * as Settings from 'Storage/Settings';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
import Remote from 'Remote/Admin/Ajax';
|
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
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
import {getApp} from 'Helper/Apps/Admin';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +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'
|
|
|
|
})
|
|
|
|
class PaneSettingsAdminView extends AbstractViewNext
|
2016-06-30 08:02:45 +08:00
|
|
|
{
|
2016-08-17 06:01:20 +08:00
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.adminDomain = ko.observable(Settings.settingsGet('AdminDomain'));
|
|
|
|
this.version = ko.observable(Settings.appSettingsGet('version'));
|
|
|
|
|
|
|
|
this.capa = !!Settings.settingsGet('PremType');
|
|
|
|
this.community = RL_COMMUNITY;
|
|
|
|
|
|
|
|
this.adminManLoading = ko.computed(
|
|
|
|
() => '000' !== [
|
|
|
|
DomainStore.domains.loading() ? '1' : '0',
|
|
|
|
PluginStore.plugins.loading() ? '1' : '0',
|
|
|
|
PackageStore.packages.loading() ? '1' : '0'
|
|
|
|
].join('')
|
|
|
|
);
|
|
|
|
|
|
|
|
this.adminManLoadingVisibility = ko.computed(
|
|
|
|
() => (this.adminManLoading() ? 'visible' : 'hidden')
|
|
|
|
).extend({rateLimit: 300});
|
|
|
|
}
|
|
|
|
|
|
|
|
logoutClick() {
|
|
|
|
Remote.adminLogout(() => {
|
|
|
|
getApp().loginAndLogoutReload(true, true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
export {PaneSettingsAdminView, PaneSettingsAdminView as default};
|