pass chart to all containers

pull/1918/head
Ben Phelps 1 year ago
parent ef3da08d93
commit 7a1f8850b8

@ -38,11 +38,11 @@ export default function Component({ service }) {
}, [data]); }, [data]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

@ -49,17 +49,17 @@ export default function Component({ service }) {
}, [dataPoints]); }, [dataPoints]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
const diskData = data.find((item) => item.disk_name === diskName); const diskData = data.find((item) => item.disk_name === diskName);
if (!diskData) { if (!diskData) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
const diskRates = calculateRates(dataPoints); const diskRates = calculateRates(dataPoints);

@ -17,17 +17,17 @@ export default function Component({ service }) {
}); });
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
const fsData = data.find((item) => item[item.key] === fsName); const fsData = data.find((item) => item[item.key] === fsName);
if (!fsData) { if (!fsData) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

@ -42,18 +42,18 @@ export default function Component({ service }) {
}, [data, gpuName]); }, [data, gpuName]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
const gpuData = data.find((item) => item[item.key] == gpuName); const gpuData = data.find((item) => item[item.key] == gpuName);
if (!gpuData) { if (!gpuData) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

@ -74,11 +74,11 @@ export default function Component({ service }) {
}); });
if (quicklookError) { if (quicklookError) {
return <Container><Error error={quicklookError} /></Container>; return <Container chart={chart}><Error error={quicklookError} /></Container>;
} }
if (systemError) { if (systemError) {
return <Container><Error error={systemError} /></Container>; return <Container chart={chart}><Error error={systemError} /></Container>;
} }
const dataCharts = []; const dataCharts = [];

@ -37,11 +37,11 @@ export default function Component({ service }) {
}, [data]); }, [data]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

@ -41,17 +41,17 @@ export default function Component({ service }) {
}, [data, interfaceName]); }, [data, interfaceName]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
const interfaceData = data.find((item) => item[item.key] === interfaceName); const interfaceData = data.find((item) => item[item.key] === interfaceName);
if (!interfaceData) { if (!interfaceData) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

@ -27,11 +27,11 @@ export default function Component({ service }) {
}); });
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
data.splice(chart ? 5 : 1); data.splice(chart ? 5 : 1);

@ -38,17 +38,17 @@ export default function Component({ service }) {
}, [data, sensorName]); }, [data, sensorName]);
if (error) { if (error) {
return <Container><Error error={error} /></Container>; return <Container chart={chart}><Error error={error} /></Container>;
} }
if (!data) { if (!data) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
const sensorData = data.find((item) => item.label === sensorName); const sensorData = data.find((item) => item.label === sensorName);
if (!sensorData) { if (!sensorData) {
return <Container><Block position="bottom-3 left-3">-</Block></Container>; return <Container chart={chart}><Block position="bottom-3 left-3">-</Block></Container>;
} }
return ( return (

Loading…
Cancel
Save