ux: admin/monitor: hint about proxies
Massimo Melina committed
Nov 3, 2024 at 16:30 UTC
bc87587c23a1449c17b46933e94a93c9243ba1b7
2 files changed
+7
-2
admin/src/App.ts
+1
@@ -17,6 +17,7 @@ import { useEventListener } from 'usehooks-ts'
17
import { AriaOnly, isMac, xlate } from './misc'
18
import { getLocale } from './locale'
19
20
+// always use useMemo with setTitleSide
21
export interface PageProps { setTitleSide: (content: ReactNode) => void }
22
23
function App() {
admin/src/MonitorPage.ts
+6
-2
@@ -4,7 +4,7 @@ import _ from "lodash"
4
import { createElement as h, useMemo, Fragment, useState } from "react"
5
import { apiCall, useApiEvents, useApiEx, useApiList } from "./api"
6
import { LinkOff, Lock, FolderZip, Upload, Download, ChevronRight, ChevronLeft, History } from '@mui/icons-material'
7
-import { Box, Chip, ChipProps, Grid } from '@mui/material'
7
+import { Alert, Box, Chip, ChipProps, Grid } from '@mui/material'
8
import { DataTable } from './DataTable'
9
import {
10
formatBytes, ipForUrl, CFG, formatSpeed, with_, createDurationFormatter, formatTimestamp, formatPerc, md, Callback,
@@ -20,8 +20,12 @@ import { state, useSnapState } from './state'
20
import { useBlockIp } from './useBlockIp'
21
import { alertDialog, confirmDialog } from './dialog'
22
import { useInterval } from 'usehooks-ts'
23
+import { PageProps } from './App'
24
24
-export default function MonitorPage() {
25
+export default function MonitorPage({ setTitleSide }: PageProps) {
26
+ setTitleSide(useMemo(() =>
27
+ h(Alert, { severity: 'info', sx: { display: { xs: 'none', sm: 'inherit' } } }, "If you are behind a proxy, connections list may not match browsers activity"),
28
+ []))
29
return h(Fragment, {},
30
h(MoreInfo),
31
h(Connections),