implement basic web server for dashboard,

use templates to do basic SSR on head and header
This commit is contained in:
2025-02-25 21:35:11 +00:00
parent 84cbe0e45d
commit cfceb32134
21 changed files with 302 additions and 107 deletions

View File

@@ -1,5 +1,4 @@
import { getSyncSettings, requestAPI } from "./utils.js";
import { API } from "../vars.js";
export async function setupClientSync (callback) {
const { scheme, rate } = getSyncSettings();
@@ -22,7 +21,7 @@ export async function setupClientSync (callback) {
}
else if (scheme === "interrupt") {
callback();
const socket = new WebSocket(`wss://${API.replace("https://", "")}/sync/interrupt`);
const socket = new WebSocket(`wss://${window.API.replace("https://", "")}/sync/interrupt`);
socket.addEventListener("open", (event) => {
socket.send(`rate ${rate}`);
});