Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
T0biii committed Mar 11, 2024
1 parent 012718b commit 323e5e6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
5 changes: 1 addition & 4 deletions website/src/components/DeviceListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const DeviceListItem = observer(
{device.name}
</Typography>
}
subheader={"Last seen: " + lastSeen(device.lastHandshakeTime)}
avatar={
<Avatar style={{ backgroundColor: device.connected ? '#76de8a' : '#bdbdbd' }}>
{/* <DonutSmallIcon /> */}
Expand Down Expand Up @@ -83,10 +84,6 @@ export const DeviceListItem = observer(
<td>Disconnected</td>
</tr>
)}
<tr>
<td>Last Seen</td>
<td>{lastSeen(device.lastHandshakeTime)}</td>
</tr>
<tr>
<td>Public key</td>
<td>
Expand Down
5 changes: 1 addition & 4 deletions website/src/components/DeviceListItemSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export function DeviceListItemSkeleton() {
<Card>
<CardHeader
title={<Skeleton variant="text" width={100} />}
subheader={<Skeleton variant="text" width={50} />}
avatar={<Skeleton variant="circular" width={40} height={40} />}
action={<Skeleton variant="text" width={50} />}
/>
Expand All @@ -24,10 +25,6 @@ export function DeviceListItemSkeleton() {
<td>Upload</td>
<td><Skeleton variant="text" width={100} /></td>
</tr>
<tr>
<td>Last Seen</td>
<td><Skeleton variant="text" width={100} /></td>
</tr>
<tr>
<td>Public key</td>
<td><Skeleton variant="text" width={100} /></td>
Expand Down
12 changes: 9 additions & 3 deletions website/src/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import Link from '@mui/material/Link';
import Button from '@mui/material/Button';
import Chip from '@mui/material/Chip';
import VpnKey from '@mui/icons-material/VpnKey';
import IconButton from "@mui/material/IconButton";
import Brightness4Icon from '@mui/icons-material/Brightness4';
import Brightness7Icon from '@mui/icons-material/Brightness7';
import LogoutIcon from '@mui/icons-material/Logout';
import LoginIcon from '@mui/icons-material/Login';
import DevicesIcon from '@mui/icons-material/Devices';
import {useMediaQuery} from "@mui/material";

Expand Down Expand Up @@ -57,12 +57,18 @@ export default function Navigation() {
</Link>
)}

{hasAuthCookie && (
{hasAuthCookie ? (
<Link href="/signout" color="inherit">
<IconButton sx={{ ml: 1 }} color="inherit" title="Logout">
<IconButton sx={{ ml: 1 }} color="inherit" title="Logout">
<LogoutIcon />
</IconButton>
</Link>
) : (
<Link href="/signin" color="inherit">
<IconButton sx={{ ml: 1 }} color="inherit" title="Login">
<LoginIcon />
</IconButton>
</Link>
)}
</Toolbar>
</AppBar>
Expand Down
10 changes: 10 additions & 0 deletions website/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ export default defineConfig({
target: 'http://localhost:8000',
changeOrigin: true,
secure: false
},
'/signin': {
target: 'http://localhost:8000',
changeOrigin: true,
secure: false
},
'/signout': {
target: 'http://localhost:8000',
changeOrigin: true,
secure: false
}
}
}
Expand Down

0 comments on commit 323e5e6

Please sign in to comment.