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';
16
16
import { WorkspaceCountPerKind } from '~/app/hooks/useWorkspaceCountPerKind' ;
17
17
import { WorkspaceKindDetailsOverview } from './WorkspaceKindDetailsOverview' ;
18
18
import { WorkspaceKindDetailsImages } from './WorkspaceKindDetailsImages' ;
19
+ import { WorkspaceKindDetailsPodConfigs } from './WorkspaceKindDetailsPodConfigs' ;
19
20
20
21
type WorkspaceKindDetailsProps = {
21
22
workspaceKind : WorkspaceKind ;
@@ -60,6 +61,12 @@ export const WorkspaceKindDetails: React.FunctionComponent<WorkspaceKindDetailsP
60
61
tabContentId = "imagesTabContent"
61
62
aria-label = "Images"
62
63
/>
64
+ < Tab
65
+ eventKey = { 2 }
66
+ title = { < TabTitleText > Pod Configs</ TabTitleText > }
67
+ tabContentId = "podConfigsTabContent"
68
+ aria-label = "Pod Configs"
69
+ />
63
70
</ Tabs >
64
71
</ DrawerPanelBody >
65
72
@@ -89,6 +96,20 @@ export const WorkspaceKindDetails: React.FunctionComponent<WorkspaceKindDetailsP
89
96
/>
90
97
</ TabContentBody >
91
98
</ 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 >
92
113
</ DrawerPanelBody >
93
114
</ DrawerPanelContent >
94
115
) ;
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