2
0
mirror of https://github.com/hibiken/asynqmon.git synced 2025-10-26 16:26:12 +08:00

Show metrics icon in sidebar if prometheus-addr is specified

This commit is contained in:
Ken Hibino
2021-11-25 07:50:12 -08:00
parent e8775539ae
commit c9fcd9c7ae
7 changed files with 34 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ import LayersIcon from "@material-ui/icons/Layers";
import SettingsIcon from "@material-ui/icons/Settings";
import ScheduleIcon from "@material-ui/icons/Schedule";
import FeedbackIcon from "@material-ui/icons/Feedback";
import TimelineIcon from "@material-ui/icons/Timeline";
import DoubleArrowIcon from "@material-ui/icons/DoubleArrow";
import CloseIcon from "@material-ui/icons/Close";
import { AppState } from "./store";
@@ -244,6 +245,13 @@ function App(props: ConnectedProps<typeof connector>) {
primary="Redis"
icon={<LayersIcon />}
/>
{window.PROMETHEUS_SERVER_ADDRESS && (
<ListItemLink
to="/TODO"
primary="Metrics"
icon={<TimelineIcon />}
/>
)}
</div>
</List>
<List>

6
ui/src/global.d.ts vendored
View File

@@ -2,4 +2,8 @@ interface Window {
// Root URL path for asynqmon app.
// ROOT_PATH should not have the tailing slash.
ROOT_PATH: string;
}
// Prometheus server address to query time series data.
// This field is set to empty string by default. Use this field only if it's set.
PROMETHEUS_SERVER_ADDRESS: string;
}