simplify front end routes,
simplify ssr fragment fetch methods
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { requestPVE, requestAPI, goToPage, setAppearance, getSearchSettings, goToURL, getInstancesFragment } from "./utils.js";
|
||||
import { requestPVE, requestAPI, goToPage, setAppearance, getSearchSettings, goToURL, requestDash } from "./utils.js";
|
||||
import { alert, dialog } from "./dialog.js";
|
||||
import { setupClientSync } from "./clientsync.js";
|
||||
import wfaInit from "../modules/wfa.js";
|
||||
@@ -179,7 +179,7 @@ class InstanceCard extends HTMLElement {
|
||||
|
||||
handleConfigButton () {
|
||||
if (!this.actionLock && this.status === "stopped") { // if the action lock is false, and the node is stopped, then navigate to the config page with the node info in the search query
|
||||
goToPage("config.html", { node: this.node.name, type: this.type, vmid: this.vmid });
|
||||
goToPage("config", { node: this.node.name, type: this.type, vmid: this.vmid });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,10 @@ async function init () {
|
||||
setupClientSync(refreshInstances);
|
||||
}
|
||||
|
||||
async function getInstancesFragment () {
|
||||
return await requestDash("/index/instances", "GET")
|
||||
}
|
||||
|
||||
async function refreshInstances () {
|
||||
let instances = await getInstancesFragment();
|
||||
if (instances.status !== 200) {
|
||||
|
Reference in New Issue
Block a user