Skip to content

Commit d29997a

Browse files
authored
Make discovered device IPs clickable and add a real favicon (#87)
The IP column in Discovered Devices now links to the device web UI in a new tab, matching the device detail page. Replaces the leftover Vite favicon with an SM monogram (SVG with dark-mode variant) plus apple-touch-icon, 192/512 icons and a web manifest for mobile home screens. nginx serves the manifest with its proper MIME type since the alpine image lacks the mapping.
1 parent 791b12a commit d29997a

10 files changed

Lines changed: 60 additions & 4 deletions

File tree

packages/web/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
7+
<link rel="manifest" href="/site.webmanifest" />
68
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
79
<title>Shelly Manager</title>
810
</head>

packages/web/nginx.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ server {
4242
expires -1;
4343
}
4444

45+
# The alpine nginx mime.types has no webmanifest entry, so it would be
46+
# served as application/octet-stream.
47+
location = /site.webmanifest {
48+
default_type application/manifest+json;
49+
expires -1;
50+
}
51+
4552
# Cache static assets
4653
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
4754
expires 1y;
2.52 KB
Loading

packages/web/public/favicon.svg

Lines changed: 12 additions & 0 deletions
Loading

packages/web/public/icon-192.png

2.69 KB
Loading

packages/web/public/icon-512.png

8.99 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Shelly Manager",
3+
"short_name": "Shelly",
4+
"start_url": "/",
5+
"scope": "/",
6+
"icons": [
7+
{
8+
"src": "/icon-192.png",
9+
"sizes": "192x192",
10+
"type": "image/png",
11+
"purpose": "any maskable"
12+
},
13+
{
14+
"src": "/icon-512.png",
15+
"sizes": "512x512",
16+
"type": "image/png",
17+
"purpose": "any maskable"
18+
}
19+
],
20+
"theme_color": "#18181b",
21+
"background_color": "#18181b",
22+
"display": "standalone"
23+
}

packages/web/public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/web/src/components/dashboard/device-table.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
getSortedRowModel,
1414
useReactTable,
1515
} from "@tanstack/react-table";
16-
import { ArrowUpDown, ChevronDown } from "lucide-react";
16+
import { ArrowUpDown, ChevronDown, ExternalLink } from "lucide-react";
1717
import { useTranslation } from "react-i18next";
1818
import { formatDistanceToNow } from "date-fns";
1919

@@ -149,7 +149,19 @@ export function DeviceTable({ devices, onBulkAction }: DeviceTableProps) {
149149
</Button>
150150
),
151151
cell: ({ row }) => (
152-
<div className="font-mono text-sm">{row.getValue("ip")}</div>
152+
<a
153+
href={`http://${row.getValue("ip")}`}
154+
target="_blank"
155+
rel="noopener noreferrer"
156+
onClick={(e) => e.stopPropagation()}
157+
aria-label={t("dashboard.deviceTable.openDeviceUi", {
158+
ip: row.getValue("ip"),
159+
})}
160+
className="font-mono text-sm hover:underline inline-flex items-center gap-1"
161+
>
162+
{row.getValue("ip")}
163+
<ExternalLink className="h-3 w-3 text-muted-foreground" />
164+
</a>
153165
),
154166
},
155167
{

packages/web/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"title": "Discovered Devices",
8484
"description": "Found {{count}} device(s). Click on any row to view device details.",
8585
"ip": "IP Address",
86+
"openDeviceUi": "Open the web UI of {{ip}} in a new tab",
8687
"status": "Firmware Status",
8788
"deviceType": "Device Type",
8889
"deviceName": "Device Name",

0 commit comments

Comments
 (0)