updated as in the terminal and gate api's
This commit is contained in:
parent
76744c1b6f
commit
74c8ed661c
13 changed files with 109 additions and 75 deletions
|
|
@ -60,6 +60,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||
|
||||
export default function GateGraphs(props: Props) {
|
||||
const { gate, display, compMap, device, pressure, ambient, setPCAState } = props;
|
||||
const [{ as }] = useGlobalState();
|
||||
const [xDomain, setXDomain] = useState<string[] | number[]>(["dataMin", "dataMax"]);
|
||||
const [zoomed, setZoomed] = useState(false);
|
||||
const defaultDateRange = GetDefaultDateRange();
|
||||
|
|
@ -79,7 +80,7 @@ export default function GateGraphs(props: Props) {
|
|||
setLoading(true);
|
||||
let measurementMap: Map<string, UnitMeasurement[]> = new Map<string, UnitMeasurement[]>();
|
||||
gateAPI
|
||||
.listGateMeasurements(gate.key, startDate.toISOString(), endDate.toISOString())
|
||||
.listGateMeasurements(gate.key, startDate.toISOString(), endDate.toISOString(), as)
|
||||
.then(resp => {
|
||||
resp.data.measurements.forEach(um => {
|
||||
let unitMeasurement = UnitMeasurement.any(um, user);
|
||||
|
|
@ -93,7 +94,7 @@ export default function GateGraphs(props: Props) {
|
|||
setLoading(false);
|
||||
setCompMeasurements(measurementMap);
|
||||
});
|
||||
}, [gate, endDate, gateAPI, startDate]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [gate, endDate, gateAPI, startDate, as]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const updateDateRange = (newStartDate: any, newEndDate: any) => {
|
||||
let range = GetDefaultDateRange();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue