Update start-fermatebus.
This commit is contained in:
parent
2f99dfd532
commit
09c037a89a
|
@ -52,6 +52,7 @@
|
|||
<div class="riga">
|
||||
<h2 class="piccolospazio">Ravenna:</h2>
|
||||
<p class="piccolospazio">
|
||||
Ora è possibile visualizzare gli orari fermata in <a class="novita" href="/start_menu/servizi/start-fermatebus/index.html">visualizzatore fermate</a>.<br>
|
||||
Aggiunti <a class="novita" href="/startravenna_bus/suburbano/manlc19g.html">MAN Lion's City 19G</a>.<br>
|
||||
Aggiunti servizi Start.
|
||||
</p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<title>START Romagna - Informazioni fermata</title>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="shortcut icon" href="img/favicon.ico">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<h2>Informazioni fermata</h2>
|
||||
<h2>Informazioni fermata <span id="fermata-span"></span></h2>
|
||||
<div id="tabella-container">Caricamento dati...</div>
|
||||
<footer>
|
||||
<p>Copyright (C) 2025 ER-TPL Team - <a href="https://ertpl.pages.dev" target="_blank">ertpl.pages.dev</a> - code by Il Dani <a href="https://git.vichingo455.freeddns.org/daniele/start-fermatebus" target="_blank">Codice Sorgente</a><br>
|
||||
|
|
|
@ -2,15 +2,15 @@ const params = new URLSearchParams(window.location.search);
|
|||
const palina = params.get('palina');
|
||||
const targetID = params.get('targetID');
|
||||
const selectedOption = params.get('selectedOption');
|
||||
console.log(palina, targetID, selectedOption);
|
||||
|
||||
// Esempio URL backend che ritorna JSON { linea, destinazione, veicolo, soppressa }
|
||||
const urlBackend = `https://api.vichingo455.freeddns.org/start-fermatebus.json/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`;
|
||||
|
||||
//const urlBackend = `http://localhost:3005/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`;
|
||||
function caricadati(){
|
||||
fetch(urlBackend)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const fermata_span = document.getElementById('fermata-span');
|
||||
fermata_span.innerHTML = `"${data[0].fermata}"`;
|
||||
const container = document.getElementById('tabella-container');
|
||||
container.innerHTML = '';
|
||||
|
||||
|
@ -28,6 +28,8 @@ function caricadati(){
|
|||
<tr>
|
||||
<th>Linea</th>
|
||||
<th>Destinazione</th>
|
||||
<th>Orario</th>
|
||||
<th>Stato attuale</th>
|
||||
<th>Veicolo</th>
|
||||
<th>Soppressa</th>
|
||||
</tr>
|
||||
|
@ -36,7 +38,7 @@ function caricadati(){
|
|||
|
||||
// Corpo tabella
|
||||
const tbody = document.createElement('tbody');
|
||||
data.forEach(item => {
|
||||
data.slice(1).forEach(item => {
|
||||
const tr = document.createElement('tr');
|
||||
if (item.soppressa) {
|
||||
tr.classList.add('bus-card-red');
|
||||
|
@ -44,6 +46,8 @@ function caricadati(){
|
|||
tr.innerHTML = `
|
||||
<td>${item.linea}</td>
|
||||
<td>${item.destinazione}</td>
|
||||
<td>${item.orario}</td>
|
||||
<td>${item.stato}</td>
|
||||
<td>${item.mezzo}</td>
|
||||
<td>${item.soppressa ? 'Sì' : 'No'}</td>
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue