This commit is contained in:
Christopher Cookman 2025-06-21 00:37:55 -06:00
parent 203629639f
commit 07dc35f3ac

View file

@ -51,7 +51,7 @@ app.get("/", (req, res) => {
});
app.use('/event-logs',
serveIndex(path.join(__dirname, 'event-logs'), { icons: true, view: 'details' }),
serveIndex(path.join(__dirname, 'event-logs'), { icons: true, view: , hidden: true }),
express.static(path.join(__dirname, 'event-logs'))
);
@ -481,7 +481,6 @@ xmpp.on("stanza", (stanza) => {
return value;
};
};
fs.writeFileSync(logPath, JSON.stringify({evt, stanza, product_id, product_id_raw, bodyData, body}, getCircularReplacer(), 2), 'utf8');
if (!evt) {
evt = { name: "Unknown", priority: 3 }
@ -568,6 +567,25 @@ xmpp.on("stanza", (stanza) => {
}
})
});
fs.writeFileSync(logPath, JSON.stringify({
evt, stanza, product_id, product_id_raw, bodyData, body, sentData: {
"type": "iem-message",
"data": {
"channel": getWFOByRoom(fromChannel),
"event": evt,
"body": bodyData,
"timestamp": product_id.timestamp,
"wmo": product_id.wmo,
"pil": product_id.pil,
"station": product_id.station,
"product_data": product_id,
"raw": product_id_raw,
"rawBody": body,
"image": stanza.getChild("x").attrs.twitter_media || null,
"productText": text || null
}
}
}, getCircularReplacer(), 2), 'utf8');
}
tryGetText();
}