Path: blob/trunk/javascript/grid-ui/src/components/Node/NodeDetailsDialog.tsx
2887 views
// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the5// "License"); you may not use this file except in compliance6// with the License. You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing,11// software distributed under the License is distributed on an12// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13// KIND, either express or implied. See the License for the14// specific language governing permissions and limitations15// under the License.1617import {18Box,19Button,20Dialog,21DialogActions,22DialogContent,23DialogTitle,24IconButton,25Typography26} from '@mui/material'27import React, { useState } from 'react'28import {Info as InfoIcon } from '@mui/icons-material'29import OsLogo from '../common/OsLogo'30import NodeInfo from '../../models/node-info'3132function NodeDetailsDialog (props) {33const [open, setOpen] = useState(false)34const { node } = props35const nodeInfo: NodeInfo = node3637return (38<Box component='span'>39<IconButton40sx={{ bm: 1 }}41onClick={() => setOpen(true)}42data-testid={`node-info-${nodeInfo.id}`}43size='large'44>45<InfoIcon />46</IconButton>47<Dialog48onClose={() => setOpen(false)}49aria-labelledby='node-info-dialog' open={open}50>51<DialogTitle id='node-info-dialog'>52<OsLogo osName={nodeInfo.osInfo.name} />53<Box fontWeight='fontWeightBold' mr={1} display='inline'>54URI:55</Box>56{nodeInfo.uri}57</DialogTitle>58<DialogContent dividers>59<Typography gutterBottom>60Node Id: {nodeInfo.id}61</Typography>62<Typography gutterBottom>63OS Arch: {nodeInfo.osInfo.arch}64</Typography>65<Typography gutterBottom>66OS Name: {nodeInfo.osInfo.name}67</Typography>68<Typography gutterBottom>69OS Version: {nodeInfo.osInfo.version}70</Typography>71<Typography gutterBottom>72Total slots: {nodeInfo.slotCount}73</Typography>74<Typography gutterBottom>75Grid version: {nodeInfo.version}76</Typography>77</DialogContent>78<DialogActions>79<Button80onClick={() => setOpen(false)}81color='primary'82variant='contained'83>84Close85</Button>86</DialogActions>87</Dialog>88</Box>89)90}9192export default NodeDetailsDialog939495