Skip to content

Commit

Permalink
Add client page
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 15, 2024
1 parent 8ed15ae commit 38c55af
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
"@suid/vite-plugin": "^0.3.1",
"@tanstack/solid-table": "^8.20.5",
"axios": "^1.7.9",
"highlight.js": "^11.11.0",
"leaflet": "^1.9.4",
"marked": "^15.0.3",
"marked-highlight": "^2.2.1",
"plotly.js-dist-min": "^2.35.2",
"solid-js": "^1.9.3",
"tippy.js": "^6.3.7"
Expand Down
28 changes: 27 additions & 1 deletion gui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import "tippy.js/animations/scale.css";
import { get_total_api } from "./API";
import Process from "./Process";
import ServerModal from "./Server";
import { marked } from "marked";

const [mode, setMode] = createSignal<"jackpot" | "query" | "process">("jackpot");
const [mode, setMode] = createSignal<"jackpot" | "query" | "process" | "scripting">("jackpot");
const [total] = createResource<number>(get_total_api);

const App: Component = () => {
Expand All @@ -45,6 +46,11 @@ const App: Component = () => {
animation: "scale",
theme: "translucent"
});
tippy(`#btn-scripting`, {
content: "Guides to programmatic usage.",
animation: "scale",
theme: "translucent"
});
});

const variant = screen.height <= 1080 ? "dense" : "regular";
Expand Down Expand Up @@ -74,6 +80,9 @@ const App: Component = () => {
<Button size="small" id="btn-process" onClick={() => setMode("process")} variant="contained">
Process
</Button>
<Button size="small" id="btn-scripting" onClick={() => setMode("scripting")} variant="contained">
Scripting
</Button>
<AboutModal />
<ServerModal />
</Toolbar>
Expand All @@ -89,10 +98,27 @@ const App: Component = () => {
<Match when={mode() === "process"}>
<Process sx={{ border: "1px solid darkgrey" }} />
</Match>
<Match when={mode() === "scripting"}>
<Guide />
</Match>
</Switch>
</Box>
</Stack>
);
};

const Guide = () => {
const [html, setHtml] = createSignal<string>("");

onMount(async () => {
const response = await fetch("/src/assets/client.md");

marked.use({ async: true });

setHtml(await marked.parse((await response.text()).replace(/\(client_files\//g, "(/src/assets/client_files/")));
});

return <div innerHTML={html()} />;
}

export default App;
147 changes: 147 additions & 0 deletions gui/src/assets/client.md

Large diffs are not rendered by default.

Binary file added gui/src/assets/client_files/client_11_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/src/assets/client_files/client_13_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/src/assets/client_files/client_9_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38c55af

Please sign in to comment.