remove org specific values,
add dynamic org handling Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {requestAPI, goToPage, getCookie} from "./utils.js";
|
||||
import {requestAPI, goToPage, getCookie, setTitleAndHeader} from "./utils.js";
|
||||
|
||||
window.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
@@ -11,6 +11,7 @@ let SIPrefix = [
|
||||
]
|
||||
|
||||
async function init () {
|
||||
setTitleAndHeader();
|
||||
let cookie = document.cookie;
|
||||
if (cookie === "") {
|
||||
goToPage("login.html");
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import {requestPVE, requestAPI, goToPage, getURIData, resources_config} from "./utils.js";
|
||||
import {requestPVE, requestAPI, goToPage, getURIData, resources_config, setTitleAndHeader} from "./utils.js";
|
||||
import {alert, dialog} from "./dialog.js";
|
||||
|
||||
window.addEventListener("DOMContentLoaded", init); // do the dumb thing where the disk config refreshes every second
|
||||
@@ -12,6 +12,7 @@ let vmid;
|
||||
let config;
|
||||
|
||||
async function init () {
|
||||
setTitleAndHeader();
|
||||
let cookie = document.cookie;
|
||||
if (cookie === "") {
|
||||
goToPage("login.html");
|
||||
|
@@ -1,10 +1,11 @@
|
||||
import {requestPVE, requestAPI, goToPage, goToURL, instances_config, nodes_config} from "./utils.js";
|
||||
import {requestPVE, requestAPI, goToPage, goToURL, instances_config, nodes_config, setTitleAndHeader} from "./utils.js";
|
||||
import {alert, dialog} from "./dialog.js";
|
||||
import {PVE} from "../vars.js"
|
||||
|
||||
window.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
async function init () {
|
||||
setTitleAndHeader();
|
||||
let cookie = document.cookie;
|
||||
if (cookie === "") {
|
||||
goToPage("login.html");
|
||||
|
@@ -1,9 +1,10 @@
|
||||
import {requestTicket, goToPage, deleteAllCookies, requestPVE} from "./utils.js";
|
||||
import {requestTicket, goToPage, deleteAllCookies, requestPVE, setTitleAndHeader} from "./utils.js";
|
||||
import {alert} from "./dialog.js";
|
||||
|
||||
window.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
async function init (){
|
||||
setTitleAndHeader();
|
||||
await deleteAllCookies();
|
||||
let formSubmitButton = document.querySelector("#submit");
|
||||
let realms = await requestPVE("/access/domains", "GET");
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import {API} from "/vars.js";
|
||||
import {API, organization} from "/vars.js";
|
||||
|
||||
export const resources_config = {
|
||||
disk: {
|
||||
@@ -164,7 +164,7 @@ export function goToPage (page, data={}, newwindow = false) {
|
||||
}
|
||||
|
||||
if (newwindow) {
|
||||
window.open(url, "tronnet - client", "height=480,width=848");
|
||||
window.open(url, `${organization} - client`, "height=480,width=848");
|
||||
}
|
||||
else {
|
||||
window.location.assign(url.toString());
|
||||
@@ -178,7 +178,7 @@ export function goToURL (href, data={}, newwindow = false) {
|
||||
}
|
||||
|
||||
if (newwindow) {
|
||||
window.open(url, "tronnet - client", "height=480,width=848");
|
||||
window.open(url, `${organization} - client`, "height=480,width=848");
|
||||
}
|
||||
else {
|
||||
window.location.assign(url.toString());
|
||||
@@ -192,4 +192,9 @@ export function getURIData () {
|
||||
|
||||
export async function deleteAllCookies () {
|
||||
await requestAPI("/ticket", "DELETE");
|
||||
}
|
||||
|
||||
export function setTitleAndHeader () {
|
||||
document.title = `${organization} - client`;
|
||||
document.querySelector("h1").innerText = organization;
|
||||
}
|
Reference in New Issue
Block a user