diff --git a/web/src/App.tsx b/web/src/App.tsx index 8a0fc58..ba9e1c4 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,4 +1,4 @@ -import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; +import { BrowserRouter, Routes, Route, Navigate, NavLink, Outlet } from 'react-router-dom'; import { useState, useEffect } from 'react'; import Login from './pages/Login'; import Dashboard from './pages/Dashboard'; @@ -20,18 +20,68 @@ function ProtectedRoute({ children }: { children: JSX.Element }) { return authed ? children : ; } +function NavBar() { + const navItems = [ + { to: '/', label: 'Dashboard' }, + { to: '/machines', label: 'Machines' }, + { to: '/sync-pairs', label: 'Sync Pairs' }, + { to: '/jobs', label: 'Jobs' }, + { to: '/ssh-keys', label: 'SSH Keys' }, + { to: '/settings', label: 'Settings' }, + ]; + + return ( + + ); +} + +function Layout() { + return ( +
+ +
+ +
+
+ ); +} + export default function App() { return ( } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> + }> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index de02c5c..363f672 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react'; -import { Link } from 'react-router-dom'; import { api, Machine, Job } from '../api/client'; export default function Dashboard() { @@ -66,11 +65,6 @@ export default function Dashboard() { )} -
- Machines - Sync Pairs - All Jobs -
); } diff --git a/web/src/pages/Machines.tsx b/web/src/pages/Machines.tsx index 6eafbb3..30c2ca3 100644 --- a/web/src/pages/Machines.tsx +++ b/web/src/pages/Machines.tsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react'; -import { Link } from 'react-router-dom'; import { api, Machine, SSHKey } from '../api/client'; export default function Machines() { @@ -77,10 +76,7 @@ export default function Machines() { return (
-
-

Machines

- Manage SSH Keys -
+

Machines

diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index 3ee9592..9ba1cf2 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -1,5 +1,4 @@ import { useState, useEffect } from 'react'; -import { Link } from 'react-router-dom'; export default function Settings() { const [pubKey, setPubKey] = useState(''); @@ -36,14 +35,6 @@ export default function Settings() {
-
-

SSH Keys

-

- Manage SSH key pairs for authenticating to remote machines. Go to the{' '} - SSH Keys page. -

-
-

Quick Reference