From dbdcc7a57cfd7b5c1ab52cfbb9dd156f1e041ebc Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 16 Oct 2022 11:53:44 -0600 Subject: [PATCH] Copying some settings values to status to avoid calling both /settings and /status. --- app/src/App.js | 70 +++++++++++++++---------------- app/src/Dashboard.js | 29 +++++++------ app/src/components/Common.js | 6 +-- app/src/components/Nav.js | 6 +-- app/src/components/admin/Admin.js | 8 ++-- app/src/contexts/contexts.js | 2 + app/src/hooks/customHooks.js | 13 ++++++ wrolpi/downloader.py | 23 +++++++--- wrolpi/root_api.py | 12 +++++- wrolpi/test/test_root_api.py | 4 ++ 10 files changed, 105 insertions(+), 68 deletions(-) diff --git a/app/src/App.js b/app/src/App.js index 397bb565..32bf9fea 100644 --- a/app/src/App.js +++ b/app/src/App.js @@ -12,57 +12,53 @@ import {AppsRoute} from "./components/Apps"; import {InventoryRoute} from "./components/Inventory"; import {ArchiveRoute} from "./components/Archive"; import {FilesRoute} from "./components/Files"; -import {useSettingsInterval} from "./hooks/customHooks"; +import {useStatusInterval} from "./hooks/customHooks"; import {MapRoute} from "./components/Map"; -import {SettingsContext, ThemeContext} from "./contexts/contexts"; +import {StatusContext, ThemeContext} from "./contexts/contexts"; import {ThemeWrapper} from "./components/Theme"; import {Dashboard} from "./Dashboard"; function PageNotFound() { - return ( - -

Page Not Found!

-

The page you requested cannot be found

-
- ) + return ( +

Page Not Found!

+

The page you requested cannot be found

+
) } function Footer() { const {t} = useContext(ThemeContext); - - const {version} = useContext(SettingsContext); + const {status} = useContext(StatusContext); + const {version} = status; return WROLPi v{version} GitHub } export default function App() { - const {settings} = useSettingsInterval(); + const status = useStatusInterval(); - return ( - - -
- -
- <> - - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - - - -