Skip to content

Commit

Permalink
feat(machines): Add kernel crash dump indicator to details page MAASE…
Browse files Browse the repository at this point in the history
…NG-3760 (#5540)

Resolves [MAASENG-3760](https://warthogs.atlassian.net/browse/MAASENG-3760)
  • Loading branch information
ndv99 authored Oct 2, 2024
1 parent 6bd12d8 commit 4a29667
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,6 @@ describe("node is a machine", () => {
expect(screen.getByText(DetailsCardLabels.Pool)).toBeInTheDocument();
expect(screen.getByText("swimming")).toBeInTheDocument();
});

it.todo("shows the status of kernel crash dumps on the machine");
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Spinner } from "@canonical/react-components";
import { Icon, Spinner } from "@canonical/react-components";
import classNames from "classnames";
import { useSelector } from "react-redux";
import { Link } from "react-router-dom";
Expand Down Expand Up @@ -36,6 +36,7 @@ export enum Labels {
PowerTypeLink = "Power type ›",
Tags = "Tags",
TagsLink = "Tags ›",
KernelCrashDump = "Kernel crash dump",
}

const DetailsCard = ({ node }: Props): JSX.Element => {
Expand All @@ -59,6 +60,7 @@ const DetailsCard = ({ node }: Props): JSX.Element => {
node.power_type
);
const tagsDisplay = getTagsDisplay(machineTags);
const kernelCrashDumpEnabled = true;

useFetchActions([generalActions.fetchPowerTypes, tagActions.fetch]);

Expand Down Expand Up @@ -196,6 +198,22 @@ const DetailsCard = ({ node }: Props): JSX.Element => {
<Spinner data-testid="loading-tags" />
)}
</div>
{import.meta.env.VITE_APP_KERNEL_CRASH_DUMP_ENABLED === "true" && (
<div>
<div className="u-text--muted">{Labels.KernelCrashDump}</div>
<span>
{kernelCrashDumpEnabled ? (
<>
<Icon name="success-grey" /> enabled
</>
) : (
<>
<Icon name="error-grey" /> disabled
</>
)}
</span>
</div>
)}
</div>
);
};
Expand Down

0 comments on commit 4a29667

Please sign in to comment.