fix: move machine internet performance indicators to expandable row
This commit is contained in:
parent
01412e1abe
commit
9ea83603e7
2 changed files with 31 additions and 34 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { Grid /*, Divider */ } from '@material-ui/core'
|
import { Grid /*, Divider */ } from '@material-ui/core'
|
||||||
import { makeStyles } from '@material-ui/core/styles'
|
import { makeStyles } from '@material-ui/core/styles'
|
||||||
|
import BigNumber from 'bignumber.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import MachineActions from 'src/components/machineActions/MachineActions'
|
import MachineActions from 'src/components/machineActions/MachineActions'
|
||||||
|
|
@ -107,6 +108,33 @@ const MachineDetailsRow = ({ it: machine, onActionSuccess, timezone }) => {
|
||||||
machine={machine}
|
machine={machine}
|
||||||
onActionSuccess={onActionSuccess}></MachineActions>
|
onActionSuccess={onActionSuccess}></MachineActions>
|
||||||
</Item>
|
</Item>
|
||||||
|
<Item xs={2}>
|
||||||
|
<Label>Network speed</Label>
|
||||||
|
<span>
|
||||||
|
{machine.downloadSpeed
|
||||||
|
? new BigNumber(machine.downloadSpeed).toFixed(4).toString() +
|
||||||
|
' MB/s'
|
||||||
|
: 'unavailable'}
|
||||||
|
</span>
|
||||||
|
</Item>
|
||||||
|
<Item xs={2}>
|
||||||
|
<Label>Latency</Label>
|
||||||
|
<span>
|
||||||
|
{machine.responseTime
|
||||||
|
? new BigNumber(machine.responseTime).toFixed(3).toString() +
|
||||||
|
' ms'
|
||||||
|
: 'unavailable'}
|
||||||
|
</span>
|
||||||
|
</Item>
|
||||||
|
<Item xs={2}>
|
||||||
|
<Label>Packet Loss</Label>
|
||||||
|
<span>
|
||||||
|
{machine.packetLoss
|
||||||
|
? new BigNumber(machine.packetLoss).toFixed(3).toString() +
|
||||||
|
' %'
|
||||||
|
: 'unavailable'}
|
||||||
|
</span>
|
||||||
|
</Item>
|
||||||
</Container>
|
</Container>
|
||||||
</Item>
|
</Item>
|
||||||
</Container>
|
</Container>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { useQuery } from '@apollo/react-hooks'
|
import { useQuery } from '@apollo/react-hooks'
|
||||||
import { makeStyles } from '@material-ui/core'
|
import { makeStyles } from '@material-ui/core'
|
||||||
import BigNumber from 'bignumber.js'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -62,7 +61,7 @@ const MachineStatus = () => {
|
||||||
const elements = [
|
const elements = [
|
||||||
{
|
{
|
||||||
header: 'Machine Name',
|
header: 'Machine Name',
|
||||||
width: 150,
|
width: 250,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
view: m => (
|
view: m => (
|
||||||
|
|
@ -80,48 +79,18 @@ const MachineStatus = () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: 'Status',
|
header: 'Status',
|
||||||
width: 150,
|
width: 350,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
view: m => <MainStatus statuses={m.statuses} />
|
view: m => <MainStatus statuses={m.statuses} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: 'Last ping',
|
header: 'Last ping',
|
||||||
width: 175,
|
width: 200,
|
||||||
size: 'sm',
|
size: 'sm',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
view: m => (m.lastPing ? moment(m.lastPing).fromNow() : 'unknown')
|
view: m => (m.lastPing ? moment(m.lastPing).fromNow() : 'unknown')
|
||||||
},
|
},
|
||||||
{
|
|
||||||
header: 'Network speed',
|
|
||||||
width: 150,
|
|
||||||
size: 'sm',
|
|
||||||
textAlign: 'left',
|
|
||||||
view: m =>
|
|
||||||
m.downloadSpeed
|
|
||||||
? new BigNumber(m.downloadSpeed).toFixed(4).toString() + ' MB/s'
|
|
||||||
: 'unavailable'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
header: 'Latency',
|
|
||||||
width: 150,
|
|
||||||
size: 'sm',
|
|
||||||
textAlign: 'left',
|
|
||||||
view: m =>
|
|
||||||
m.responseTime
|
|
||||||
? new BigNumber(m.responseTime).toFixed(3).toString() + ' ms'
|
|
||||||
: 'unavailable'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
header: 'Packet Loss',
|
|
||||||
width: 125,
|
|
||||||
size: 'sm',
|
|
||||||
textAlign: 'left',
|
|
||||||
view: m =>
|
|
||||||
m.packetLoss
|
|
||||||
? new BigNumber(m.packetLoss).toFixed(3).toString() + ' %'
|
|
||||||
: 'unavailable'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
header: 'Software Version',
|
header: 'Software Version',
|
||||||
width: 200,
|
width: 200,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue