simplify front end routes,

simplify ssr fragment fetch methods
This commit is contained in:
2025-04-15 17:13:22 +00:00
parent 844cf4dfb9
commit 099f9c4e42
9 changed files with 33 additions and 23 deletions

View File

@@ -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) {