version page first draft.

This commit is contained in:
jimmy committed 2026-03-01 19:14:43 -05:00
1 parent be7451713e
commit d5c158024f
6 files changed
+4798 -2804

No files matched your search

Generated
+3869 -2434
View File
File diff suppressed because it is too large. Load diff
+884 -339
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+2 -1
View File
@@ -20,7 +20,8 @@
"react": "^19.2.0", "react": "^19.2.0",
"react-bootstrap": "^2.10.10", "react-bootstrap": "^2.10.10",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
"react-router-dom": "^7.13.1" "react-router-dom": "^7.13.1",
"yaml": "^2.8.2"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.1", "@eslint/js": "^9.39.1",
+33 -30
View File
@@ -1,45 +1,48 @@
import { AppNav, Footer } from "./AppNav.tsx"; import { AppNav, Footer } from "./AppNav.tsx";
import { Container, Row, Col, Image } from "react-bootstrap"; import { Container, Row, Col, Card } from "react-bootstrap";
import { atom, useAtom } from 'jotai'; import { atom, useAtom } from "jotai";
import { atomWithQuery } from 'jotai-tanstack-query'; import { atomWithQuery } from "jotai-tanstack-query";
import YAML from "yaml";
const versionQueryFn = async () => { const versionQueryFn = async () => {
const resp = await fetch("api/build_info"); const resp = await fetch("api/build_info");
if(!resp.ok) { if (!resp.ok) {
throw new Error('Network response was not ok') throw new Error("Network response was not ok");
} }
console.log(resp); return resp.json();
return resp.json(); };
}
const versionAtom = atomWithQuery( () => const versionAtom = atomWithQuery(() => ({
({ queryKey: ["version"],
queryKey: ["version"], queryFn: versionQueryFn,
queryFn: versionQueryFn, }));
})
);
export function Version() { export function Version() {
const [{ data, isPending, isError }] = useAtom(versionAtom); const [{ data, isPending, isError }] = useAtom(versionAtom);
let versionText = () => { let versionText = () => {
if(isPending) { if (isPending) {
return "Loading..."; return "Loading...";
} }
if(isError) { if (isError) {
return "Error loading!"; return "Error loading!";
} }
return JSON.stringify(data); if (!data.status) {
}; return "Can not find version";
}
return YAML.stringify(data.message);
};
return ( return (
<div> <div>
<AppNav /> <AppNav />
<Container> <Container className="vert-padded">
<p> <Card className="padded">
{versionText()} <Card.Title>project.yaml</Card.Title>
</p> <Card.Body>
<pre>{versionText()}</pre>
</Card.Body>
</Card>
</Container> </Container>
<Footer /> <Footer />
</div> </div>
+10
View File
@@ -1195,6 +1195,7 @@ __metadata:
typescript: "npm:~5.9.3" typescript: "npm:~5.9.3"
typescript-eslint: "npm:^8.48.0" typescript-eslint: "npm:^8.48.0"
vite: "npm:^7.3.1" vite: "npm:^7.3.1"
yaml: "npm:^2.8.2"
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@@ -3072,6 +3073,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"yaml@npm:^2.8.2":
version: 2.8.2
resolution: "yaml@npm:2.8.2"
bin:
yaml: bin.mjs
checksum: 10c0/703e4dc1e34b324aa66876d63618dcacb9ed49f7e7fe9b70f1e703645be8d640f68ab84f12b86df8ac960bac37acf5513e115de7c970940617ce0343c8c9cd96
languageName: node
linkType: hard
"yocto-queue@npm:^0.1.0": "yocto-queue@npm:^0.1.0":
version: 0.1.0 version: 0.1.0
resolution: "yocto-queue@npm:0.1.0" resolution: "yocto-queue@npm:0.1.0"