-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>
- Loading branch information
Elay Aharoni (EXT-Nokia)
committed
Jan 9, 2025
1 parent
57fc8b1
commit 7f3288c
Showing
4 changed files
with
126 additions
and
8 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
workspaces/frontend/src/app/pages/Workspaces/ExpandedDataVol.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,37 @@ | ||
import { Content } from '@patternfly/react-core'; | ||
import { LockedIcon } from '@patternfly/react-icons'; | ||
import * as React from 'react'; | ||
import { Workspace } from '~/shared/types'; | ||
|
||
interface ExpandedDataVolProps { | ||
workspace: Workspace; | ||
} | ||
|
||
export const ExpandedDataVol: React.FC<ExpandedDataVolProps> = ({ workspace }) => { | ||
const workspaceDataVol = workspace.podTemplate.volumes.data; | ||
return ( | ||
<> | ||
<Content component="h3">Data Volumes:</Content> | ||
{workspaceDataVol.map((data, index) => ( | ||
<Content key={`data-vol-${index}`} component="blockquote"> | ||
<div> | ||
<div> | ||
<Content component="h5">{data.pvcName}</Content> | ||
</div> | ||
<div> | ||
<Content component="small"> | ||
mount path: {data.mountPath} | ||
{data.readOnly && ( | ||
<Content component="small"> | ||
Data is readonly | ||
<LockedIcon style={{ marginLeft: '3px' }} /> | ||
</Content> | ||
)} | ||
</Content> | ||
</div> | ||
</div> | ||
</Content> | ||
))} | ||
</> | ||
); | ||
}; |
37 changes: 37 additions & 0 deletions
37
workspaces/frontend/src/app/pages/Workspaces/ExpandedWorkspaceRow.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,37 @@ | ||
import * as React from 'react'; | ||
import { ExpandableRowContent, Td, Tr } from '@patternfly/react-table'; | ||
import { Workspace, WorkspacesColumnNames } from '~/shared/types'; | ||
import { ExpandedDataVol } from '~/app/pages/Workspaces/ExpandedDataVol'; | ||
|
||
interface ExpandedWorkspaceRowProps { | ||
workspace: Workspace; | ||
columnNames: WorkspacesColumnNames; | ||
} | ||
|
||
export const ExpandedWorkspaceRow: React.FC<ExpandedWorkspaceRowProps> = ({ | ||
workspace, | ||
columnNames, | ||
}) => { | ||
const renderExpandedData = () => | ||
Object.keys(columnNames).map((colName) => { | ||
switch (colName) { | ||
case 'name': | ||
return ( | ||
<Td noPadding colSpan={1}> | ||
<ExpandableRowContent> | ||
<ExpandedDataVol workspace={workspace} /> | ||
</ExpandableRowContent> | ||
</Td> | ||
); | ||
default: | ||
return <Td />; | ||
} | ||
}); | ||
|
||
return ( | ||
<Tr> | ||
<Td /> | ||
{renderExpandedData()} | ||
</Tr> | ||
); | ||
}; |
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