dockered
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
import { client, navigateTo } from "../../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params, titleKey, uri = "/login") {
|
||||
super(params, titleKey, uri);
|
||||
}
|
||||
|
||||
async redirect()
|
||||
{
|
||||
if (await client.isAuthenticated() === false)
|
||||
{
|
||||
navigateTo(this.redirect_url);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { client, navigateTo } from "../../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params, titleKey, uri = "/home") {
|
||||
super(params, titleKey, uri);
|
||||
}
|
||||
|
||||
async redirect()
|
||||
{
|
||||
if (await client.isAuthenticated() === false)
|
||||
return 0;
|
||||
navigateTo(this.redirect_url);
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import { navigateTo } from "../../index.js";
|
||||
import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView{
|
||||
constructor(params, titleKey, uri)
|
||||
{
|
||||
super(params, titleKey);
|
||||
this.redirect_url = uri;
|
||||
}
|
||||
|
||||
async redirect()
|
||||
{
|
||||
navigateTo(this.redirect_url);
|
||||
}
|
||||
}
|
22
django/frontend/static/js/views/abstracts/AbstractView.js
Normal file
22
django/frontend/static/js/views/abstracts/AbstractView.js
Normal file
@ -0,0 +1,22 @@
|
||||
import {lang} from '../../index.js';
|
||||
|
||||
export default class {
|
||||
constructor(params, titleKey) {
|
||||
this.params = params;
|
||||
this.titleKey = titleKey;
|
||||
}
|
||||
|
||||
async postInit() {
|
||||
}
|
||||
|
||||
async leavePage() {
|
||||
}
|
||||
|
||||
setTitle() {
|
||||
document.title = lang.get(this.titleKey, this.titleKey);
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
return "";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user