Address on markers and on graph
public/javascripts/chart_utilities.js
- add address in #addSensorID'
- function 'addAddress' added
public/javascripts/datetime.js
- removed unnecessary comment
public/javascripts/global.js
- refreshrate changed to 5 min
- typo 'autohide' corrected
views/index.pug
- removed text 'only for live ...'
views/layout.pug
- removed superflous links and variables
public/javascripts/maps.js
- added address to marker popup
charts/preparecharts.js
- translate legend texts
public/javascripts/showcharts.js
- dont show selected tab
public/stylesheets/style.sass
- add style for sensornumber on chart
loclae/[de|en]/translation.json
- added translations for legend
charts/utilities.js
- ymax for live set to 120
This commit is contained in:
@@ -162,8 +162,9 @@ export function calcDays(data, isyear) {
|
||||
|
||||
export async function addSensorID2chart(chart, sensor, width) {
|
||||
let indoor = sensor.indoor || false
|
||||
let addr = await addAddress(sensor.sid)
|
||||
let sens = chart.renderer.label(
|
||||
`Sensor: ${sensor.sid} ${indoor ? ' (indoor)' : ''}`,
|
||||
`Sensor: <span class="bigger">${sensor.sid}</span> ${indoor ? ' (indoor)' : ''} ${addr}`,
|
||||
width / 2 - 100, 65,
|
||||
'text', 0, 0, true)
|
||||
.css({
|
||||
@@ -212,4 +213,14 @@ export const fetchfromserver = async (url) => {
|
||||
// return await ret.json()
|
||||
let x = await ret.json()
|
||||
return x
|
||||
}
|
||||
}
|
||||
|
||||
export const addAddress = async (sid) => {
|
||||
let url = `/api/getaddress?sensorid=${sid}`
|
||||
let erg = await fetchfromserver(url)
|
||||
if (!erg.err) {
|
||||
return erg.address
|
||||
} else {
|
||||
return "no address"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user