admin: display hfs version on the menu
Massimo Melina committed
Apr 10, 2022 at 12:07 UTC
28515c21fef089d89030baec7c2c7229f94f3deb
2 files changed
+7
-4
admin/src/MainMenu.ts
+7
-2
@@ -1,7 +1,7 @@
1
// This file is part of HFS - Copyright 2021-2022, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
2
3
import { createElement as h, FC } from 'react';
4
-import { List, ListItemButton, ListItemIcon, ListItemText, Typography } from '@mui/material'
4
+import { List, ListItemButton, ListItemIcon, ListItemText, Box, Typography } from '@mui/material'
5
import {
6
AccountTree,
7
History,
@@ -21,6 +21,7 @@ import AccountsPage from './AccountsPage';
21
import HomePage from './HomePage'
22
import LogoutPage from './LogoutPage';
23
import LogsPage from './LogsPage';
24
+import { useApi } from './api'
25
26
interface MenuEntry {
27
path: string
@@ -41,8 +42,12 @@ export const mainMenu: MenuEntry[] = [
42
]
43
44
export default function Menu({ onSelect }: { onSelect: ()=>void }) {
45
+ const [status] = useApi('get_status')
46
return h(List, { sx:{ pr:1, bgcolor: 'primary.main', color:'primary.contrastText', minHeight: '100%', boxSizing: 'border-box' } },
45
- h(Typography, { variant:'h4', sx:{ p:2 } }, 'HFS'),
47
+ h(Box, { display: 'flex', px: 2, py: 1, gap: 2, alignItems: 'flex-end' },
48
+ h(Typography, { variant:'h3' }, 'HFS'),
49
+ h(Box, { pb: 1, fontSize: 'small' }, status?.version?.replace('-', ' ')),
50
+ ),
51
mainMenu.map(it =>
52
h(ListItemButton, {
53
key: it.path,
admin/src/MonitorPage.ts
-2
@@ -25,8 +25,6 @@ function MoreInfo() {
25
isValidElement(res) ? res :
26
h(Box, { display: 'flex', flexWrap: 'wrap', gap: '1em', mb: 2 },
27
pair('started'),
28
- pair('version'),
29
- pair('build'),
28
pair('http', "HTTP", port),
29
pair('https', "HTTPS", port),
30
)