Skip to content

Commit

Permalink
Added tooltips to buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scusemua committed Mar 1, 2024
1 parent b408dd0 commit 39776a2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 27 deletions.
61 changes: 40 additions & 21 deletions src/app/Components/KernelList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
ToolbarGroup,
ToolbarItem,
ToolbarToggleGroup,
Tooltip,
} from '@patternfly/react-core';
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';

Expand Down Expand Up @@ -291,15 +292,21 @@ export const KernelList: React.FunctionComponent = () => {
<React.Fragment>
<ToolbarGroup variant="icon-button-group">
<ToolbarItem>
<Button id="create-kernel-button" variant="plain" onClick={fetchKernels}>
<PlusIcon />
</Button>
<Button id="delete-kernels-button" variant="plain" onClick={fetchKernels}>
<TrashIcon />
</Button>
<Button id="refresh-kernels-button" variant="plain" onClick={fetchKernels}>
<SyncIcon />
</Button>
<Tooltip exitDelay={75} content={<div>Create a new kernel.</div>}>
<Button id="create-kernel-button" variant="plain" onClick={fetchKernels}>
<PlusIcon />
</Button>
</Tooltip>
<Tooltip exitDelay={75} content={<div>Delete selected kernels.</div>}>
<Button id="delete-kernels-button" variant="plain" onClick={fetchKernels}>
<TrashIcon />
</Button>
</Tooltip>
<Tooltip exitDelay={75} content={<div>Refresh kernels.</div>}>
<Button id="refresh-kernels-button" variant="plain" onClick={fetchKernels}>
<SyncIcon />
</Button>
</Tooltip>
</ToolbarItem>
</ToolbarGroup>
</React.Fragment>
Expand All @@ -323,14 +330,18 @@ export const KernelList: React.FunctionComponent = () => {
<Td dataLabel="Pod">{replica.podId}</Td>
<Td dataLabel="Node">{replica.nodeId}</Td>
<Td>
<Button variant={'link'} icon={<CodeIcon />}>
Execute
</Button>
<Tooltip exitDelay={20} entryDelay={175} content={<div>Execute Python code on this replica.</div>}>
<Button variant={'link'} icon={<CodeIcon />}>
Execute
</Button>
</Tooltip>
</Td>
<Td>
<Button variant={'link'} icon={<MigrationIcon />}>
Migrate
</Button>
<Tooltip exitDelay={20} entryDelay={175} content={<div>Migrate this replica to another node.</div>}>
<Button variant={'link'} icon={<MigrationIcon />}>
Migrate
</Button>
</Tooltip>
</Td>
</Tr>
))}
Expand Down Expand Up @@ -415,14 +426,22 @@ export const KernelList: React.FunctionComponent = () => {
>
<Stack>
<StackItem>
<Button variant={'link'} icon={<CodeIcon />}>
Execute
</Button>
<Tooltip
exitDelay={75}
entryDelay={250}
content={<div>Execute Python code on this kernel.</div>}
>
<Button variant={'link'} icon={<CodeIcon />}>
Execute
</Button>
</Tooltip>
</StackItem>
<StackItem>
<Button variant={'link'} icon={<TrashIcon />} isDanger>
Terminate
</Button>
<Tooltip exitDelay={75} entryDelay={250} content={<div>Terminate this kernel.</div>}>
<Button variant={'link'} icon={<TrashIcon />} isDanger>
Terminate
</Button>
</Tooltip>
</StackItem>
</Stack>
</DataListAction>,
Expand Down
9 changes: 6 additions & 3 deletions src/app/Components/KernelSpecList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Title,
ToolbarGroup,
ToolbarItem,
Tooltip,
} from '@patternfly/react-core';

import { SyncIcon } from '@patternfly/react-icons';
Expand Down Expand Up @@ -97,9 +98,11 @@ export const KernelSpecList: React.FunctionComponent = () => {
const cardHeaderActions = (
<ToolbarGroup variant="icon-button-group">
<ToolbarItem>
<Button variant="plain" onClick={fetchKernelSpecs}>
<SyncIcon />
</Button>
<Tooltip exitDelay={75} content={<div>Refresh kernel specs.</div>}>
<Button variant="plain" onClick={fetchKernelSpecs}>
<SyncIcon />
</Button>
</Tooltip>
</ToolbarItem>
</ToolbarGroup>
);
Expand Down
9 changes: 6 additions & 3 deletions src/app/Components/NodeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
ToolbarGroup,
ToolbarItem,
ToolbarToggleGroup,
Tooltip,
} from '@patternfly/react-core';
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
import GpuIcon from '@app/Icons/GpuIcon';
Expand Down Expand Up @@ -147,9 +148,11 @@ export const KubernetesNodeList: React.FunctionComponent = () => {
</ToolbarToggleGroup>
<ToolbarGroup variant="icon-button-group">
<ToolbarItem>
<Button variant="plain" onClick={fetchKubernetesNodes}>
<SyncIcon />
</Button>
<Tooltip exitDelay={75} content={<div>Refresh nodes.</div>}>
<Button variant="plain" onClick={fetchKubernetesNodes}>
<SyncIcon />
</Button>
</Tooltip>
</ToolbarItem>
</ToolbarGroup>
</React.Fragment>
Expand Down

0 comments on commit 39776a2

Please sign in to comment.