2022-09-18 07:33:09 +00:00
|
|
|
import { useEffect, useState } from 'react';
|
2022-09-20 13:17:31 +00:00
|
|
|
import ProgressBar from '../features/system/ProgressBar';
|
|
|
|
import SiteHeader from '../features/system/SiteHeader';
|
2022-10-03 16:15:26 +00:00
|
|
|
import Console from '../features/system/Console';
|
2022-09-18 07:33:09 +00:00
|
|
|
import Loading from '../Loading';
|
|
|
|
import { useAppDispatch } from './store';
|
2022-09-26 01:50:47 +00:00
|
|
|
import { requestSystemConfig } from './socketio/actions';
|
2022-10-03 16:15:26 +00:00
|
|
|
import { keepGUIAlive } from './utils';
|
|
|
|
import InvokeTabs from '../features/tabs/InvokeTabs';
|
|
|
|
|
|
|
|
keepGUIAlive();
|
2022-09-16 17:18:15 +00:00
|
|
|
|
|
|
|
const App = () => {
|
2022-09-17 06:32:59 +00:00
|
|
|
const dispatch = useAppDispatch();
|
2022-09-18 07:33:09 +00:00
|
|
|
const [isReady, setIsReady] = useState<boolean>(false);
|
2022-09-17 06:32:59 +00:00
|
|
|
|
|
|
|
useEffect(() => {
|
2022-09-20 13:17:31 +00:00
|
|
|
dispatch(requestSystemConfig());
|
2022-09-18 07:33:09 +00:00
|
|
|
setIsReady(true);
|
2022-09-17 06:32:59 +00:00
|
|
|
}, [dispatch]);
|
|
|
|
|
2022-09-18 07:33:09 +00:00
|
|
|
return isReady ? (
|
2022-10-03 16:15:26 +00:00
|
|
|
<div className="App">
|
|
|
|
<ProgressBar />
|
|
|
|
<div className="app-content">
|
|
|
|
<SiteHeader />
|
|
|
|
<InvokeTabs />
|
|
|
|
</div>
|
2022-10-08 00:15:30 +00:00
|
|
|
<div className="app-console">
|
|
|
|
<Console />
|
|
|
|
</div>
|
2022-10-03 16:15:26 +00:00
|
|
|
</div>
|
2022-09-18 07:33:09 +00:00
|
|
|
) : (
|
|
|
|
<Loading />
|
2022-09-17 06:32:59 +00:00
|
|
|
);
|
2022-09-16 17:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|