Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(site): add docs links on health page
  • Loading branch information
johnstcn committed Jan 11, 2024
commit 69d0d0f37564b89bb9e5aad269d29545fb29e440
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/AccessURLPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useOutletContext } from "react-router-dom";
import {
Header,
HeaderTitle,
HealthMessageDocsLink,
Main,
GridData,
GridDataLabel,
Expand Down Expand Up @@ -36,7 +37,7 @@ export const AccessURLPage = () => {
{accessUrl.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down
16 changes: 15 additions & 1 deletion site/src/pages/HealthPage/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import {
import CheckCircleOutlined from "@mui/icons-material/CheckCircleOutlined";
import ErrorOutline from "@mui/icons-material/ErrorOutline";
import { healthyColor } from "./healthyColor";
import { docs } from "utils/docs";
import { css } from "@emotion/css";
import DoNotDisturbOnOutlined from "@mui/icons-material/DoNotDisturbOnOutlined";
import { HealthSeverity } from "api/typesGenerated";
import { HealthMessage, HealthSeverity } from "api/typesGenerated";
import Link from "@mui/material/Link";
import { useTheme } from "@mui/material/styles";

const CONTENT_PADDING = 36;
Expand Down Expand Up @@ -242,3 +244,15 @@ export const Logs = (props: LogsProps) => {
</div>
);
};

export const HealthMessageDocsLink = (msg: HealthMessage) => {
return (
<Link
href={docs(`/admin/healthcheck#${msg.code.toLocaleLowerCase()}`)}
target="_blank"
rel="noreferrer"
>
{msg.code}
</Link>
);
};
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/DERPPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Link, useOutletContext } from "react-router-dom";
import {
Header,
HeaderTitle,
HealthMessageDocsLink,
Main,
SectionLabel,
BooleanPill,
Expand Down Expand Up @@ -60,7 +61,7 @@ export const DERPPage = () => {
{derp.warnings.map((warning: HealthMessage) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/DERPRegionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { pageTitle } from "utils/page";
import {
Header,
HeaderTitle,
HealthMessageDocsLink,
Main,
BooleanPill,
Pill,
Expand Down Expand Up @@ -76,7 +77,7 @@ export const DERPRegionPage: FC = () => {
{warnings.map((warning: HealthMessage) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/DatabasePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useOutletContext } from "react-router-dom";
import {
Header,
HeaderTitle,
HealthMessageDocsLink,
Main,
GridData,
GridDataLabel,
Expand Down Expand Up @@ -36,7 +37,7 @@ export const DatabasePage = () => {
{database.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/ProvisionerDaemonsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Header,
HeaderTitle,
HealthyDot,
HealthMessageDocsLink,
Main,
Pill,
} from "./Content";
Expand Down Expand Up @@ -43,7 +44,7 @@ export const ProvisionerDaemonsPage = () => {
{daemons.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/HealthPage/WorkspaceProxyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
BooleanPill,
Header,
HeaderTitle,
HealthMessageDocsLink,
HealthyDot,
Main,
Pill,
Expand Down Expand Up @@ -45,7 +46,7 @@ export const WorkspaceProxyPage = () => {
{workspace_proxy.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
{warning.message}
{HealthMessageDocsLink(warning)}: {warning.message}
</Alert>
);
})}
Expand Down