mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 12:49:37 +03:00
Add waiting message to hardware screen. Closes #2805
This commit is contained in:
parent
d5ca03fab7
commit
0b619b84a6
1 changed files with 15 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Row, Col, Typography } from 'antd';
|
||||
import { Row, Col, Typography, Alert, Spin } from 'antd';
|
||||
import React, { ReactElement, useEffect, useState } from 'react';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { fetchData, FETCH_INTERVAL, HARDWARE_STATS } from '../../utils/apis';
|
||||
|
@ -21,12 +21,6 @@ const SaveOutlined = dynamic(() => import('@ant-design/icons/SaveOutlined'), {
|
|||
ssr: false,
|
||||
});
|
||||
|
||||
// TODO: FIX TS WARNING FROM THIS.
|
||||
// interface TimedValue {
|
||||
// time: Date;
|
||||
// value: Number;
|
||||
// }
|
||||
|
||||
export default function HardwareInfo() {
|
||||
const [hardwareStatus, setHardwareStatus] = useState({
|
||||
cpu: [], // Array<TimedValue>(),
|
||||
|
@ -57,7 +51,20 @@ export default function HardwareInfo() {
|
|||
}, []);
|
||||
|
||||
if (!hardwareStatus.cpu) {
|
||||
return null;
|
||||
return (
|
||||
<div>
|
||||
<Typography.Title>Hardware Info</Typography.Title>
|
||||
|
||||
<Alert
|
||||
style={{ marginTop: '10px' }}
|
||||
banner
|
||||
message="Please wait"
|
||||
description="No hardware details have been collected yet."
|
||||
type="info"
|
||||
/>
|
||||
<Spin spinning style={{ width: '100%', margin: '10px' }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const currentCPUUsage = hardwareStatus.cpu[hardwareStatus.cpu.length - 1]?.value;
|
||||
|
|
Loading…
Reference in a new issue