Compare commits

...

6 Commits

Author SHA1 Message Date
Gala 1dae3c3fc2 remove vAxis label 2022-08-16 14:08:00 +02:00
Gala 574e5cf10a change legend 2022-08-16 13:42:48 +02:00
Gala b3fcbb6726 remove log 2022-08-16 12:28:09 +02:00
Gala f96a60b6a2 log in staging 2022-08-16 12:10:17 +02:00
Gala f7b979825b Merge branch 'develop' into 340-ne-content 2022-08-10 16:44:02 +02:00
Gala 6ac1259f7a changing content 2022-08-10 11:24:02 +02:00
2 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ import { ApiState, UptimeStoryResponse } from '../typeDefs/explorer-api';
interface ChartProps {
title?: string;
xLabel: string;
yLabel: string;
yLabel?: string;
uptimeStory: ApiState<UptimeStoryResponse>;
loading: boolean;
}
@@ -23,7 +23,7 @@ export const UptimeChart: React.FC<ChartProps> = ({ title, xLabel, yLabel, uptim
const color = theme.palette.text.primary;
React.useEffect(() => {
if (uptimeStory.data?.history) {
const allFormattedChartData: FormattedChartData = [['Date', 'Uptime']];
const allFormattedChartData: FormattedChartData = [['Date', 'Score']];
uptimeStory.data.history.forEach((eachDate) => {
const formattedDateUptimeRecord: FormattedDateRecord = [
format(new Date(eachDate.date), 'MMM dd'),
@@ -34,7 +34,7 @@ export const UptimeChart: React.FC<ChartProps> = ({ title, xLabel, yLabel, uptim
setFormattedChartData(allFormattedChartData);
} else {
const emptyData: any = [
['Date', 'Uptime'],
['Date', 'Score'],
['Jul 27', 10],
];
setFormattedChartData(emptyData);
@@ -55,7 +55,7 @@ export const UptimeChart: React.FC<ChartProps> = ({ title, xLabel, yLabel, uptim
uptimeStory.data
? formattedChartData
: [
['Date', 'Uptime'],
['Date', 'Routing Score'],
[format(new Date(Date.now()), 'MMM dd'), 0],
]
}
@@ -87,7 +87,7 @@ export const UptimeChart: React.FC<ChartProps> = ({ title, xLabel, yLabel, uptim
},
},
vAxis: {
// % uptime vertical
// vertical / % Routing Score
viewWindow: {
min: 0,
max: 100,
+3 -3
View File
@@ -137,9 +137,9 @@ const PageMixnodeDetailWithState: React.FC = () => {
</Grid>
<Grid item xs={12} md={8}>
{uptimeStory && (
<ContentCard title="Uptime story">
{uptimeStory.error && <ComponentError text="There was a problem retrieving uptime history." />}
<UptimeChart loading={uptimeStory.isLoading} xLabel="date" yLabel="uptime" uptimeStory={uptimeStory} />
<ContentCard title="Routing Score">
{uptimeStory.error && <ComponentError text="There was a problem retrieving routing score." />}
<UptimeChart loading={uptimeStory.isLoading} xLabel="date" uptimeStory={uptimeStory} />
</ContentCard>
)}
</Grid>