Revert "chore(i18n): close translation gaps across all 16 locales"
This commit is contained in:
1 parent
959e2ff7b8
commit
c6461d2635
81 files changed
+1296
-4046
No files matched your search
@@ -1,18 +1,15 @@
|
||||
import { Stack } from "@mui/material";
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useState, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { HeaderTeamControls } from "./components/HeaderTeamControls";
|
||||
import { TeamTable } from "./components/TeamTable";
|
||||
import { InviteTeamMemberDialog } from "./components/InviteTeamMemberDialog";
|
||||
import { AddTeamMemberDialog } from "./components/AddTeamMemberDialog";
|
||||
import { EmptyState } from "@/Components/design-elements";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
import type { User, UserRole } from "@/Types/User";
|
||||
|
||||
export const TabTeam = () => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const [filter, setFilter] = useState<UserRole | "">("");
|
||||
const [inviteDialogOpen, setInviteDialogOpen] = useState(false);
|
||||
const [addMemberDialogOpen, setAddMemberDialogOpen] = useState(false);
|
||||
@@ -36,9 +33,6 @@ export const TabTeam = () => {
|
||||
refetch();
|
||||
};
|
||||
|
||||
const totalUsers = users?.length ?? 0;
|
||||
const noUsers = users !== undefined && totalUsers === 0;
|
||||
|
||||
return (
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<HeaderTeamControls
|
||||
@@ -47,15 +41,7 @@ export const TabTeam = () => {
|
||||
onInviteClick={handleOpenInviteDialog}
|
||||
onAddMemberClick={handleOpenAddMemberDialog}
|
||||
/>
|
||||
{noUsers ? (
|
||||
<EmptyState
|
||||
fullscreen
|
||||
title={t("pages.account.team.fallback.title")}
|
||||
description={t("pages.account.team.fallback.description")}
|
||||
/>
|
||||
) : (
|
||||
<TeamTable users={filteredUsers} />
|
||||
)}
|
||||
<TeamTable users={filteredUsers} />
|
||||
<InviteTeamMemberDialog
|
||||
open={inviteDialogOpen}
|
||||
onClose={handleCloseInviteDialog}
|
||||
|
||||
@@ -2,10 +2,8 @@ import Typography from "@mui/material/Typography";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Table } from "@/Components/design-elements";
|
||||
import { Pagination } from "@/Components/design-elements/Table";
|
||||
import type { Header } from "@/Components/design-elements/Table";
|
||||
import { useIsAdmin } from "@/Hooks/useIsAdmin";
|
||||
import { useClientPagination } from "@/Hooks/useClientPagination";
|
||||
import type { User } from "@/Types/User";
|
||||
|
||||
interface TeamTableProps {
|
||||
@@ -16,7 +14,6 @@ export const TeamTable = ({ users }: TeamTableProps) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const isAdmin = useIsAdmin();
|
||||
const { pagedRows, paginationProps } = useClientPagination(users);
|
||||
|
||||
const headers: Header<User>[] = [
|
||||
{
|
||||
@@ -54,13 +51,10 @@ export const TeamTable = ({ users }: TeamTableProps) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table
|
||||
headers={headers}
|
||||
data={pagedRows}
|
||||
onRowClick={isAdmin ? handleRowClick : undefined}
|
||||
/>
|
||||
{users.length > 0 && <Pagination {...paginationProps} />}
|
||||
</>
|
||||
<Table
|
||||
headers={headers}
|
||||
data={users}
|
||||
onRowClick={isAdmin ? handleRowClick : undefined}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -25,7 +25,7 @@ const Account = ({ open = "profile" }: AccountProps) => {
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<BasePage headerKey="account">
|
||||
<BasePage>
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onChange={(_, newValue: number) => setActiveTab(newValue)}
|
||||
|
||||
@@ -95,23 +95,7 @@ const RegisterPage = () => {
|
||||
title={t("pages.auth.register.title")}
|
||||
subtitle={t("pages.auth.register.subtitle")}
|
||||
>
|
||||
{!token && (
|
||||
<Alert
|
||||
severity="info"
|
||||
icon={false}
|
||||
sx={(theme) => ({
|
||||
fontSize: 13,
|
||||
lineHeight: 1.55,
|
||||
color: theme.palette.text.secondary,
|
||||
backgroundColor: theme.palette.action.hover,
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
borderRadius: 1,
|
||||
"& .MuiAlert-message": { padding: 0 },
|
||||
})}
|
||||
>
|
||||
{t("pages.auth.register.setupNotice")}
|
||||
</Alert>
|
||||
)}
|
||||
{!token && <Alert severity="info">{t("pages.auth.register.setupNotice")}</Alert>}
|
||||
<Controller
|
||||
name="firstName"
|
||||
control={control}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import {
|
||||
BasePage,
|
||||
EmptyState,
|
||||
TotalChecksBox,
|
||||
UpChecksBox,
|
||||
DownChecksBox,
|
||||
@@ -103,19 +102,8 @@ const Checks = () => {
|
||||
const downChecks = summaryResponse?.downChecks || 0;
|
||||
const upChecks = totalChecks - (summaryResponse?.downChecks || 0);
|
||||
|
||||
const noMonitors = !isLoadingMonitors && (monitorsResponse?.length ?? 0) === 0;
|
||||
if (noMonitors) {
|
||||
return (
|
||||
<EmptyState
|
||||
fullscreen
|
||||
title={t("pages.checks.fallback.title")}
|
||||
description={t("pages.checks.fallback.description")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<BasePage headerKey="checks">
|
||||
<BasePage>
|
||||
<Stack
|
||||
direction={{ xs: "column", md: "row" }}
|
||||
gap={4}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BasePage, EmptyState } from "@/Components/design-elements";
|
||||
import { BasePage } from "@/Components/design-elements";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Divider from "@mui/material/Divider";
|
||||
@@ -153,20 +153,8 @@ const IncidentsPage = () => {
|
||||
refetchSummary();
|
||||
};
|
||||
|
||||
const trulyEmpty = summaryData !== undefined && (summaryData?.total ?? 0) === 0;
|
||||
|
||||
if (trulyEmpty) {
|
||||
return (
|
||||
<EmptyState
|
||||
fullscreen
|
||||
title={t("pages.incidents.fallback.title")}
|
||||
description={t("pages.incidents.fallback.description")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<BasePage headerKey="incidents">
|
||||
<BasePage>
|
||||
<Stack
|
||||
direction={{ xs: "column", md: "row" }}
|
||||
gap={theme.spacing(8)}
|
||||
@@ -183,7 +171,7 @@ const IncidentsPage = () => {
|
||||
setSelectedResolutionType={setFilter}
|
||||
onClearFilters={handleClearFilters}
|
||||
/>
|
||||
{activeIncidentsCount > 0 && (
|
||||
{activeIncidentsCount > 0 ? (
|
||||
<>
|
||||
<Typography
|
||||
variant="h6"
|
||||
@@ -205,6 +193,13 @@ const IncidentsPage = () => {
|
||||
/>
|
||||
<Divider />
|
||||
</>
|
||||
) : (
|
||||
<Typography
|
||||
variant="body1"
|
||||
sx={{ mb: theme.spacing(4), color: theme.palette.success.main }}
|
||||
>
|
||||
{t("pages.incidents.summaryCard.activeIncidents.active_zero")}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
<Typography
|
||||
|
||||
@@ -122,7 +122,6 @@ const InfrastructureMonitors = () => {
|
||||
|
||||
return (
|
||||
<MonitorBasePageWithStates
|
||||
headerKey="infrastructure"
|
||||
loading={isLoading}
|
||||
error={monitorsWithChecksError}
|
||||
totalCount={effectiveTotalCount}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { Stats } from "@/Pages/Logs/components/Stats";
|
||||
import { StatGauges } from "@/Pages/Logs/components/StatGauges";
|
||||
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
import type { Diagnostics } from "@/Types/Diagnostics";
|
||||
|
||||
export const TabDiagnostics = () => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
data: diagnostics,
|
||||
isLoading: _isLoading,
|
||||
@@ -19,35 +16,9 @@ export const TabDiagnostics = () => {
|
||||
} = useGet<Diagnostics>("/diagnostic/system", {}, { refreshInterval: 5000 });
|
||||
|
||||
return (
|
||||
<Stack gap={theme.spacing(12)}>
|
||||
<Stack gap={theme.spacing(4)}>
|
||||
<Stack gap={theme.spacing(1)}>
|
||||
<Typography
|
||||
variant="eyebrow"
|
||||
color="text.secondary"
|
||||
>
|
||||
{t("pages.logs.diagnostics.sections.runtimeStats.title")}
|
||||
</Typography>
|
||||
<Typography color={theme.palette.text.secondary}>
|
||||
{t("pages.logs.diagnostics.sections.runtimeStats.description")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Stats diagnostics={diagnostics} />
|
||||
</Stack>
|
||||
<Stack gap={theme.spacing(4)}>
|
||||
<Stack gap={theme.spacing(1)}>
|
||||
<Typography
|
||||
variant="eyebrow"
|
||||
color="text.secondary"
|
||||
>
|
||||
{t("pages.logs.diagnostics.sections.memoryCpu.title")}
|
||||
</Typography>
|
||||
<Typography color={theme.palette.text.secondary}>
|
||||
{t("pages.logs.diagnostics.sections.memoryCpu.description")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<StatGauges diagnostics={diagnostics} />
|
||||
</Stack>
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<Stats diagnostics={diagnostics} />
|
||||
<StatGauges diagnostics={diagnostics} />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
@@ -4,7 +4,6 @@ import Typography from "@mui/material/Typography";
|
||||
import { useSelector } from "react-redux";
|
||||
import { Select } from "@/Components/inputs";
|
||||
import { TableLogs } from "@/Pages/Logs/components/TableLogs";
|
||||
import { EmptyState } from "@/Components/design-elements";
|
||||
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useGet } from "@/Hooks/UseApi";
|
||||
@@ -16,7 +15,7 @@ import type { RootState } from "@/Types/state";
|
||||
|
||||
export const TabLogs = () => {
|
||||
const theme = useTheme();
|
||||
const { data: logs, isLoading } = useGet<Log[]>("/logs");
|
||||
const { data: logs } = useGet<Log[]>("/logs");
|
||||
const [selectedLogLevel, setSelectedLogLevel] = useState<LogLevelOption>("all");
|
||||
const [page, setPage] = useState(0);
|
||||
const rowsPerPage = useSelector(
|
||||
@@ -34,16 +33,6 @@ export const TabLogs = () => {
|
||||
const paginatedLogs =
|
||||
filteredLogs?.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) ?? [];
|
||||
|
||||
if (!isLoading && (logs?.length ?? 0) === 0) {
|
||||
return (
|
||||
<EmptyState
|
||||
fullscreen
|
||||
title={t("pages.logs.fallback.title")}
|
||||
description={t("pages.logs.fallback.description")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<Select
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
import { TableJobs, TableFailedJobs } from "./components/TableJobs";
|
||||
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useTranslation, Trans } from "react-i18next";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useGet, usePost } from "@/Hooks/UseApi";
|
||||
import type { QueueData } from "@/Types/Queue";
|
||||
import { Metrics } from "@/Pages/Logs/components/Metrics";
|
||||
import { Button } from "@/Components/inputs";
|
||||
import { EmptyState } from "@/Components/design-elements";
|
||||
|
||||
export const TabQueue = () => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
data: queueData,
|
||||
isLoading,
|
||||
// isLoading,
|
||||
// error,
|
||||
refetch,
|
||||
} = useGet<QueueData>("/queue/all-metrics", {}, { refreshInterval: 5000 });
|
||||
@@ -25,17 +23,6 @@ export const TabQueue = () => {
|
||||
|
||||
const jobs = queueData?.jobs ?? [];
|
||||
const metrics = queueData?.metrics ?? null;
|
||||
const hasNeverRun = !isLoading && metrics !== null && (metrics.totalRuns ?? 0) === 0;
|
||||
const noQueueData = !isLoading && metrics === null && jobs.length === 0;
|
||||
if (hasNeverRun || noQueueData) {
|
||||
return (
|
||||
<EmptyState
|
||||
fullscreen
|
||||
title={t("pages.logs.queueFallback.title")}
|
||||
description={t("pages.logs.queueFallback.description")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const handleFlushQueue = async () => {
|
||||
await post("/queue/flush", {});
|
||||
@@ -43,65 +30,22 @@ export const TabQueue = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Stack gap={theme.spacing(16)}>
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<Metrics metrics={metrics} />
|
||||
<Stack gap={theme.spacing(3)}>
|
||||
<Stack gap={theme.spacing(1)}>
|
||||
<Typography
|
||||
variant="eyebrow"
|
||||
color="text.secondary"
|
||||
>
|
||||
{t("pages.logs.jobQueue")}
|
||||
</Typography>
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: 13,
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
<Trans
|
||||
i18nKey="pages.logs.jobQueueExplainer"
|
||||
components={{
|
||||
highlight: (
|
||||
<Box
|
||||
component="span"
|
||||
sx={{
|
||||
backgroundColor:
|
||||
theme.palette.mode === "dark"
|
||||
? "rgba(19, 113, 91, 0.18)"
|
||||
: "#ECF7F2",
|
||||
color: theme.palette.text.primary,
|
||||
px: 1,
|
||||
py: 0.25,
|
||||
borderRadius: 0.5,
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</Stack>
|
||||
<TableJobs jobs={jobs} />
|
||||
</Stack>
|
||||
<Stack gap={theme.spacing(3)}>
|
||||
<Stack gap={theme.spacing(1)}>
|
||||
<Typography
|
||||
variant="eyebrow"
|
||||
color="text.secondary"
|
||||
>
|
||||
{t("pages.logs.failedJobs")}
|
||||
</Typography>
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: 13,
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
{t("pages.logs.failedJobsExplainer")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<TableFailedJobs metrics={metrics} />
|
||||
</Stack>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{ textTransform: "uppercase" }}
|
||||
>
|
||||
{t("pages.logs.jobQueue")}
|
||||
</Typography>
|
||||
<TableJobs jobs={jobs} />
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{ textTransform: "uppercase" }}
|
||||
>
|
||||
{t("pages.logs.failedJobs")}
|
||||
</Typography>
|
||||
<TableFailedJobs metrics={metrics} />
|
||||
<Stack alignItems={"flex-end"}>
|
||||
<Button
|
||||
variant="contained"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { DetailGauge } from "@/Components/design-elements";
|
||||
|
||||
import { getPercentage, formatPercentageFromWhole } from "@/Utils/FormatUtils";
|
||||
@@ -11,78 +11,62 @@ interface StatGaugesProps {
|
||||
diagnostics: Diagnostics | null;
|
||||
}
|
||||
|
||||
const PLACEHOLDER = "—";
|
||||
|
||||
export const StatGauges = ({ diagnostics }: StatGaugesProps) => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
if (!diagnostics) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const heapTotalSize = diagnostics
|
||||
? getPercentage(
|
||||
diagnostics.v8HeapStats?.totalHeapSizeBytes,
|
||||
diagnostics.v8HeapStats?.heapSizeLimitBytes
|
||||
)
|
||||
: 0;
|
||||
const heapUsedSize = diagnostics
|
||||
? getPercentage(
|
||||
diagnostics.v8HeapStats?.usedHeapSizeBytes,
|
||||
diagnostics.v8HeapStats?.heapSizeLimitBytes
|
||||
)
|
||||
: 0;
|
||||
const actualHeapUsed = diagnostics
|
||||
? getPercentage(
|
||||
diagnostics.v8HeapStats?.usedHeapSizeBytes,
|
||||
diagnostics.v8HeapStats?.totalHeapSizeBytes
|
||||
)
|
||||
: 0;
|
||||
const cpuUsage = diagnostics?.cpuUsage?.usagePercentage ?? 0;
|
||||
const heapTotalSize = getPercentage(
|
||||
diagnostics?.v8HeapStats?.totalHeapSizeBytes,
|
||||
diagnostics?.v8HeapStats?.heapSizeLimitBytes
|
||||
);
|
||||
|
||||
const fmt = (n: number) => (diagnostics ? formatPercentageFromWhole(n) : PLACEHOLDER);
|
||||
const bytes = (n: number | undefined) =>
|
||||
diagnostics ? prettyBytes(n ?? 0) : PLACEHOLDER;
|
||||
const heapUsedSize = getPercentage(
|
||||
diagnostics?.v8HeapStats?.usedHeapSizeBytes,
|
||||
diagnostics?.v8HeapStats?.heapSizeLimitBytes
|
||||
);
|
||||
|
||||
const actualHeapUsed = getPercentage(
|
||||
diagnostics?.v8HeapStats?.usedHeapSizeBytes,
|
||||
diagnostics?.v8HeapStats?.totalHeapSizeBytes
|
||||
);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: "grid",
|
||||
gridTemplateColumns: { xs: "1fr", md: "repeat(4, 1fr)" },
|
||||
gap: theme.spacing(8),
|
||||
"& > *": { width: "100% !important" },
|
||||
}}
|
||||
<Stack
|
||||
direction={{ xs: "column", md: "row" }}
|
||||
gap={theme.spacing(8)}
|
||||
>
|
||||
<DetailGauge
|
||||
maxWidth={9999}
|
||||
title={t("pages.logs.diagnostics.gauges.heapAllocation")}
|
||||
progress={heapTotalSize}
|
||||
upperValue={fmt(heapTotalSize)}
|
||||
upperValue={formatPercentageFromWhole(heapTotalSize)}
|
||||
lowerLabel={t("pages.logs.diagnostics.gauges.total")}
|
||||
lowerValue={bytes(diagnostics?.v8HeapStats?.heapSizeLimitBytes)}
|
||||
lowerValue={prettyBytes(diagnostics.v8HeapStats?.heapSizeLimitBytes ?? 0)}
|
||||
/>
|
||||
<DetailGauge
|
||||
maxWidth={9999}
|
||||
title={t("pages.logs.diagnostics.gauges.heapUsage")}
|
||||
progress={heapUsedSize}
|
||||
upperLabel={t("pages.logs.diagnostics.gauges.availableMemoryPercentage")}
|
||||
upperValue={fmt(heapUsedSize)}
|
||||
upperValue={formatPercentageFromWhole(heapUsedSize)}
|
||||
lowerLabel={t("pages.logs.diagnostics.gauges.used")}
|
||||
lowerValue={bytes(diagnostics?.v8HeapStats?.usedHeapSizeBytes)}
|
||||
lowerValue={prettyBytes(diagnostics.v8HeapStats?.usedHeapSizeBytes ?? 0)}
|
||||
/>
|
||||
<DetailGauge
|
||||
maxWidth={9999}
|
||||
title={t("pages.logs.diagnostics.gauges.heapUtilization")}
|
||||
progress={actualHeapUsed}
|
||||
upperLabel={t("pages.logs.diagnostics.gauges.allocatedPercentage")}
|
||||
upperValue={fmt(actualHeapUsed)}
|
||||
upperValue={formatPercentageFromWhole(actualHeapUsed)}
|
||||
lowerLabel={t("pages.logs.diagnostics.gauges.total")}
|
||||
lowerValue={bytes(diagnostics?.v8HeapStats?.usedHeapSizeBytes)}
|
||||
lowerValue={prettyBytes(diagnostics.v8HeapStats?.usedHeapSizeBytes ?? 0)}
|
||||
/>
|
||||
<DetailGauge
|
||||
maxWidth={9999}
|
||||
title={t("pages.logs.diagnostics.gauges.instantCpuUsage")}
|
||||
progress={cpuUsage}
|
||||
progress={diagnostics.cpuUsage?.usagePercentage ?? 0}
|
||||
upperLabel={t("pages.logs.diagnostics.gauges.usedSPercentage")}
|
||||
upperValue={fmt(cpuUsage)}
|
||||
upperValue={formatPercentageFromWhole(diagnostics.cpuUsage?.usagePercentage ?? 0)}
|
||||
/>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { StatBox } from "@/Components/design-elements";
|
||||
|
||||
import prettyBytes from "pretty-bytes";
|
||||
@@ -11,59 +11,41 @@ interface StatsProps {
|
||||
diagnostics: Diagnostics | null;
|
||||
}
|
||||
|
||||
const PLACEHOLDER = "—";
|
||||
|
||||
export const Stats = ({ diagnostics }: StatsProps) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
|
||||
const eventLoopDelay = diagnostics
|
||||
? prettyMilliseconds(diagnostics.eventLoopDelayMs ?? 0, {
|
||||
millisecondsDecimalDigits: 2,
|
||||
})
|
||||
: PLACEHOLDER;
|
||||
const uptime = diagnostics
|
||||
? prettyMilliseconds(diagnostics.uptimeMs ?? 0, { hideSeconds: true })
|
||||
: PLACEHOLDER;
|
||||
const usedHeap = diagnostics
|
||||
? prettyBytes(diagnostics.v8HeapStats?.usedHeapSizeBytes ?? 0)
|
||||
: PLACEHOLDER;
|
||||
const totalHeap = diagnostics
|
||||
? prettyBytes(diagnostics.v8HeapStats?.totalHeapSizeBytes ?? 0)
|
||||
: PLACEHOLDER;
|
||||
const osMemory = diagnostics
|
||||
? prettyBytes(diagnostics.osStats?.totalMemoryBytes ?? 0)
|
||||
: PLACEHOLDER;
|
||||
if (!diagnostics) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: "grid",
|
||||
gridTemplateColumns: { xs: "1fr", md: "repeat(5, 1fr)" },
|
||||
gap: theme.spacing(8),
|
||||
"& > *": { width: "100% !important" },
|
||||
}}
|
||||
<Stack
|
||||
direction={{ xs: "column", md: "row" }}
|
||||
gap={theme.spacing(8)}
|
||||
>
|
||||
<StatBox
|
||||
title={t("pages.logs.diagnostics.stats.eventLoopDelay")}
|
||||
subtitle={eventLoopDelay}
|
||||
subtitle={prettyMilliseconds(diagnostics.eventLoopDelayMs ?? 0, {
|
||||
millisecondsDecimalDigits: 2,
|
||||
})}
|
||||
/>
|
||||
<StatBox
|
||||
title={t("pages.logs.diagnostics.stats.uptime")}
|
||||
subtitle={uptime}
|
||||
subtitle={prettyMilliseconds(diagnostics.uptimeMs ?? 0, { hideSeconds: true })}
|
||||
/>
|
||||
<StatBox
|
||||
title={t("pages.logs.diagnostics.stats.usedHeapSize")}
|
||||
subtitle={usedHeap}
|
||||
subtitle={prettyBytes(diagnostics.v8HeapStats?.usedHeapSizeBytes ?? 0)}
|
||||
/>
|
||||
<StatBox
|
||||
title={t("pages.logs.diagnostics.stats.totalHeapSize")}
|
||||
subtitle={totalHeap}
|
||||
subtitle={prettyBytes(diagnostics.v8HeapStats?.totalHeapSizeBytes ?? 0)}
|
||||
/>
|
||||
<StatBox
|
||||
title={t("pages.logs.diagnostics.stats.osMemoryLimit")}
|
||||
subtitle={osMemory}
|
||||
subtitle={prettyBytes(diagnostics.osStats?.totalMemoryBytes ?? 0)}
|
||||
/>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
@@ -22,92 +22,77 @@ export const TableJobs = ({ jobs }: TableJobsProps) => {
|
||||
id: job.monitorId,
|
||||
}));
|
||||
|
||||
const cellSx = {
|
||||
whiteSpace: "nowrap" as const,
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
maxWidth: 220,
|
||||
};
|
||||
|
||||
const headers: Header<QueueJobWithId>[] = [
|
||||
{
|
||||
id: "id",
|
||||
content: t("common.table.headers.monitorId"),
|
||||
render: (row) => (
|
||||
<Typography
|
||||
fontFamily={theme.typography.fontFamilyMonospace}
|
||||
title={String(row.monitorId)}
|
||||
sx={cellSx}
|
||||
>
|
||||
{row.monitorId}
|
||||
</Typography>
|
||||
),
|
||||
render: (row) => <Typography fontFamily={"monospace"}>{row.monitorId}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "url",
|
||||
content: t("common.table.headers.url"),
|
||||
render: (row) => (
|
||||
<Typography title={row.monitorUrl ?? ""} sx={cellSx}>
|
||||
{row.monitorUrl}
|
||||
</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "type",
|
||||
content: t("common.table.headers.type"),
|
||||
render: (row) => <Typography sx={cellSx}>{row.monitorType}</Typography>,
|
||||
render: (row) => <Typography>{row.monitorUrl}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "interval",
|
||||
content: t("common.table.headers.interval"),
|
||||
render: (row) => (
|
||||
<Typography sx={cellSx}>{prettyMilliseconds(row.monitorInterval ?? 0)}</Typography>
|
||||
<Typography>{prettyMilliseconds(row.monitorInterval ?? 0)}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "type",
|
||||
content: t("common.table.headers.type"),
|
||||
render: (row) => <Typography>{row.monitorType}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "active",
|
||||
content: t("common.table.headers.active"),
|
||||
render: (row) => <Typography>{row.active.toString()}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "runCount",
|
||||
content: t("pages.logs.table.headers.runCount"),
|
||||
render: (row) => <Typography>{row.runCount}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "failCount",
|
||||
content: t("pages.logs.table.headers.failCount"),
|
||||
render: (row) => <Typography>{row.failCount}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "lastRun",
|
||||
content: t("pages.logs.table.headers.lastRunAt"),
|
||||
render: (row) => {
|
||||
const v = formatTimestamp(row.lastRunAt) ?? "-";
|
||||
return (
|
||||
<Typography title={v} sx={cellSx}>
|
||||
{v}
|
||||
</Typography>
|
||||
);
|
||||
},
|
||||
render: (row) => <Typography>{formatTimestamp(row.lastRunAt)}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "lockedAt",
|
||||
content: t("pages.logs.table.headers.lockedAt"),
|
||||
render: (row) => <Typography>{formatTimestamp(row.lockedAt)}</Typography>,
|
||||
},
|
||||
|
||||
{
|
||||
id: "lastFinish",
|
||||
content: t("pages.logs.table.headers.lastFinishedAt"),
|
||||
render: (row) => <Typography>{formatTimestamp(row.lastFinishedAt)}</Typography>,
|
||||
},
|
||||
{
|
||||
id: "lastRunTook",
|
||||
content: t("pages.logs.table.headers.lastRunTook"),
|
||||
render: (row) => {
|
||||
const value = row.lastRunTook ? prettyMilliseconds(row.lastRunTook) : "-";
|
||||
return <Typography sx={cellSx}>{value}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "lockedAt",
|
||||
content: t("pages.logs.table.headers.lockedAt"),
|
||||
render: (row) => {
|
||||
const v = formatTimestamp(row.lockedAt) ?? "-";
|
||||
return (
|
||||
<Typography title={v} sx={cellSx}>
|
||||
{v}
|
||||
</Typography>
|
||||
);
|
||||
return <Typography>{value}</Typography>;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const isDark = theme.palette.mode === "dark";
|
||||
const runningBg = isDark ? "rgba(19, 113, 91, 0.18)" : "#ECF7F2";
|
||||
|
||||
return (
|
||||
<Table
|
||||
headers={headers}
|
||||
data={jobsWithId}
|
||||
getRowSx={(row) => ({
|
||||
...(row.lockedAt && {
|
||||
"& td": { backgroundColor: runningBg },
|
||||
"& td": { backgroundColor: theme.palette.success.light },
|
||||
}),
|
||||
})}
|
||||
/>
|
||||
@@ -121,7 +106,6 @@ interface TableFailedJobsProps {
|
||||
}
|
||||
export const TableFailedJobs = ({ metrics }: TableFailedJobsProps) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
if (!metrics) {
|
||||
return null;
|
||||
}
|
||||
@@ -138,11 +122,7 @@ export const TableFailedJobs = ({ metrics }: TableFailedJobsProps) => {
|
||||
id: "monitorId",
|
||||
content: t("common.table.headers.monitorId"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Typography fontFamily={theme.typography.fontFamilyMonospace}>
|
||||
{row.monitorId}
|
||||
</Typography>
|
||||
);
|
||||
return <Typography fontFamily={"monospace"}>{row.monitorId}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@ const LevelBadge = ({ level }: { level: LogLevel }) => {
|
||||
|
||||
export const TableLogs = ({ logs, logCount, page, setPage }: TableLogsProps) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const dispatch = useDispatch();
|
||||
const rowsPerPage = useSelector(
|
||||
(state: RootState) => state?.ui?.logs?.rowsPerPage ?? 15
|
||||
@@ -56,7 +55,7 @@ export const TableLogs = ({ logs, logCount, page, setPage }: TableLogsProps) =>
|
||||
id: "timestamp",
|
||||
content: t("pages.logs.table.headers.timestamp"),
|
||||
render: (row) => (
|
||||
<Typography sx={{ fontFamily: theme.typography.fontFamilyMonospace }}>
|
||||
<Typography sx={{ fontFamily: "monospace" }}>
|
||||
{formatTimestamp(row.timestamp)}
|
||||
</Typography>
|
||||
),
|
||||
@@ -75,9 +74,7 @@ export const TableLogs = ({ logs, logCount, page, setPage }: TableLogsProps) =>
|
||||
id: "method",
|
||||
content: t("pages.logs.table.headers.method"),
|
||||
render: (row) => (
|
||||
<Typography fontFamily={theme.typography.fontFamilyMonospace}>
|
||||
{row.method || "-"}
|
||||
</Typography>
|
||||
<Typography fontFamily={"monospace"}>{row.method || "-"}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ const LogsPage = () => {
|
||||
const { t } = useTranslation();
|
||||
const [activeTab, setActiveTab] = useState<number>(1);
|
||||
return (
|
||||
<BasePage headerKey="logs">
|
||||
<BasePage>
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onChange={(_, newValue: number) => setActiveTab(newValue)}
|
||||
|
||||
@@ -32,10 +32,11 @@ const MaintenanceWindowPage = () => {
|
||||
|
||||
return (
|
||||
<BasePageWithStates
|
||||
headerKey="maintenanceWindow"
|
||||
page={t("pages.maintenanceWindow.fallback.title")}
|
||||
totalCount={maintenanceWindowCount}
|
||||
description={t("pages.maintenanceWindow.fallback.description")}
|
||||
bullets={
|
||||
t("pages.maintenanceWindow.fallback.checks", { returnObjects: true }) as string[]
|
||||
}
|
||||
loading={isLoading}
|
||||
error={!!error}
|
||||
actionButtonText={t("pages.maintenanceWindow.fallback.actionButton")}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { ActionsMenu, type ActionMenuItem } from "@/Components/actions-menu";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import type { Header } from "@/Components/design-elements/Table";
|
||||
import { Table } from "@/Components/design-elements";
|
||||
import { Pagination } from "@/Components/design-elements/Table";
|
||||
import { useClientPagination } from "@/Hooks/useClientPagination";
|
||||
|
||||
import type { Notification } from "@/Types/Notification";
|
||||
import { useNavigate } from "react-router";
|
||||
@@ -23,7 +20,6 @@ export const NotificationsTable = ({
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const { pagedRows, paginationProps } = useClientPagination(notifications);
|
||||
|
||||
const getActions = (channel: Notification): ActionMenuItem[] => {
|
||||
return [
|
||||
@@ -72,23 +68,7 @@ export const NotificationsTable = ({
|
||||
id: "destination",
|
||||
content: t("pages.notifications.table.headers.destination"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Box sx={{ maxWidth: 320, mx: "auto" }}>
|
||||
<Typography
|
||||
title={row?.address}
|
||||
sx={{
|
||||
direction: "rtl",
|
||||
textAlign: "left",
|
||||
unicodeBidi: "plaintext",
|
||||
whiteSpace: "nowrap",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
}}
|
||||
>
|
||||
{row?.address}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
return <Typography>{row?.address}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -102,16 +82,15 @@ export const NotificationsTable = ({
|
||||
return headers;
|
||||
};
|
||||
|
||||
const headers = getHeaders();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Table
|
||||
headers={getHeaders()}
|
||||
data={pagedRows}
|
||||
onRowClick={(row) => {
|
||||
navigate(`/notifications/configure/${row.id}`);
|
||||
}}
|
||||
/>
|
||||
{notifications.length > 0 && <Pagination {...paginationProps} />}
|
||||
</>
|
||||
<Table
|
||||
headers={headers}
|
||||
data={notifications}
|
||||
onRowClick={(row) => {
|
||||
navigate(`/notifications/configure/${row.id}`);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -39,9 +39,10 @@ const NotificationsPage = () => {
|
||||
|
||||
return (
|
||||
<BasePageWithStates
|
||||
headerKey="notifications"
|
||||
page={t("pages.notifications.fallback.title")}
|
||||
description={t("pages.notifications.fallback.description")}
|
||||
bullets={
|
||||
t("pages.notifications.fallback.checks", { returnObjects: true }) as string[]
|
||||
}
|
||||
loading={isLoading || isValidating}
|
||||
error={!!error}
|
||||
totalCount={notifications?.length ?? 0}
|
||||
|
||||
@@ -77,7 +77,6 @@ const PageSpeedMonitorsPage = () => {
|
||||
|
||||
return (
|
||||
<MonitorBasePageWithStates
|
||||
headerKey="pageSpeed"
|
||||
loading={isLoading}
|
||||
error={monitorsError || settingsError}
|
||||
totalCount={summary?.totalMonitors ?? 0}
|
||||
|
||||
@@ -24,7 +24,6 @@ import type { SettingsFormData, SettingsFormInput } from "@/Validation/settings"
|
||||
import { useState } from "react";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { TextField, Button, FieldLabel, SliderWithLabel } from "@/Components/inputs";
|
||||
import { languageNames } from "@/Components/inputs/LanguageSelector";
|
||||
import { Box, Typography } from "@mui/material";
|
||||
import { useDelete } from "@/Hooks/UseApi";
|
||||
|
||||
@@ -278,7 +277,6 @@ export const SettingsPage = () => {
|
||||
|
||||
return (
|
||||
<BasePage
|
||||
headerKey="settings"
|
||||
component="form"
|
||||
onSubmit={form.handleSubmit(onSubmit, onError)}
|
||||
>
|
||||
@@ -328,7 +326,7 @@ export const SettingsPage = () => {
|
||||
key={lang}
|
||||
value={lang}
|
||||
>
|
||||
{languageNames[lang] ?? lang}
|
||||
{lang.toUpperCase()}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
@@ -580,11 +578,11 @@ export const SettingsPage = () => {
|
||||
<Box
|
||||
component="pre"
|
||||
sx={{
|
||||
fontFamily: theme.typography.fontFamilyMonospace,
|
||||
fontFamily: "monospace",
|
||||
p: 2,
|
||||
borderRadius: 1,
|
||||
overflow: "auto",
|
||||
backgroundColor: theme.palette.action.hover,
|
||||
backgroundColor: theme.palette.mode === "dark" ? "#1e1e1e" : "#f5f5f5",
|
||||
}}
|
||||
>
|
||||
<code>
|
||||
@@ -976,13 +974,19 @@ export const SettingsPage = () => {
|
||||
loading={isDeletingAllMonitors}
|
||||
/>
|
||||
|
||||
{/* Sticky Save Button */}
|
||||
<Stack
|
||||
direction="row"
|
||||
justifyContent="flex-end"
|
||||
sx={{
|
||||
position: "sticky",
|
||||
bottom: 0,
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
borderTop: `1px solid ${theme.palette.divider}`,
|
||||
padding: theme.spacing(LAYOUT.MD),
|
||||
marginLeft: theme.spacing(-LAYOUT.MD),
|
||||
marginRight: theme.spacing(-LAYOUT.MD),
|
||||
marginBottom: theme.spacing(-LAYOUT.MD),
|
||||
zIndex: 1000,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -2,9 +2,7 @@ import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { Table, type Header, ValueLabel } from "@/Components/design-elements";
|
||||
import { Pagination } from "@/Components/design-elements/Table";
|
||||
import { ActionsMenu, type ActionMenuItem } from "@/Components/actions-menu";
|
||||
import { useClientPagination } from "@/Hooks/useClientPagination";
|
||||
import { ExternalLink } from "lucide-react";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -25,7 +23,6 @@ export const StatusPagesTable = ({
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
const { pagedRows, paginationProps } = useClientPagination(data);
|
||||
|
||||
const getActions = (row: StatusPage): ActionMenuItem[] => {
|
||||
return [
|
||||
@@ -136,11 +133,10 @@ export const StatusPagesTable = ({
|
||||
<Box>
|
||||
<Table
|
||||
headers={getHeaders()}
|
||||
data={pagedRows}
|
||||
data={data}
|
||||
onRowClick={handleRowClick}
|
||||
emptyViewText={t("common.table.empty")}
|
||||
/>
|
||||
{data.length > 0 && <Pagination {...paginationProps} />}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -37,10 +37,11 @@ const StatusPages = () => {
|
||||
|
||||
return (
|
||||
<BasePageWithStates
|
||||
headerKey="statusPages"
|
||||
page={t("pages.statusPages.fallback.title")}
|
||||
page={t("pages.statusPages.title")}
|
||||
loading={isLoading}
|
||||
description={t("pages.statusPages.fallback.description")}
|
||||
bullets={
|
||||
t("pages.statusPages.fallback.checks", { returnObjects: true }) as string[]
|
||||
}
|
||||
error={!!error}
|
||||
totalCount={statusPages?.length ?? 0}
|
||||
actionButtonText={t("pages.statusPages.fallback.actionButton")}
|
||||
|
||||
@@ -140,7 +140,6 @@ const UptimeMonitorsPage = () => {
|
||||
|
||||
return (
|
||||
<MonitorBasePageWithStates
|
||||
headerKey="uptime"
|
||||
loading={isLoading}
|
||||
error={monitorsWithChecksError}
|
||||
totalCount={effectiveTotalCount}
|
||||
|
||||
Reference in new issue
Block a user