open console in new window
This commit is contained in:
parent
139bc324e8
commit
bbc88bb5f2
@ -131,7 +131,7 @@ export class Instance extends HTMLElement {
|
|||||||
|
|
||||||
handleConsoleButton () {
|
handleConsoleButton () {
|
||||||
if (this.status === "running") {
|
if (this.status === "running") {
|
||||||
goToPage("pve-xtermjs/index.html", {type: this.type, vmid: this.vmid, name: this.name, node: this.node.name, user: getCookie("username"), url: "pve.tronnet.net/api2/json"});
|
goToPage("pve-xtermjs/index.html", {type: this.type, vmid: this.vmid, name: this.name, node: this.node.name, user: getCookie("username"), url: "pve.tronnet.net/api2/json"}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,13 +148,19 @@ async function request (url, content) {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function goToPage (page, data={}) {
|
export function goToPage (page, data={}, newwindow = false) {
|
||||||
let url = new URL(`https://client.tronnet.net/${page}`);
|
let url = new URL(`https://client.tronnet.net/${page}`);
|
||||||
for(let k in data) {
|
for(let k in data) {
|
||||||
url.searchParams.append(k, data[k]);
|
url.searchParams.append(k, data[k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newwindow) {
|
||||||
|
window.open(url, "tronnet - client", "height=480,width=848");
|
||||||
|
}
|
||||||
|
else {
|
||||||
window.location.assign(url.toString());
|
window.location.assign(url.toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getURIData () {
|
export function getURIData () {
|
||||||
let url = new URL(window.location.href);
|
let url = new URL(window.location.href);
|
||||||
|
Loading…
Reference in New Issue
Block a user