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
  • Loading branch information
ndv99 committed Oct 1, 2024
1 parent 6bd12d8 commit 125ab1d
Showing 1 changed file with 19 additions and 1 deletion.
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 125ab1d

Please sign in to comment.