File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
workspaces/frontend/src/app/pages/WorkspaceKinds/details Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { WorkspaceKind } from '~/shared/api/backendApiTypes';
1616import { WorkspaceCountPerKind } from '~/app/hooks/useWorkspaceCountPerKind' ;
1717import { WorkspaceKindDetailsOverview } from './WorkspaceKindDetailsOverview' ;
1818import { WorkspaceKindDetailsImages } from './WorkspaceKindDetailsImages' ;
19+ import { WorkspaceKindDetailsPodConfigs } from './WorkspaceKindDetailsPodConfigs' ;
1920
2021type WorkspaceKindDetailsProps = {
2122 workspaceKind : WorkspaceKind ;
@@ -60,6 +61,12 @@ export const WorkspaceKindDetails: React.FunctionComponent<WorkspaceKindDetailsP
6061 tabContentId = "imagesTabContent"
6162 aria-label = "Images"
6263 />
64+ < Tab
65+ eventKey = { 2 }
66+ title = { < TabTitleText > Pod Configs</ TabTitleText > }
67+ tabContentId = "podConfigsTabContent"
68+ aria-label = "Pod Configs"
69+ />
6370 </ Tabs >
6471 </ DrawerPanelBody >
6572
@@ -89,6 +96,20 @@ export const WorkspaceKindDetails: React.FunctionComponent<WorkspaceKindDetailsP
8996 />
9097 </ TabContentBody >
9198 </ TabContent >
99+ < TabContent
100+ key = { 2 }
101+ eventKey = { 2 }
102+ id = "podConfigsTabContent"
103+ activeKey = { activeTabKey }
104+ hidden = { activeTabKey !== 2 }
105+ >
106+ < TabContentBody hasPadding >
107+ < WorkspaceKindDetailsPodConfigs
108+ workspaceKind = { workspaceKind }
109+ workspaceCountPerKind = { workspaceCountPerKind }
110+ />
111+ </ TabContentBody >
112+ </ TabContent >
92113 </ DrawerPanelBody >
93114 </ DrawerPanelContent >
94115 ) ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { List , ListItem } from '@patternfly/react-core' ;
3+ import { WorkspaceKind } from '~/shared/api/backendApiTypes' ;
4+ import { WorkspaceCountPerKind } from '~/app/hooks/useWorkspaceCountPerKind' ;
5+
6+ type WorkspaceDetailsPodConfigsProps = {
7+ workspaceKind : WorkspaceKind ;
8+ workspaceCountPerKind : WorkspaceCountPerKind ;
9+ } ;
10+
11+ export const WorkspaceKindDetailsPodConfigs : React . FunctionComponent <
12+ WorkspaceDetailsPodConfigsProps
13+ > = ( { workspaceKind, workspaceCountPerKind } ) => (
14+ < List isPlain >
15+ { workspaceKind . podTemplate . options . podConfig . values . map ( ( podConfig , rowIndex ) => (
16+ < ListItem key = { rowIndex } >
17+ { podConfig . displayName } :{ ' ' }
18+ {
19+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
20+ workspaceCountPerKind [ workspaceKind . name ]
21+ ? workspaceCountPerKind [ workspaceKind . name ] . countByPodConfig [ podConfig . id ]
22+ : 0
23+ }
24+ { ' Workspaces' }
25+ </ ListItem >
26+ ) ) }
27+ </ List >
28+ ) ;
You can’t perform that action at this time.
0 commit comments