Webview: minor improvements
This commit is contained in:
parent
af19950dfa
commit
720fb4af63
|
@ -6,6 +6,7 @@ import {
|
||||||
createEffect,
|
createEffect,
|
||||||
} from "solid-js";
|
} from "solid-js";
|
||||||
import { OperationResponse, pyApi } from "./api";
|
import { OperationResponse, pyApi } from "./api";
|
||||||
|
import { currClanURI } from "./App";
|
||||||
|
|
||||||
export const makeMachineContext = () => {
|
export const makeMachineContext = () => {
|
||||||
const [machines, setMachines] =
|
const [machines, setMachines] =
|
||||||
|
@ -27,7 +28,10 @@ export const makeMachineContext = () => {
|
||||||
getMachines: () => {
|
getMachines: () => {
|
||||||
// When the gtk function sends its data the loading state will be set to false
|
// When the gtk function sends its data the loading state will be set to false
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
pyApi.list_machines.dispatch({ debug: true, flake_url: "." });
|
pyApi.list_machines.dispatch({
|
||||||
|
debug: true,
|
||||||
|
flake_url: currClanURI(),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
] as const;
|
] as const;
|
||||||
|
|
|
@ -14,7 +14,6 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(import.meta.env);
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
console.log("Development mode");
|
console.log("Development mode");
|
||||||
// Load the debugger in development mode
|
// Load the debugger in development mode
|
||||||
|
@ -27,7 +26,7 @@ if (import.meta.env.DEV) {
|
||||||
console.debug("Python API call", { method, data });
|
console.debug("Python API call", { method, data });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const mock = getFakeResponse(method, data);
|
const mock = getFakeResponse(method, data);
|
||||||
console.log("mock", { mock });
|
console.log("Returning mock-data: ", { mock });
|
||||||
|
|
||||||
window.clan[method](JSON.stringify(mock));
|
window.clan[method](JSON.stringify(mock));
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user