fix bindTagLegendForMonitors

fix-multi-trigger
Moe 2023-03-15 13:24:26 -07:00
parent ac68b16bf6
commit 592a1f6144
1 changed files with 5 additions and 6 deletions

View File

@ -29,7 +29,7 @@ module.exports = (s,config,lang) => {
setLastTracked, setLastTracked,
trackObjectWithTimeout, trackObjectWithTimeout,
getAllMatricesThatMoved, getAllMatricesThatMoved,
} = require('./tracking.js')(s,config,lang,app,io) } = require('./tracking.js')(s,config,lang)
const { const {
isEven, isEven,
fetchTimeout, fetchTimeout,
@ -353,13 +353,12 @@ module.exports = (s,config,lang) => {
const monitorIds = Object.keys(theGroup.rawMonitorConfigurations) const monitorIds = Object.keys(theGroup.rawMonitorConfigurations)
monitorIds.forEach((monitorId) => { monitorIds.forEach((monitorId) => {
const monitorConfig = theGroup.rawMonitorConfigurations[monitorId] const monitorConfig = theGroup.rawMonitorConfigurations[monitorId]
const theTags = monitorConfig.tags || '' const theTags = (monitorConfig.tags || '').split(',')
theTags.split(',').forEach((tag) => { theTags.forEach((tag) => {
if(!tag)return; if(!tag)return;
if(!newTagLegend[tag])newTagLegend[tag] = {} if(!newTagLegend[tag])newTagLegend[tag] = []
newTagLegend[tag][monitorId] = {} if(newTagLegend[tag].indexOf(monitorId) === -1)newTagLegend[tag].push(monitorId)
}) })
newTagLegend[tag] = Object.keys(newTagLegend[tag])
}) })
theGroup.tagLegend = newTagLegend theGroup.tagLegend = newTagLegend
} }