Skip to content

Commit

Permalink
Moved settings and APIs menu links
Browse files Browse the repository at this point in the history
  • Loading branch information
danyi1212 committed Nov 19, 2023
1 parent 7d7a137 commit d2d083a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
11 changes: 11 additions & 0 deletions frontend/src/components/settings/ServerInfoPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useClient } from "@hooks/useClient"
import Box from "@mui/material/Box"
import Button from "@mui/material/Button"
import Grid from "@mui/material/Grid"
import Stack from "@mui/material/Stack"
import Tooltip from "@mui/material/Tooltip"
import { resetState } from "@stores/useStateStore"
import { useQuery } from "@tanstack/react-query"
Expand Down Expand Up @@ -132,6 +133,16 @@ export const ServerInfoPanel: React.FC = () => {
value={`${data?.worker_count || 0} / ${data?.worker_max_count || "Unknown"}`}
/>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-around">
<Button component="a" href="/docs" variant="outlined" color="secondary">
API Explorer
</Button>
<Button component="a" href="/redoc" variant="outlined" color="secondary">
API Docs
</Button>
</Stack>
</Grid>
</Grid>
</Panel>
)
Expand Down
30 changes: 10 additions & 20 deletions frontend/src/layout/menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import WorkerQuickStatusList from "@components/worker/WorkerQuickStatusList"
import MenuItem, { MenuLink } from "@layout/menu/MenuItem"
import ApiIcon from "@mui/icons-material/Api"
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos"
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"
import ManageSearchIcon from "@mui/icons-material/ManageSearch"
import RssFeedIcon from "@mui/icons-material/RssFeed"
import SettingsIcon from "@mui/icons-material/Settings"
import SpaceDashboardOutlinedIcon from "@mui/icons-material/SpaceDashboardOutlined"
import SubjectIcon from "@mui/icons-material/Subject"
import { useMediaQuery, useTheme } from "@mui/material"
import Collapse from "@mui/material/Collapse"
import Divider from "@mui/material/Divider"
Expand Down Expand Up @@ -68,24 +66,6 @@ const menuLinks: MenuLink[] = [
to: "/raw_events",
external: false,
},
{
label: "API Explorer",
icon: <ApiIcon />,
to: "/docs",
external: true,
},
{
label: "API Docs",
icon: <SubjectIcon />,
to: "/redoc",
external: true,
},
{
label: "Settings",
icon: <SettingsIcon />,
to: "/settings",
external: false,
},
]

const Menu: React.FC = () => {
Expand Down Expand Up @@ -127,6 +107,16 @@ const Menu: React.FC = () => {
<WorkerQuickStatusList />
</Collapse>
<Divider />
<MenuItem
link={{
label: "Settings",
icon: <SettingsIcon />,
to: "/settings",
external: false,
}}
expanded={expanded}
/>
<Divider />
<ListItem disablePadding>
<Tooltip title={expanded ? "Collapse menu" : "Expand menu"} placement="right" arrow>
<ListItemButton
Expand Down

0 comments on commit d2d083a

Please sign in to comment.