-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
362 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { ReactElement } from 'react' | ||
import { Table } from '@pluralsh/design-system' | ||
import { createColumnHelper } from '@tanstack/react-table' | ||
|
||
import { | ||
Pod_Container as ContainerT, | ||
Maybe, | ||
} from '../../../generated/graphql-kubernetes' | ||
|
||
const columnHelper = createColumnHelper<ContainerT>() | ||
|
||
interface ContainersProps { | ||
containers: Array<Maybe<ContainerT>> | ||
} | ||
|
||
const columns = [ | ||
// Name | ||
columnHelper.accessor((container) => container?.name, { | ||
id: 'name', | ||
header: 'Name', | ||
cell: ({ getValue }) => getValue(), | ||
}), | ||
// Image | ||
columnHelper.accessor((container) => container?.image, { | ||
id: 'image', | ||
header: 'Image', | ||
cell: ({ getValue }) => getValue(), | ||
}), | ||
// Args | ||
columnHelper.accessor((container) => container?.args, { | ||
id: 'args', | ||
header: 'Args', | ||
cell: ({ getValue }) => getValue(), | ||
}), | ||
// Status | ||
columnHelper.accessor((container) => container?.status?.name, { | ||
id: 'status', | ||
header: 'Status', | ||
cell: ({ getValue }) => getValue(), | ||
}), | ||
] | ||
|
||
export default function Containers({ | ||
containers, | ||
}: ContainersProps): ReactElement { | ||
console.log(containers) | ||
|
||
return ( | ||
<Table | ||
data={containers} | ||
columns={columns} | ||
virtualizeRows | ||
css={{ | ||
maxHeight: 'unset', | ||
height: '100%', | ||
}} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ReactElement } from 'react' | ||
|
||
import { useTheme } from 'styled-components' | ||
|
||
import { Sidecar, SidecarItem } from '@pluralsh/design-system' | ||
|
||
import { A } from 'honorable' | ||
import { Link } from 'react-router-dom' | ||
|
||
import { Pod_PodDetail as PodT } from '../../../generated/graphql-kubernetes' | ||
import { StatusChip } from '../../cluster/TableElements' | ||
import { ReadinessT } from '../../../utils/status' | ||
|
||
interface PodSidecarProps { | ||
pod: Nullable<PodT> | ||
} | ||
|
||
export default function PodSidecar({ pod }: PodSidecarProps): ReactElement { | ||
return ( | ||
<Sidecar heading="Metadata"> | ||
<SidecarItem heading="Pod name">{pod?.objectMeta.name}</SidecarItem> | ||
<SidecarItem heading="Namespace"> | ||
{pod?.objectMeta?.namespace} | ||
</SidecarItem> | ||
<SidecarItem heading="IP">{pod?.podIP}</SidecarItem> | ||
<SidecarItem heading="Parent node"> | ||
<A | ||
as={Link} | ||
to={`/nodes/${pod?.nodeName}`} | ||
inline | ||
> | ||
{pod?.nodeName} | ||
</A> | ||
</SidecarItem> | ||
<SidecarItem heading="Service account"> | ||
{pod?.serviceAccountName} | ||
</SidecarItem> | ||
<SidecarItem heading="Status"> | ||
<StatusChip readiness={pod?.podPhase as ReadinessT} /> | ||
</SidecarItem> | ||
</Sidecar> | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
assets/src/components/utils/layout/ResponsiveLayoutHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styled from 'styled-components' | ||
|
||
export const ResponsiveLayoutHeader = styled.div(({ theme }) => ({ | ||
display: 'flex', | ||
width: '100%', | ||
overflowX: 'hidden', | ||
paddingBottom: theme.spacing.large, | ||
flexGrow: 1, | ||
})) |
Oops, something went wrong.