Skip to content

Commit

Permalink
StatsHouse UI: hard dash
Browse files Browse the repository at this point in the history
  • Loading branch information
vauweb committed Mar 5, 2024
1 parent 18fa263 commit 39287d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions statshouse-ui/src/common/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface settings {
readonly skip_error_count: number;
readonly event_preset: string[];
readonly links: { name: string; url: string }[];
readonly admin_dash?: number | null;
}

const defaultSettings: settings = {
Expand All @@ -36,6 +37,7 @@ const defaultSettings: settings = {
skip_error_count: 10,
event_preset: [],
links: [],
admin_dash: null,
};

const meta = document.querySelector('meta[name="settings"]');
Expand Down
9 changes: 9 additions & 0 deletions statshouse-ui/src/components/HeaderMenu/HeaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ReactComponent as SVGLightning } from 'bootstrap-icons/icons/lightning.
import { ReactComponent as SVGGridFill } from 'bootstrap-icons/icons/grid-fill.svg';
import { ReactComponent as SVGPlus } from 'bootstrap-icons/icons/plus.svg';
import { ReactComponent as SVGCardList } from 'bootstrap-icons/icons/card-list.svg';
import { ReactComponent as SVGCpu } from 'bootstrap-icons/icons/cpu.svg';
import { ReactComponent as SVGBrightnessHighFill } from 'bootstrap-icons/icons/brightness-high-fill.svg';
import { ReactComponent as SVGMoonStarsFill } from 'bootstrap-icons/icons/moon-stars-fill.svg';
import { ReactComponent as SVGCircleHalf } from 'bootstrap-icons/icons/circle-half.svg';
Expand Down Expand Up @@ -246,6 +247,14 @@ export const HeaderMenu: React.FC<HeaderMenuProps> = ({ className }) => {
</li>
</HeaderMenuItem>
)}
{!!globalSettings.admin_dash && (
<HeaderMenuItem
icon={SVGCpu}
to={`/view?id=${globalSettings.admin_dash}`}
title="Hardware info"
className={cn(isDashList && css.activeItem)}
></HeaderMenuItem>
)}
<HeaderMenuItem
icon={SVGCardList}
to="/dash-list"
Expand Down

0 comments on commit 39287d4

Please sign in to comment.