admin/internet: avoid showing port-mapping dialog when verification was successful without it
Massimo Melina committed
May 12, 2026 at 16:51 UTC
1d29221ec81601b2a81c3cbb2ae0a77a652900a3
1 file changed
+9
-6
admin/src/InternetPage.ts
+9
-6
@@ -316,21 +316,24 @@ export default function InternetPage({ setTitleSide }: PageProps) {
316
const direct = publicIps?.includes(data?.localIp!)
317
return h(Flex, { justifyContent: 'space-around' },
318
h(Device, { name: "Server", icon: direct ? Storage : HomeWorkTwoTone, color: localColor, ip: data?.localIp,
319
- below: port && h(Box, { sx: { fontSize: 'smaller' }, className: 'port ' + HIDE_IN_TESTS }, "port ", port),
319
+ below: port && h(Box, { className: 'port ' + HIDE_IN_TESTS }, "port ", port),
320
}),
321
!direct && h(DataLine),
322
!direct && h(Device, {
323
name: "Router", icon: RouterTwoTone, ip: data?.gatewayIp,
324
color: checkResult ? 'success' : data?.mapped && (wrongMap ? 'warning' : 'success'),
325
below: mapping ? h(LinearProgress, { sx: { height: '1em' } })
326
- : data && h(LinkBtn, { sx: { fontSize: 'smaller', display: 'block' }, onClick: configure },
327
- "port ", wrongMap ? "is wrong" : data?.externalPort || (checkResult ? "verified" : "unknown")),
326
+ : data && (
327
+ checkResult && !data.mapped ? `port ${data.externalPort || data.internalPort}`
328
+ : h(LinkBtn, { sx: { display: 'block' }, onClick: configure },
329
+ "port ", wrongMap ? "is wrong" : data?.externalPort || (checkResult ? "verified" : "unknown"))
330
+ ),
331
}),
332
h(DataLine),
333
h(Device, { name: "Internet", icon: PublicTwoTone, ip: publicIps,
334
color: checkResult ? 'success' : checkResult === false ? 'error' : doubleNat ? 'warning' : undefined,
332
- below: checking ? h(LinearProgress, { sx: { height: '1em' } }) : publicIps && h(Box, { sx: { fontSize: 'smaller' }, className: HIDE_IN_TESTS },
333
- doubleNat && h(LinkBtn, { sx: { display: 'block', fontSize: 'smaller' }, onClick: () => alertDialog(MSG_ISP, 'warning') }, "Double NAT"),
335
+ below: checking ? h(LinearProgress, { sx: { height: '1em' } }) : publicIps && h(Box, { className: HIDE_IN_TESTS },
336
+ doubleNat && h(LinkBtn, { sx: { display: 'block' }, onClick: () => alertDialog(MSG_ISP, 'warning') }, "Double NAT"),
337
checkResult ? "Working!" : checkResult === false ? "Failed!" : '',
338
' ',
339
(baseUrl > '' || publicIps?.length > 0) && data?.internalPort && h(LinkBtn, { onClick: () => verify() }, "Verify")
@@ -476,7 +479,7 @@ function Device({ name, icon, color, ip, below }: any) {
479
h(icon, { color, sx: { fontSize, mb: '-0.1em' } }),
480
h(Box, { sx: { fontSize: 'larger' } }, name),
481
ip === undefined ? h(Skeleton) : h(Box, { sx: { fontSize: 'smaller', whiteSpace: 'pre-wrap' }, className: 'ip ' + HIDE_IN_TESTS }, wantArray(ip).join('\n') || "unknown"),
479
- below ?? h(Skeleton),
482
+ below ? h(Box, { sx: { fontSize: 'smaller' } }, below) : h(Skeleton),
483
)
484
}
485