Skip to content

Commit

Permalink
Workspace Data Vol column popup add
Browse files Browse the repository at this point in the history
Signed-off-by: Elay Aharoni (EXT-Nokia) <elay.aharoni.ext@nokia.com>
  • Loading branch information
Elay Aharoni (EXT-Nokia) committed Dec 12, 2024
1 parent 346a74e commit 61b14b3
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions workspaces/frontend/src/app/pages/Workspaces/Workspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
Button,
PaginationVariant,
Pagination,
Popover,
} from '@patternfly/react-core';
import {
Table,
Expand All @@ -34,7 +35,7 @@ import {
ActionsColumn,
IActions,
} from '@patternfly/react-table';
import { FilterIcon } from '@patternfly/react-icons';
import { FilterIcon, DatabaseIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { Workspace, WorkspaceState } from '~/shared/types';

export const Workspaces: React.FunctionComponent = () => {
Expand Down Expand Up @@ -421,6 +422,39 @@ export const Workspaces: React.FunctionComponent = () => {
setPage(newPage);
};

const workspaceDataVolRender = (workspace: Workspace) => {
const workspaceDataVol = workspace.podTemplate.volumes.data[0];
return (
<div>
{workspace.podTemplate.volumes.data[0].pvcName || ''}
<Popover
triggerAction="hover"
aria-label="Hoverable popover"
headerContent={<b>Workspace Data Vol</b>}
headerIcon={<DatabaseIcon />}
bodyContent={
<div>
<div>
<b>pvc name: </b>
{workspaceDataVol.pvcName}
</div>
<div>
<b>mount path: </b>
{workspaceDataVol.mountPath}
</div>
<div>
<b>readonly: </b>
{workspaceDataVol.readOnly.toString()}
</div>
</div>
}
>
<OutlinedQuestionCircleIcon style={{ marginLeft: '3px' }} />
</Popover>
</div>
);
};

return (
<PageSection>
<Title headingLevel="h1">Kubeflow Workspaces</Title>
Expand Down Expand Up @@ -453,9 +487,7 @@ export const Workspaces: React.FunctionComponent = () => {
</Label>
</Td>
<Td dataLabel={columnNames.homeVol}>{workspace.podTemplate.volumes.home}</Td>
<Td dataLabel={columnNames.dataVol}>
{workspace.podTemplate.volumes.data[0].pvcName || ''}
</Td>
<Td dataLabel={columnNames.dataVol}>{workspaceDataVolRender(workspace)}</Td>
<Td dataLabel={columnNames.lastActivity}>
<Timestamp
date={new Date(workspace.status.activity.lastActivity)}
Expand Down

0 comments on commit 61b14b3

Please sign in to comment.