Commit 08f75dff authored by Kevin Yung's avatar Kevin Yung
Browse files

Implémentation fonctionnel du changement de couleur dans le html si la gateway a changé de state

parent 93eaa137
{"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjaGlycHN0YWNrLWFwcGxpY2F0aW9uLXNlcnZlciIsImV4cCI6MTYxNTM4NTYwNCwiaXNzIjoiY2hpcnBzdGFjay1hcHBsaWNhdGlvbi1zZXJ2ZXIiLCJuYmYiOjE2MTUyOTkyMDQsInN1YiI6InVzZXIiLCJ1c2VybmFtZSI6IkNoaXJwc3RhY2tNb25pdG9yaW5nIn0.kN3SzNxo7Eo5a7c7oN2hv6s0-0YPvI1xmfuP_rxYNfI"}
\ No newline at end of file
{"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjaGlycHN0YWNrLWFwcGxpY2F0aW9uLXNlcnZlciIsImV4cCI6MTYxNTM4NzM2NCwiaXNzIjoiY2hpcnBzdGFjay1hcHBsaWNhdGlvbi1zZXJ2ZXIiLCJuYmYiOjE2MTUzMDA5NjQsInN1YiI6InVzZXIiLCJ1c2VybmFtZSI6IkNoaXJwc3RhY2tNb25pdG9yaW5nIn0.H5mO2AL35i-0BK4YBTZTZ_5MHDKqq-7c7HPqexnKQOU"}
\ No newline at end of file
#!/bin/bash
replacement="<li><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z+CHANGED</li>"
id_to_replace="7276ff0039030716"
sed -i '$id_to_replace/c $replacement' test.html
#sed -i 's/^/\t\t/' <filename>
\ No newline at end of file
......@@ -79,7 +79,13 @@ do
then
if [[ "${state[$i]}" != "${state_2[$j]}" ]]
then
echo ${id[$i]}+"CHANGEMENT"
if [[ "${state[$i]}" == "active" ]]
then
replacement="<li style="color:green"><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z</li>"
else
replacement="<li style="color:red"><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z</li>"
fi
sed -i "/${id[$i]}/c $replacement" .gateways.html
fi
fi
done
......
<html><head><title>CampusIoT LNS :: Gateways</title></head><body style="font-family:verdana;"><h1>CampusIoT LNS :: Gateways</h1>
<p>generated at
2021-03-07 20:14:44 CET
-
2021-03-07 19:14:44 GMT
</p>
<h2>Active gateways</h2>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030724'>7276ff0039030724</a>: KER_FEMTO_030724_P124 - (org 6) - 2021-03-07T19:14:43.999206Z</li>
t <li><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030716'>7276ff0039030716</a>: KER_FEMTO_030716_P307 - (org 6) - 2021-03-07T19:14:43.804084Z+CHANGED</li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/0000024b0805031a'>0000024b0805031a</a>: KER_107_POLYTECH - (org 6) - 2021-03-07T19:14:35.502922Z</li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/6/gateways/7276ff0039030871'>7276ff0039030871</a>: KER_FEMTO_030871_NP - (org 6) - 2021-03-07T19:14:32.213986Z</li>
<h2>Passive gateways</h2>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/080027ffff052e4a'>080027ffff052e4a</a>: LRWAN2_2E4A - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015b18'>0080e1ffff015b18</a>: LRWAN2_5B18 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015abf'>0080e1ffff015abf</a>: LRWAN3_5ABF_EU433 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff0153f1'>0080e1ffff0153f1</a>: LRWAN2_0153F1_KEKA - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff0153d7'>0080e1ffff0153d7</a>: LRWAN2_153D7_SONZOGNI - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff0153cc'>0080e1ffff0153cc</a>: LRWAN2_53CC - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff01525e'>0080e1ffff01525e</a>: LRWAN2_525E - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015257'>0080e1ffff015257</a>: LRWAN2_5257_ROFFET_ROBERT - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015256'>0080e1ffff015256</a>: LRWAN2_5256 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015253'>0080e1ffff015253</a>: LRWAN2_5253 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015252'>0080e1ffff015252</a>: LRWAN2_5252 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015244'>0080e1ffff015244</a>: LRWAN2_5244 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015242'>0080e1ffff015242</a>: LRWAN2_5242_HUMBERT - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015241'>0080e1ffff015241</a>: LRWAN2_5241 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff015240'>0080e1ffff015240</a>: LRWAN2_5240 - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff01523e'>0080e1ffff01523e</a>: LRWAN2_523E_VIVIANI - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff01523c'>0080e1ffff01523c</a>: LRWAN2_523C_THOMAS_HERVE - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff014feb'>0080e1ffff014feb</a>: LRWAN2_4FEB_ROTIVAL - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff014fe1'>0080e1ffff014fe1</a>: LRWAN2_4FE1_ROFFET_ROBERT - (org 5) - </li>
<li><a href='https://lns.campusiot.imag.fr/#/organizations/5/gateways/0080e1ffff011234'>0080e1ffff011234</a>: LRWAN2_1234 - (org 5) - </li>
</body></html>
\ No newline at end of file
Supports Markdown
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