mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-14 11:44:54 +08:00
32 lines
789 B
JavaScript
32 lines
789 B
JavaScript
import 'External/Admin/ko';
|
|
|
|
import { Settings, SettingsGet } from 'Common/Globals';
|
|
|
|
import Remote from 'Remote/Admin/Fetch';
|
|
|
|
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
|
import { LoginAdminScreen } from 'Screen/Admin/Login';
|
|
|
|
import { startScreens } from 'Knoin/Knoin';
|
|
import { AbstractApp } from 'App/Abstract';
|
|
|
|
class AdminApp extends AbstractApp {
|
|
constructor() {
|
|
super(Remote);
|
|
this.weakPassword = ko.observable(false);
|
|
}
|
|
|
|
start() {
|
|
if (!Settings.app('allowAdminPanel')) {
|
|
rl.route.root();
|
|
setTimeout(() => location.href = '/', 1);
|
|
} else if (SettingsGet('Auth')) {
|
|
this.weakPassword(!!SettingsGet('WeakPassword'));
|
|
startScreens([SettingsAdminScreen]);
|
|
} else {
|
|
startScreens([LoginAdminScreen]);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default new AdminApp();
|