Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 953bd581 authored by Antoine Blanquet's avatar Antoine Blanquet
Browse files

Fixing bug relative path when generating sparkline image + changing csv...

Fixing bug relative path when generating sparkline image + changing csv emplacment file + fixing bug upddate url orga missing path to data/generated files
parent 781ea8b1
const webshot = require('webshot');
webshot('file:///home/blanquan/Bureau/2019-2022_Polytech/2emeAnnee/Tronc_Info/projet_campus_iot/chirpstack-monitoring/reports/.gateways.html',
webshot('file:./data/generated_files/.gateways.html',
'data/images/sparkline_report.png', function(err) {
if (!err) {
console.log("Screenshot taken!")
......
......@@ -9,12 +9,13 @@
# DATA REPOSITORY
DATA_GAT_FOLDER="data/gateways/"
DATA_GENERATED_FOLDER="data/generated_files/"
rm .mails.csv
GWIDS=$(jq --raw-output ".result | sort_by(.lastSeenAt, .id) | reverse [] | (.id)" .gateways.json)
for GWID in $GWIDS
do
node ./parse_gateway.js ${DATA_GAT_FOLDER}.gateway-${GWID}.json >> .mails.csv
node ./parse_gateway.js ${DATA_GAT_FOLDER}.gateway-${GWID}.json >> ${DATA_GENERATED_FOLDER}.mails.csv
done
......
......@@ -11,6 +11,9 @@
# Bug:
# -------------------------------------------------
DATA_HTML_FOLDER="data/generated_files/"
devices_html="${DATA_HTML_FOLDER}.devices.html"
# Parameters
if [[ $# -ne 2 ]] ; then
echo "Usage: $0 DID OID"
......@@ -20,7 +23,7 @@ fi
DID="$1/devices"
OID="$2"
tmp=$(grep $DID < .devices.html)
tmp=$(grep $DID < ${devices_html})
replacement=${tmp/"null"/"$OID"}
......@@ -28,5 +31,5 @@ if [ -z "$replacement" ]
then
exit
else
sed -i "/${DID//\//\\/}/c $replacement" .devices.html
sed -i "/${DID//\//\\/}/c $replacement" ${devices_html}
fi
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment