Fix can not autoload in production mode bug
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import Icon from '@ant-design/icons'
|
||||
import * as echarts from 'echarts/core'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { getTimesBetweenTwoTimes } from '@/util/datetime'
|
||||
import { r_sys_statistics_active } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -13,7 +12,7 @@ const ActiveInfo = () => {
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [scope, setScope] = useState('WEAK')
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const chartResizeObserver = new ResizeObserver(() => {
|
||||
activeInfoEChartsRef.current?.resize()
|
||||
})
|
||||
@@ -25,7 +24,7 @@ const ActiveInfo = () => {
|
||||
}
|
||||
}, [isLoading])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
getActiveInfo()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as echarts from 'echarts/core'
|
||||
import { BarSeriesOption } from 'echarts/charts'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { r_sys_statistics_cpu } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import {
|
||||
@@ -26,7 +25,7 @@ const CPUInfo = () => {
|
||||
}
|
||||
}
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const chartResizeObserver = new ResizeObserver(() => {
|
||||
cpuInfoEChartsRef.current.forEach((value) => value.resize())
|
||||
})
|
||||
@@ -38,7 +37,7 @@ const CPUInfo = () => {
|
||||
}
|
||||
}, [cpuInfoDivRef.current])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const intervalId = setInterval(getCpuInfo(), parseInt(refreshInterval) * 1000)
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { r_sys_statistics_hardware } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import { CommonCard } from '@/pages/System/Statistics'
|
||||
@@ -6,7 +5,7 @@ import { CommonCard } from '@/pages/System/Statistics'
|
||||
const HardwareInfo = () => {
|
||||
const [hardwareInfoData, setHardwareInfoData] = useState<HardwareInfoVo>()
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
void r_sys_statistics_hardware().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Icon from '@ant-design/icons'
|
||||
import * as echarts from 'echarts/core'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { getTimesBetweenTwoTimes } from '@/util/datetime'
|
||||
import { r_sys_statistics_online } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -14,7 +13,7 @@ const OnlineInfo = () => {
|
||||
const [currentOnlineCount, setCurrentOnlineCount] = useState(-1)
|
||||
const [scope, setScope] = useState('WEAK')
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const chartResizeObserver = new ResizeObserver(() => {
|
||||
onlineInfoEChartsRef.current?.resize()
|
||||
})
|
||||
@@ -26,7 +25,7 @@ const OnlineInfo = () => {
|
||||
}
|
||||
}, [isLoading])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
getOnlineInfo()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { r_sys_statistics_software } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -7,7 +6,7 @@ import { CommonCard } from '@/pages/System/Statistics'
|
||||
const SoftwareInfo = () => {
|
||||
const [softwareInfoData, setSoftwareInfoData] = useState<SoftwareInfoVo>()
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
void r_sys_statistics_software().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as echarts from 'echarts/core'
|
||||
import { BarSeriesOption } from 'echarts/charts'
|
||||
import { formatByteSize } from '@/util/common'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { r_sys_statistics_storage } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import {
|
||||
@@ -25,7 +24,7 @@ const StorageInfo = () => {
|
||||
tooltip: { valueFormatter: (value) => formatByteSize(value as number) }
|
||||
}
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const chartResizeObserver = new ResizeObserver(() => {
|
||||
storageInfoEChartsRef.current.forEach((value) => value.resize())
|
||||
})
|
||||
@@ -37,7 +36,7 @@ const StorageInfo = () => {
|
||||
}
|
||||
}, [storageInfoDivRef.current])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
const intervalId = setInterval(getStorageInfo(), parseInt(refreshInterval) * 1000)
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user