Skip to content

Commit

Permalink
feat(ws): Add Connect column to workspace table and popup with worksp…
Browse files Browse the repository at this point in the history
…ace endpoints

Signed-off-by: Yael <fishel.yael@gmail.com>
  • Loading branch information
Yael-F authored and Yael committed Jan 14, 2025
1 parent d84621a commit ba325f5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as React from 'react';
import { ExpandableRowContent, Td, Tr } from '@patternfly/react-table';
import { Workspace, WorkspacesColumnNames } from '~/shared/types';
import { DataVolumesList } from '~/app/pages/Workspaces/DataVolumesList';
import { WorkspaceEndpoints } from '~/app/pages/Workspaces/WorkspaceEndpoints';


interface ExpandedWorkspaceRowProps {
workspace: Workspace;
Expand All @@ -23,6 +25,14 @@ export const ExpandedWorkspaceRow: React.FC<ExpandedWorkspaceRowProps> = ({
</ExpandableRowContent>
</Td>
);
case 'kind':
return (
<Td noPadding colSpan={1}>
<ExpandableRowContent>
<WorkspaceEndpoints endpoints={workspace.endpoints}/>
</ExpandableRowContent>
</Td>
);
default:
return <Td />;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as React from 'react';
import {
List,
ListItem,
Stack,
StackItem,
} from '@patternfly/react-core';


type WorkspaceEndpointsProps = {
endpoints: string[];
};

export const WorkspaceEndpoints: React.FC<WorkspaceEndpointsProps> = ({ endpoints }) => {
return (
<Stack hasGutter>
<StackItem>
<strong>Endpoints</strong>
</StackItem>
<StackItem>
<List isPlain>
{endpoints.map((endpoint) => (
<ListItem>
<a href={endpoint} target="_blank">{endpoint}</a>
</ListItem>
))}
</List>
</StackItem>
</Stack>
)
};
2 changes: 2 additions & 0 deletions workspaces/frontend/src/app/pages/Workspaces/Workspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const Workspaces: React.FunctionComponent = () => {
state: WorkspaceState.Paused,
stateMessage: 'It is paused.',
},
endpoints: ['endpoint1', 'endpoint2'],
},
{
name: 'My Other Jupyter Notebook',
Expand Down Expand Up @@ -140,6 +141,7 @@ export const Workspaces: React.FunctionComponent = () => {
state: WorkspaceState.Running,
stateMessage: 'It is running.',
},
endpoints: ['endpoint3', 'endpoint4'],
},
];

Expand Down
1 change: 1 addition & 0 deletions workspaces/frontend/src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface Workspace {
podConfig: string;
};
status: WorkspaceStatus;
endpoints: string[];
}

export type WorkspacesColumnNames = {
Expand Down

0 comments on commit ba325f5

Please sign in to comment.