diff --git a/client/src/Pages/Docker/ContainerDetails/TabLogs.tsx b/client/src/Pages/Docker/ContainerDetails/TabLogs.tsx index e7e29207d..4a7495f9a 100644 --- a/client/src/Pages/Docker/ContainerDetails/TabLogs.tsx +++ b/client/src/Pages/Docker/ContainerDetails/TabLogs.tsx @@ -23,6 +23,7 @@ import { import { useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useToast } from "@/Hooks/UseToast"; +import { useIsAdmin } from "@/Hooks/useIsAdmin"; // Utils import { get } from "@/Utils/ApiClient"; @@ -50,6 +51,7 @@ export const TabLogs = ({ monitorId, containerName, enabled }: TabLogsProps) => const theme = useTheme(); const { t } = useTranslation(); const { toastError } = useToast(); + const isAdmin = useIsAdmin(); // logs is newest-first, matching the API and what flattenDockerLogs expects. const [logs, setLogs] = useState([]); @@ -168,6 +170,15 @@ export const TabLogs = ({ monitorId, containerName, enabled }: TabLogsProps) => } }, [logsUrl, oldestCursor, loadingOlder, t, toastError]); + if (!isAdmin) { + return ( + + ); + } + if (!enabled) { return (