1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { CustomStyleRulesCallback } from 'common/custom-theme';
19 } from '@mui/material';
20 import { WithStyles } from '@mui/styles';
21 import withStyles from '@mui/styles/withStyles';
22 import { ArvadosTheme } from 'common/custom-theme';
23 import { MoreVerticalIcon } from 'components/icon/icon';
24 import { KeepServiceResource } from 'models/keep-services';
26 type CssRules = 'root' | 'tableRow';
28 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
40 export interface KeepServicePanelRootActionProps {
41 openRowOptions: (event: React.MouseEvent<HTMLElement>, keepService: KeepServiceResource) => void;
44 export interface KeepServicePanelRootDataProps {
45 keepServices: KeepServiceResource[];
46 hasKeepSerices: boolean;
49 type KeepServicePanelRootProps = KeepServicePanelRootActionProps & KeepServicePanelRootDataProps & WithStyles<CssRules>;
51 export const KeepServicePanelRoot = withStyles(styles)(
52 ({ classes, hasKeepSerices, keepServices, openRowOptions }: KeepServicePanelRootProps) =>
53 <Card className={classes.root}>
55 {hasKeepSerices && <Grid container direction="row">
59 <TableRow className={classes.tableRow}>
60 <TableCell>UUID</TableCell>
61 <TableCell>Read only</TableCell>
62 <TableCell>Service host</TableCell>
63 <TableCell>Service port</TableCell>
64 <TableCell>Service SSL flag</TableCell>
65 <TableCell>Service type</TableCell>
70 {keepServices.map((keepService, index) =>
71 <TableRow key={index} className={classes.tableRow}>
72 <TableCell>{keepService.uuid}</TableCell>
77 checked={keepService.readOnly} />
79 <TableCell>{keepService.serviceHost}</TableCell>
80 <TableCell>{keepService.servicePort}</TableCell>
85 checked={keepService.serviceSslFlag} />
87 <TableCell>{keepService.serviceType}</TableCell>
89 <Tooltip title="More options" disableFocusListener>
90 <IconButton onClick={event => openRowOptions(event, keepService)} size="large">