Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/javascript/grid-ui/src/components/Node/NodeDetailsDialog.tsx
2887 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License. You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied. See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
import {
19
Box,
20
Button,
21
Dialog,
22
DialogActions,
23
DialogContent,
24
DialogTitle,
25
IconButton,
26
Typography
27
} from '@mui/material'
28
import React, { useState } from 'react'
29
import {Info as InfoIcon } from '@mui/icons-material'
30
import OsLogo from '../common/OsLogo'
31
import NodeInfo from '../../models/node-info'
32
33
function NodeDetailsDialog (props) {
34
const [open, setOpen] = useState(false)
35
const { node } = props
36
const nodeInfo: NodeInfo = node
37
38
return (
39
<Box component='span'>
40
<IconButton
41
sx={{ bm: 1 }}
42
onClick={() => setOpen(true)}
43
data-testid={`node-info-${nodeInfo.id}`}
44
size='large'
45
>
46
<InfoIcon />
47
</IconButton>
48
<Dialog
49
onClose={() => setOpen(false)}
50
aria-labelledby='node-info-dialog' open={open}
51
>
52
<DialogTitle id='node-info-dialog'>
53
<OsLogo osName={nodeInfo.osInfo.name} />
54
<Box fontWeight='fontWeightBold' mr={1} display='inline'>
55
URI:
56
</Box>
57
{nodeInfo.uri}
58
</DialogTitle>
59
<DialogContent dividers>
60
<Typography gutterBottom>
61
Node Id: {nodeInfo.id}
62
</Typography>
63
<Typography gutterBottom>
64
OS Arch: {nodeInfo.osInfo.arch}
65
</Typography>
66
<Typography gutterBottom>
67
OS Name: {nodeInfo.osInfo.name}
68
</Typography>
69
<Typography gutterBottom>
70
OS Version: {nodeInfo.osInfo.version}
71
</Typography>
72
<Typography gutterBottom>
73
Total slots: {nodeInfo.slotCount}
74
</Typography>
75
<Typography gutterBottom>
76
Grid version: {nodeInfo.version}
77
</Typography>
78
</DialogContent>
79
<DialogActions>
80
<Button
81
onClick={() => setOpen(false)}
82
color='primary'
83
variant='contained'
84
>
85
Close
86
</Button>
87
</DialogActions>
88
</Dialog>
89
</Box>
90
)
91
}
92
93
export default NodeDetailsDialog
94
95