mirror of
https://github.com/openziti/zrok.git
synced 2024-11-21 15:43:22 +01:00
more react scaffolding; basic api calls (#724)
This commit is contained in:
parent
4b4522790d
commit
f394074d5c
@ -8,7 +8,7 @@
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>zrok Console UI</title>
|
||||
<title>zrok API Console</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
26
ui100/src/ApiConsole.tsx
Normal file
26
ui100/src/ApiConsole.tsx
Normal file
@ -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 (
|
||||
<div>
|
||||
<h1>zrok</h1>
|
||||
<h2>{version}</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ApiConsole;
|
@ -1,7 +0,0 @@
|
||||
const Console = () => {
|
||||
return (
|
||||
<h1>zrok</h1>
|
||||
);
|
||||
}
|
||||
|
||||
export default Console;
|
@ -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(
|
||||
<StrictMode>
|
||||
<ThemeProvider theme={theme}>
|
||||
<Console />
|
||||
<ApiConsole />
|
||||
</ThemeProvider>
|
||||
</StrictMode>
|
||||
);
|
Loading…
Reference in New Issue
Block a user