Skip to content

feat(site): add docs links on health page #11582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 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 @@ -35,7 +36,11 @@ export const AccessURLPage = () => {
<Main>
{accessUrl.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="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"
>
Docs for {msg.code}
</Link>
);
};
7 changes: 6 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 @@ -59,7 +60,11 @@ export const DERPPage = () => {
<Main>
{derp.warnings.map((warning: HealthMessage) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="warning"
>
{warning.message}
</Alert>
);
Expand Down
7 changes: 6 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 @@ -75,7 +76,11 @@ export const DERPRegionPage: FC = () => {
<Main>
{warnings.map((warning: HealthMessage) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="warning"
>
{warning.message}
</Alert>
);
Expand Down
7 changes: 6 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 @@ -35,7 +36,11 @@ export const DatabasePage = () => {
<Main>
{database.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="warning"
>
{warning.message}
</Alert>
);
Expand Down
7 changes: 6 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 @@ -42,7 +43,11 @@ export const ProvisionerDaemonsPage = () => {
<Main>
{daemons.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="warning"
>
{warning.message}
</Alert>
);
Expand Down
7 changes: 6 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 @@ -44,7 +45,11 @@ export const WorkspaceProxyPage = () => {
)}
{workspace_proxy.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
<Alert
actions={HealthMessageDocsLink(warning)}
key={warning.code}
severity="warning"
>
{warning.message}
</Alert>
);
Expand Down