// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Grid, Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton } from '@material-ui/core'; import { ArvadosTheme } from '~/common/custom-theme'; import { MoreOptionsIcon } from '~/components/icon/icon'; import { NodeResource } from '~/models/node'; import { formatDate } from '~/common/formatters'; type CssRules = 'root' | 'tableRow'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { width: '100%', overflow: 'auto' }, tableRow: { '& th': { whiteSpace: 'nowrap' } } }); export interface ComputeNodePanelRootActionProps { openRowOptions: (event: React.MouseEvent, computeNode: NodeResource) => void; } export interface ComputeNodePanelRootDataProps { computeNodes: NodeResource[]; hasComputeNodes: boolean; } type ComputeNodePanelRootProps = ComputeNodePanelRootActionProps & ComputeNodePanelRootDataProps & WithStyles; export const ComputeNodePanelRoot = withStyles(styles)( ({ classes, hasComputeNodes, computeNodes, openRowOptions }: ComputeNodePanelRootProps) => {hasComputeNodes && Info UUID Domain First ping at Hostname IP Address Job Last ping at {computeNodes.map((computeNode, index) => {JSON.stringify(computeNode.info, null, 4)} {computeNode.uuid} {computeNode.domain} {formatDate(computeNode.firstPingAt) || '(none)'} {computeNode.hostname || '(none)'} {computeNode.ipAddress || '(none)'} {computeNode.jobUuid || '(none)'} {formatDate(computeNode.lastPingAt) || '(none)'} openRowOptions(event, computeNode)}> )}
}
);