fix goToPage
This commit is contained in:
parent
fe27bba986
commit
18da1b996d
@ -125,7 +125,7 @@ class Instance extends HTMLElement {
|
||||
configButton.src = data.status === "running" ? "images/actions/config-inactive.svg" : "images/actions/config-active.svg";
|
||||
configButton.addEventListener("click", () => {
|
||||
if (!this.actionLock && this.status !== "running") {
|
||||
goToPage("https://client.tronnet.net/config.html", {type: this.type, vmid: this.vmid});
|
||||
goToPage("config.html", {type: this.type, vmid: this.vmid});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ async function init () {
|
||||
async function populateInstances () {
|
||||
let cookie = document.cookie;
|
||||
if (cookie === "") {
|
||||
goToPage("https://client.tronnet.net/login.html");
|
||||
goToPage("login.html");
|
||||
}
|
||||
|
||||
let nodes = await request("/nodes", "GET", null);
|
||||
|
@ -14,7 +14,7 @@ function init (){
|
||||
status.innerText = "Authenticating...";
|
||||
let ticket = await requestTicket(formData.get("username"), formData.get("password"));
|
||||
setTicket(ticket.data.ticket, ticket.data.CSRFPreventionToken);
|
||||
goToPage("https://client.tronnet.net/index.html");
|
||||
goToPage("index.html");
|
||||
}
|
||||
catch (error) {
|
||||
if(error instanceof ResponseError) { // response error is usually 401 auth failed
|
||||
|
@ -79,7 +79,7 @@ export async function request (path, method, body = null, auth = true) {
|
||||
}
|
||||
|
||||
export function goToPage (page, data={}) {
|
||||
let url = new URL(url);
|
||||
let url = new URL(`https://client.tronnet.net/${page}`);
|
||||
for(let k in data) {
|
||||
url.searchParams.append(k, data[k]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user