Remove empty whitespace lines
This commit is contained in:
+3
-3
@@ -679,10 +679,10 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura
|
|||||||
try {
|
try {
|
||||||
const api_key = localStorage.getItem('api_key', 'null');
|
const api_key = localStorage.getItem('api_key', 'null');
|
||||||
const params = { end: end.unix(), duration: duration.len.toLowerCase(), window: duration.win, api_key: api_key };
|
const params = { end: end.unix(), duration: duration.len.toLowerCase(), window: duration.win, api_key: api_key };
|
||||||
|
|
||||||
const names = sensors.join(',');
|
const names = sensors.join(',');
|
||||||
const res = await axios.get(`https://sensors-api.dns.t0.vc/history/${measurement}/${names}`, { params });
|
const res = await axios.get(`https://sensors-api.dns.t0.vc/history/${measurement}/${names}`, { params });
|
||||||
|
|
||||||
const formattedData = res.data.map(d => {
|
const formattedData = res.data.map(d => {
|
||||||
const newObj = { time: d.time };
|
const newObj = { time: d.time };
|
||||||
sensors.forEach(sensor => {
|
sensors.forEach(sensor => {
|
||||||
@@ -690,7 +690,7 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura
|
|||||||
});
|
});
|
||||||
return newObj;
|
return newObj;
|
||||||
});
|
});
|
||||||
|
|
||||||
setData(formattedData);
|
setData(formattedData);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -556,12 +556,12 @@ async def history(request):
|
|||||||
q += ' tz(\'America/Edmonton\')'
|
q += ' tz(\'America/Edmonton\')'
|
||||||
|
|
||||||
points = list(client.query(q).get_points())
|
points = list(client.query(q).get_points())
|
||||||
|
|
||||||
for p in points:
|
for p in points:
|
||||||
t = p['time']
|
t = p['time']
|
||||||
if t not in time_map:
|
if t not in time_map:
|
||||||
time_map[t] = {'time': t}
|
time_map[t] = {'time': t}
|
||||||
|
|
||||||
if len(names) > 1:
|
if len(names) > 1:
|
||||||
for k, v in p.items():
|
for k, v in p.items():
|
||||||
if k != 'time':
|
if k != 'time':
|
||||||
|
|||||||
Reference in New Issue
Block a user