(ui): Fix styles for dark-theme in metrics view

This commit is contained in:
Ken Hibino
2021-12-17 06:50:31 -08:00
parent 0662912c3a
commit 3998c4214c
6 changed files with 26 additions and 9 deletions

View File

@@ -30,8 +30,12 @@ export default function DailyStatsChart(props: Props) {
<ResponsiveContainer> <ResponsiveContainer>
<LineChart data={data}> <LineChart data={data}>
<CartesianGrid strokeDasharray="3 3" /> <CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="date" minTickGap={10} /> <XAxis
<YAxis /> dataKey="date"
minTickGap={10}
stroke={theme.palette.text.secondary}
/>
<YAxis stroke={theme.palette.text.secondary} />
<Tooltip /> <Tooltip />
<Legend /> <Legend />
<Line <Line

View File

@@ -350,7 +350,11 @@ function MetricsFetchControls(props: Props) {
return ( return (
<div className={classes.root}> <div className={classes.root}>
<Typography variant="caption" className={classes.endTimeCaption}> <Typography
variant="caption"
color="textPrimary"
className={classes.endTimeCaption}
>
{formatTime(props.endTimeSec)} {formatTime(props.endTimeSec)}
</Typography> </Typography>
<div> <div>

View File

@@ -27,8 +27,8 @@ function ProcessedTasksChart(props: Props) {
<ResponsiveContainer> <ResponsiveContainer>
<BarChart data={props.data} maxBarSize={120}> <BarChart data={props.data} maxBarSize={120}>
<CartesianGrid strokeDasharray="3 3" /> <CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="queue" /> <XAxis dataKey="queue" stroke={theme.palette.text.secondary} />
<YAxis /> <YAxis stroke={theme.palette.text.secondary} />
<Tooltip /> <Tooltip />
<Legend /> <Legend />
<Bar <Bar

View File

@@ -1,3 +1,4 @@
import { useTheme } from "@material-ui/core/styles";
import React from "react"; import React from "react";
import { import {
LineChart, LineChart,
@@ -57,6 +58,8 @@ const lineColors = [
]; ];
function QueueMetricsChart(props: Props) { function QueueMetricsChart(props: Props) {
const theme = useTheme();
const data = toChartData(props.data); const data = toChartData(props.data);
const keys = props.data.map((x) => x.metric.queue); const keys = props.data.map((x) => x.metric.queue);
return ( return (
@@ -72,8 +75,12 @@ function QueueMetricsChart(props: Props) {
} }
type="number" type="number"
scale="time" scale="time"
stroke={theme.palette.text.secondary}
/>
<YAxis
tickFormatter={props.yAxisTickFormatter}
stroke={theme.palette.text.secondary}
/> />
<YAxis tickFormatter={props.yAxisTickFormatter} />
<Tooltip <Tooltip
labelFormatter={(timestamp: number) => { labelFormatter={(timestamp: number) => {
return new Date(timestamp * 1000).toLocaleTimeString(); return new Date(timestamp * 1000).toLocaleTimeString();

View File

@@ -10,6 +10,7 @@ import {
ResponsiveContainer, ResponsiveContainer,
} from "recharts"; } from "recharts";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { useTheme } from "@material-ui/core/styles";
import { queueDetailsPath } from "../paths"; import { queueDetailsPath } from "../paths";
interface Props { interface Props {
@@ -27,6 +28,7 @@ interface TaskBreakdown {
} }
function QueueSizeChart(props: Props) { function QueueSizeChart(props: Props) {
const theme = useTheme();
const handleClick = (params: { activeLabel?: string } | null) => { const handleClick = (params: { activeLabel?: string } | null) => {
const allQueues = props.data.map((b) => b.queue); const allQueues = props.data.map((b) => b.queue);
if ( if (
@@ -47,8 +49,8 @@ function QueueSizeChart(props: Props) {
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
> >
<CartesianGrid strokeDasharray="3 3" /> <CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="queue" /> <XAxis dataKey="queue" stroke={theme.palette.text.secondary} />
<YAxis /> <YAxis stroke={theme.palette.text.secondary} />
<Tooltip /> <Tooltip />
<Legend /> <Legend />
<Bar dataKey="active" stackId="a" fill="#1967d2" /> <Bar dataKey="active" stackId="a" fill="#1967d2" />

View File

@@ -246,7 +246,7 @@ function ChartRow(props: ChartRowProps) {
return ( return (
<> <>
<div className={classes.chartInfo}> <div className={classes.chartInfo}>
<Typography>{props.title}</Typography> <Typography color="textPrimary">{props.title}</Typography>
{props.metrics.status === "error" && ( {props.metrics.status === "error" && (
<div className={classes.errorMessage}> <div className={classes.errorMessage}>
<WarningIcon fontSize="small" className={classes.warningIcon} /> <WarningIcon fontSize="small" className={classes.warningIcon} />