Guh
This commit is contained in:
parent
203629639f
commit
07dc35f3ac
22
index.js
22
index.js
|
@ -51,7 +51,7 @@ app.get("/", (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use('/event-logs',
|
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'))
|
express.static(path.join(__dirname, 'event-logs'))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -481,7 +481,6 @@ xmpp.on("stanza", (stanza) => {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
fs.writeFileSync(logPath, JSON.stringify({evt, stanza, product_id, product_id_raw, bodyData, body}, getCircularReplacer(), 2), 'utf8');
|
|
||||||
|
|
||||||
if (!evt) {
|
if (!evt) {
|
||||||
evt = { name: "Unknown", priority: 3 }
|
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();
|
tryGetText();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue