- Frontend:
React,
tailwind and
∴
a17t
+ return
+
+
+
+ {props.children}
-
-
-
+
+
}
+const Header: React.FC = () => {
+
+ const tokenStorage = React.useContext(TokenContext);
+
+ return
+
+
+
+
+ Panel of Controlness
+
+
+
+
+ API Docs
+
+
+
+
+}
+
+const Footer: React.FC = () => {
+ return
+}
+
+const FooterBadge: React.FC<{
+ text: string,
+ href: string,
+}> = ({ text, href, children }) => {
+ return
+
+ {children}
+
+ {text}
+
+}
+
export default Layout;
\ No newline at end of file
diff --git a/frontend/src/MainView.tsx b/frontend/src/MainView.tsx
deleted file mode 100644
index 67900a0..0000000
--- a/frontend/src/MainView.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
-import Index from "./pages/Index";
-import Page404 from './pages/Page404';
-
-export const MainView: React.FC = () => {
- return
-
- } />
- } />
-
-
-}
-
-export default MainView;
\ No newline at end of file
diff --git a/frontend/src/pages/Index.tsx b/frontend/src/pages/Index.tsx
index 49d3340..7143323 100644
--- a/frontend/src/pages/Index.tsx
+++ b/frontend/src/pages/Index.tsx
@@ -1,5 +1,8 @@
+import { IconProp } from "@fortawesome/fontawesome-svg-core";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { fas } from "fontawesome.macro";
import React, { useEffect, useState } from "react";
-import { Computer, State } from "../proto";
+import { Computer, ComputerType, State } from "../proto";
import { TokenContext } from "../tokenStorage";
export const Index: React.FC = () => {
@@ -24,8 +27,6 @@ export const Index: React.FC = () => {
}, [tokenStorage.token]);
return <>
-
-
State:
{
state
?
@@ -46,17 +47,17 @@ const Groups: React.FC<{ computers: Array
}> = ({ computers }) => {
groupMap.get(computer.group)!.push(computer);
}
- return <>
+ return
{
Array.from(groupMap.entries()).map((entry) => {
const [group, computers] = entry;
- return
-
{group}:
-
+ return
+
{group}:
+
})
}
- >
+
}
@@ -69,7 +70,33 @@ const CardList: React.FC<{ computers: Array
}> = ({ computers }) => {
}
const ComputerCard: React.FC<{ computer: Computer }> = ({ computer }) => {
- return
- {computer.is_advanced ? "advanced " : ""}{computer.type} {computer.label || "(no label)"}
+
+ const typeIcon: Map
= new Map([
+ ["computer", fas`desktop`],
+ ["turtle", fas`pager`],
+ ["pocket", fas`mobile-screen-button`],
+ ]);
+
+ return
+
+
+
+
+
+
+
+ {computer.label || "(no label)"}
+
+ {computer.is_advanced && advanced}
+
+
+ {computer.uuid}
+
+
+
+ Offline
+
+
+
}
\ No newline at end of file
diff --git a/frontend/src/tokenStorage.tsx b/frontend/src/tokenStorage.tsx
index 723c7e5..ffc8a91 100644
--- a/frontend/src/tokenStorage.tsx
+++ b/frontend/src/tokenStorage.tsx
@@ -1,5 +1,4 @@
import React, { useEffect, useMemo, useState } from "react";
-import Login from "./Login";
const LOCAL_STORAGE_KEY = "token";
@@ -48,10 +47,6 @@ export const TokenProvider: React.FC = (props) => {
}, [tokenStorage]);
return
- {
- tokenStorage.token
- ? props.children
- :
- }
+ { props.children }
}
\ No newline at end of file