diff --git a/ui100/index.html b/ui100/index.html index c6755520..ea926a4f 100644 --- a/ui100/index.html +++ b/ui100/index.html @@ -8,7 +8,7 @@ - zrok Console UI + zrok API Console
diff --git a/ui100/src/ApiConsole.tsx b/ui100/src/ApiConsole.tsx new file mode 100644 index 00000000..17b8089e --- /dev/null +++ b/ui100/src/ApiConsole.tsx @@ -0,0 +1,26 @@ +import {useEffect, useState} from "react"; +import {MetadataApi} from "./api"; + +const ApiConsole = () => { + const [version, setVersion] = useState("no version set"); + + useEffect(() => { + let api = new MetadataApi(); + api.version() + .then(d => { + setVersion(d); + }) + .catch(e => { + console.log(e); + }); + }, []); + + return ( +
+

zrok

+

{version}

+
+ ); +} + +export default ApiConsole; \ No newline at end of file diff --git a/ui100/src/Console.tsx b/ui100/src/Console.tsx deleted file mode 100644 index 8018f800..00000000 --- a/ui100/src/Console.tsx +++ /dev/null @@ -1,7 +0,0 @@ -const Console = () => { - return ( -

zrok

- ); -} - -export default Console; \ No newline at end of file diff --git a/ui100/src/main.tsx b/ui100/src/main.tsx index c14c226f..0edabe2c 100644 --- a/ui100/src/main.tsx +++ b/ui100/src/main.tsx @@ -1,14 +1,14 @@ import "./index.css"; import {StrictMode} from "react"; import {createRoot} from "react-dom/client"; -import Console from "./Console.tsx"; +import ApiConsole from "./ApiConsole.tsx"; import {ThemeProvider} from "@mui/material"; import {theme} from "./model/theme.ts"; createRoot(document.getElementById('root')!).render( - + ); \ No newline at end of file