Skip to content
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

feat: Add node drain functionality to dashboard #1376

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
Prev Previous commit
Next Next commit
improve unschedulable display
  • Loading branch information
maciaszczykm committed Sep 16, 2024
commit ab4d6537ef89898fbe77609127d8987350a8a8ed
12 changes: 10 additions & 2 deletions assets/src/components/kubernetes/cluster/Node.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ReactElement, useMemo } from 'react'
import {
Card,
Chip,
ChipList,
SidecarItem,
Table,
Expand Down Expand Up @@ -98,9 +99,16 @@ export default function Node(): ReactElement {
<ResourceReadyChip ready={node?.ready} />
</SidecarItem>
<SidecarItem heading="Unschedulable">
{node?.unschedulable ? 'True' : 'False'}
<Chip
size="small"
severity={node?.unschedulable ? 'danger' : 'success'}
>
{node?.unschedulable ? 'True' : 'False'}
</Chip>
</SidecarItem>
<SidecarItem heading="Pod CIDR">{node?.podCIDR}</SidecarItem>
{node.podCIDR && (
<SidecarItem heading="Pod CIDR">{node?.podCIDR}</SidecarItem>
)}
</MetadataSidecar>
}
>
Expand Down
6 changes: 5 additions & 1 deletion assets/src/components/kubernetes/common/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import moment from 'moment/moment'
import yaml from 'js-yaml'
import { capitalize } from 'lodash'

import { ChipProps } from '@pluralsh/design-system/dist/components/Chip'

import {
Types_ListMeta as ListMetaT,
Maybe,
Expand Down Expand Up @@ -110,9 +112,10 @@ const resourceConditionSeverity = {

export function ResourceReadyChip({
ready,
...props
}: {
ready: string | boolean | undefined
}) {
} & ChipProps) {
if (ready === undefined) return undefined

const r = ready.toString()
Expand All @@ -122,6 +125,7 @@ export function ResourceReadyChip({
<Chip
size="small"
severity={severity}
{...props}
>
{capitalize(r)}
</Chip>
Expand Down