mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F OpenNebula/one#5422: Fix minor
This commit is contained in:
parent
a6fb6bdd5d
commit
329117a434
@ -15,7 +15,7 @@ import Pagination from 'client/components/Tables/Enhanced/pagination'
|
||||
|
||||
import { addOpacityToColor } from 'client/utils'
|
||||
|
||||
const useStyles = makeStyles(({ palette, typography, breakpoints }) => ({
|
||||
const useStyles = makeStyles(({ palette, typography }) => ({
|
||||
root: {
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
@ -66,9 +66,6 @@ const useStyles = makeStyles(({ palette, typography, breakpoints }) => ({
|
||||
}
|
||||
}))
|
||||
|
||||
const DefaultCell = React.memo(({ value }) => value ?? '--')
|
||||
DefaultCell.displayName = 'DefaultCell'
|
||||
|
||||
const EnhancedTable = ({
|
||||
data,
|
||||
columns,
|
||||
@ -86,7 +83,6 @@ const EnhancedTable = ({
|
||||
|
||||
const defaultColumn = React.useMemo(() => ({
|
||||
// Filter: DefaultFilter,
|
||||
Cell: DefaultCell
|
||||
}), [])
|
||||
|
||||
const useTableProps = useTable(
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { LinearProgress, Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core'
|
||||
|
||||
import Tabs from 'client/components/Tabs'
|
||||
@ -14,9 +14,10 @@ import { prettyBytes } from 'client/utils'
|
||||
const NavArrowDown = <span style={{ writingMode: 'vertical-rl' }}>{'>'}</span>
|
||||
|
||||
const VmDetail = ({ id }) => {
|
||||
const [socket, setSocket] = useState({})
|
||||
|
||||
const { getVm } = useVmApi()
|
||||
const { getHooksSocketTemporal } = useSocket()
|
||||
const socketTemporal = getHooksSocketTemporal({ resource: 'vm', id })
|
||||
|
||||
const { data, fetchRequest, loading, error } = useFetch(getVm)
|
||||
const isLoading = (!data && !error) || loading
|
||||
@ -27,12 +28,15 @@ const VmDetail = ({ id }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoading && data) {
|
||||
console.log('connect???')
|
||||
socketTemporal.connect(console.log)
|
||||
const client = getHooksSocketTemporal({ resource: 'vm', id })
|
||||
|
||||
setSocket(client)
|
||||
|
||||
client.connect(console.log)
|
||||
}
|
||||
|
||||
return () => {
|
||||
socketTemporal.disconnect()
|
||||
socket?.disconnect()
|
||||
}
|
||||
}, [isLoading, data])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user