Webview: minor improvements

This commit is contained in:
Johannes Kirschbauer 2024-06-15 11:34:54 +02:00
parent af19950dfa
commit 720fb4af63
Signed by: hsjobeki
SSH Key Fingerprint: SHA256:vX3utDqig7Ph5L0JPv87ZTPb/w7cMzREKVZzzLFg9qU
2 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import {
createEffect,
} from "solid-js";
import { OperationResponse, pyApi } from "./api";
import { currClanURI } from "./App";
export const makeMachineContext = () => {
const [machines, setMachines] =
@ -27,7 +28,10 @@ export const makeMachineContext = () => {
getMachines: () => {
// When the gtk function sends its data the loading state will be set to false
setLoading(true);
pyApi.list_machines.dispatch({ debug: true, flake_url: "." });
pyApi.list_machines.dispatch({
debug: true,
flake_url: currClanURI(),
});
},
},
] as const;

View File

@ -14,7 +14,6 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
);
}
console.log(import.meta.env);
if (import.meta.env.DEV) {
console.log("Development mode");
// Load the debugger in development mode
@ -27,7 +26,7 @@ if (import.meta.env.DEV) {
console.debug("Python API call", { method, data });
setTimeout(() => {
const mock = getFakeResponse(method, data);
console.log("mock", { mock });
console.log("Returning mock-data: ", { mock });
window.clan[method](JSON.stringify(mock));
}, 200);