Add bus & ferry to public ldb
This commit is contained in:
parent
3c191c4793
commit
7df190220f
@ -19,7 +19,7 @@
|
|||||||
{link.toUpperCase()}
|
{link.toUpperCase()}
|
||||||
</a>
|
</a>
|
||||||
{:else if link.length === 4}
|
{:else if link.length === 4}
|
||||||
<a class="link" href="/result-timetable?headcode={link}">
|
<a class="link" href="/train?headcode={link}">
|
||||||
{link.toUpperCase()}
|
{link.toUpperCase()}
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -18,4 +18,10 @@
|
|||||||
<p>{line}</p>
|
<p>{line}</p>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
</Island>
|
</Island>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
p {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
export let station = "";
|
export let station = "";
|
||||||
|
export let title = "Loading...";
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import Loading from '$lib/navigation/loading.svelte';
|
import Loading from '$lib/navigation/loading.svelte';
|
||||||
|
|
||||||
@ -8,24 +9,40 @@
|
|||||||
|
|
||||||
let jsonData = null;
|
let jsonData = null;
|
||||||
let services = [];
|
let services = [];
|
||||||
|
let busServices = [];
|
||||||
|
let ferryServices = [];
|
||||||
let dataAge = null;
|
let dataAge = null;
|
||||||
let isLoading = true;
|
let isLoading = true;
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (jsonData === null && requestedStation) {
|
if (jsonData === null && requestedStation) {
|
||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jsonData?.GetStationBoardResult?.generatedAt) {
|
||||||
|
dataAge = new Date(jsonData.GetStationBoardResult.generatedAt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonData?.GetStationBoardResult?.trainServices?.service) {
|
||||||
|
services = jsonData.GetStationBoardResult.trainServices.service;
|
||||||
|
} else {
|
||||||
|
services = [];
|
||||||
|
}
|
||||||
|
|
||||||
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.generatedAt) {
|
if (jsonData?.GetStationBoardResult?.busServices?.service) {
|
||||||
dataAge = new Date(jsonData.GetStationBoardResult.generatedAt);
|
busServices = jsonData.GetStationBoardResult.busServices.service;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.trainServices && jsonData.GetStationBoardResult.trainServices.service) {
|
if (jsonData?.GetStationBoardResult?.ferryServices?.service) {
|
||||||
services = jsonData.GetStationBoardResult.trainServices.service;
|
ferryServices = jsonData.GetStationBoardResult.ferryServices.service;
|
||||||
} else {
|
}
|
||||||
services = [];
|
|
||||||
|
if (jsonData?.GetStationBoardResult?.locationName) {
|
||||||
|
title = jsonData.GetStationBoardResult.locationName
|
||||||
|
} else {
|
||||||
|
title = "Loading Board"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
isLoading = true; // Set loading state
|
isLoading = true; // Set loading state
|
||||||
@ -90,48 +107,119 @@
|
|||||||
<Loading />
|
<Loading />
|
||||||
{:else}
|
{:else}
|
||||||
<p id="timestamp">Updated: {dataAge.toLocaleTimeString()}</p>
|
<p id="timestamp">Updated: {dataAge.toLocaleTimeString()}</p>
|
||||||
<p>Public LDB for {station}</p>
|
{#if services.length}
|
||||||
|
<table>
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th class="from">From</th>
|
|
||||||
<th class="to">To</th>
|
|
||||||
<th class="plat">Plat.</th>
|
|
||||||
<th class="time">Sch Arr.</th>
|
|
||||||
<th class="time">Exp Arr.</th>
|
|
||||||
<th class="time">Sch Dep.</th>
|
|
||||||
<th class="time">Exp Dep.</th>
|
|
||||||
</tr>
|
|
||||||
{#each services as service}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
|
<th class="from">From</th>
|
||||||
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
|
<th class="to">To</th>
|
||||||
<td class="plat">{service.platform || '-'}</td>
|
<th class="plat">Plat.</th>
|
||||||
<td class="time">{parseTime(service.sta).data}</td>
|
<th class="time">Sch Arr.</th>
|
||||||
<td class="time {parseTime(service.eta).changed}">{parseTime(service.eta).data}</td>
|
<th class="time">Exp Arr.</th>
|
||||||
<td class="time">{parseTime(service.std).data}</td>
|
<th class="time">Sch Dep.</th>
|
||||||
<td class="time {parseTime(service.etd).changed}">{parseTime(service.etd).data}</td>
|
<th class="time">Exp Dep.</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- service-detail elements are currently contained within the 'From' column
|
{#each services as service}
|
||||||
It should be underneath the row. I will need to look at the vanilla interface
|
<tr>
|
||||||
to establish what I did differently there. Or, I can insert a new row
|
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
|
||||||
with colspan="7" to add a row spanning all columns.-->
|
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
|
||||||
<tr><td colspan="7">
|
<td class="plat">{service.platform || '-'}</td>
|
||||||
<p class="service-detail">
|
<td class="time">{parseTime(service.sta).data}</td>
|
||||||
A {service.operator || 'Unknown'} service
|
<td class="time {parseTime(service.eta).changed}">{parseTime(service.eta).data}</td>
|
||||||
{#if service['length']}
|
<td class="time">{parseTime(service.std).data}</td>
|
||||||
with {service['length'] || 'some'} coaches
|
<td class="time {parseTime(service.etd).changed}">{parseTime(service.etd).data}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr><td colspan="7">
|
||||||
|
<p class="service-detail">
|
||||||
|
A {service.operator || 'Unknown'} service
|
||||||
|
{#if service['length']}
|
||||||
|
with {service['length'] || 'some'} coaches
|
||||||
|
{/if}
|
||||||
|
</p>
|
||||||
|
{#if service.delayReason}
|
||||||
|
<p class="service-detail">{service.delayReason}</p>
|
||||||
{/if}
|
{/if}
|
||||||
</p>
|
{#if service.cancelReason}
|
||||||
{#if service.delayReason}
|
<p class="service-detail">{service.cancelReason}</p>
|
||||||
<p class="service-detail">{service.delayReason}</p>
|
{/if}
|
||||||
{/if}
|
</td></tr>
|
||||||
{#if service.cancelReason}
|
{/each}
|
||||||
<p class="service-detail">{service.cancelReason}</p>
|
</table>
|
||||||
{/if}
|
{:else}
|
||||||
</td></tr>
|
<p>No Scheduled Train Services</p>
|
||||||
{/each}
|
{/if}
|
||||||
</table>
|
{#if busServices.length}
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="from">From</th>
|
||||||
|
<th class="to">To</th>
|
||||||
|
<th class="time">Sch Arr.</th>
|
||||||
|
<th class="time">Exp Arr.</th>
|
||||||
|
<th class="time">Sch Dep.</th>
|
||||||
|
<th class="time">Exp Dep.</th>
|
||||||
|
</tr>
|
||||||
|
{#each busServices as service}
|
||||||
|
<tr>
|
||||||
|
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
|
||||||
|
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
|
||||||
|
<td class="time">{parseTime(service.sta).data}</td>
|
||||||
|
<td class="time {parseTime(service.eta).changed}">{parseTime(service.eta).data}</td>
|
||||||
|
<td class="time">{parseTime(service.std).data}</td>
|
||||||
|
<td class="time {parseTime(service.etd).changed}">{parseTime(service.etd).data}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr><td colspan="7">
|
||||||
|
<p class="service-detail">
|
||||||
|
A {service.operator || 'Unknown'} service
|
||||||
|
</p>
|
||||||
|
{#if service.delayReason}
|
||||||
|
<p class="service-detail">{service.delayReason}</p>
|
||||||
|
{/if}
|
||||||
|
{#if service.cancelReason}
|
||||||
|
<p class="service-detail">{service.cancelReason}</p>
|
||||||
|
{/if}
|
||||||
|
</td></tr>
|
||||||
|
{/each}
|
||||||
|
</table>
|
||||||
|
{:else}
|
||||||
|
<p>No Scheduled Bus Services</p>
|
||||||
|
{/if}
|
||||||
|
{#if ferryServices.length}
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="from">From</th>
|
||||||
|
<th class="to">To</th>
|
||||||
|
<th class="time">Sch Arr.</th>
|
||||||
|
<th class="time">Exp Arr.</th>
|
||||||
|
<th class="time">Sch Dep.</th>
|
||||||
|
<th class="time">Exp Dep.</th>
|
||||||
|
</tr>
|
||||||
|
{#each ferryServices as service}
|
||||||
|
<tr>
|
||||||
|
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
|
||||||
|
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
|
||||||
|
<td class="time">{parseTime(service.sta).data}</td>
|
||||||
|
<td class="time {parseTime(service.eta).changed}">{parseTime(service.eta).data}</td>
|
||||||
|
<td class="time">{parseTime(service.std).data}</td>
|
||||||
|
<td class="time {parseTime(service.etd).changed}">{parseTime(service.etd).data}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr><td colspan="7">
|
||||||
|
<p class="service-detail">
|
||||||
|
A {service.operator || 'Unknown'} service
|
||||||
|
</p>
|
||||||
|
{#if service.delayReason}
|
||||||
|
<p class="service-detail">{service.delayReason}</p>
|
||||||
|
{/if}
|
||||||
|
{#if service.cancelReason}
|
||||||
|
<p class="service-detail">{service.cancelReason}</p>
|
||||||
|
{/if}
|
||||||
|
</td></tr>
|
||||||
|
{/each}
|
||||||
|
</table>
|
||||||
|
{:else}
|
||||||
|
<p>No Scheduled Ferry Serices</p>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<style>
|
<style>
|
||||||
#timestamp {
|
#timestamp {
|
||||||
|
@ -14,7 +14,7 @@ const inputIslands = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Train Details & PIS",
|
title: "Train Details & PIS",
|
||||||
action: "/result-timetable",
|
action: "/train",
|
||||||
placeholder: "Enter Headcode",
|
placeholder: "Enter Headcode",
|
||||||
queryName: "headcode"
|
queryName: "headcode"
|
||||||
}
|
}
|
||||||
|
@ -6,23 +6,25 @@
|
|||||||
import { uuid } from '$lib/stores/uuid.js';
|
import { uuid } from '$lib/stores/uuid.js';
|
||||||
import {onMount} from 'svelte'
|
import {onMount} from 'svelte'
|
||||||
|
|
||||||
const title = "Public Board"
|
let title = "Loading"
|
||||||
|
|
||||||
async function getHeadcode() {
|
async function getHeadcode() {
|
||||||
return new URLSearchParams(window.location.search).get('station');
|
return new URLSearchParams(window.location.search).get('station');
|
||||||
}
|
}
|
||||||
|
|
||||||
let station;
|
let station = "";
|
||||||
let staff;
|
let staff = false;
|
||||||
let uuidValue;
|
let uuidValue = "";
|
||||||
|
|
||||||
$: uuidValue = $uuid;
|
$: uuidValue = $uuid;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
station = await getHeadcode() || "";
|
station = await getHeadcode() || "";
|
||||||
if (uuidValue !== null) {
|
if (uuidValue !== null && uuidValue !== "" && uuidValue !== "null") {
|
||||||
staff = true;
|
staff = true;
|
||||||
|
title = "Staff Board"
|
||||||
} else {
|
} else {
|
||||||
staff = false;
|
title = "Public Board"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -32,7 +34,7 @@
|
|||||||
|
|
||||||
<!-- If 'uuid' exists in store then load StaffLdb else load PublicLdb -->
|
<!-- If 'uuid' exists in store then load StaffLdb else load PublicLdb -->
|
||||||
{#if !staff}
|
{#if !staff}
|
||||||
<PublicLdb {station} />
|
<PublicLdb {station} bind:title={title} />
|
||||||
{:else}
|
{:else}
|
||||||
<StaffLdb {station} />
|
<StaffLdb {station} />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -6,7 +6,48 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Header {title} />
|
<Header {title} />
|
||||||
|
<div>
|
||||||
|
<p>OwlBoard stores as little data as possible to offer its functions for you to use.
|
||||||
|
OwlBoard does not use any cookies, any data that is required is stored in your browser.
|
||||||
|
</p>
|
||||||
|
<p>Owlboard does not log IP addresses or browser fingerprints.</p>
|
||||||
|
<h2>If you do not sign up</h2>
|
||||||
|
<p>If you do not sign up, no personal data is processed or stored unless you report an issue.
|
||||||
|
</p>
|
||||||
|
<h2>If you do sign up</h2>
|
||||||
|
<p>If you do sign up for the rail staff version of OwlBoard, then we do need to store some data
|
||||||
|
but none of it can be used to personally identify you.
|
||||||
|
</p>
|
||||||
|
<p>When you sign up, you will need to provide a work email address which is checked to confirm that
|
||||||
|
it originates from a railway company. You are then sent an email with a registration link, OwlBoard
|
||||||
|
at this point, the username portion of the email address is discarted - for example 'a-user@owlboard.info'
|
||||||
|
would be stored at '@owlboard.info'. This host part of your email address is stored so that the data that
|
||||||
|
is displayed to you can be filtered, showing relevent results more prominently.
|
||||||
|
</p>
|
||||||
|
<p>The email-server may store the address and message content per it's usual operation and you consent to this
|
||||||
|
when you sign up.
|
||||||
|
</p>
|
||||||
|
<p>Alongside the host poriton of your email address, we store a randomly generated UUID which is used to authorize
|
||||||
|
access to the rail staff data.
|
||||||
|
</p>
|
||||||
|
<h2>Reporting an Issue</h2>
|
||||||
|
<p>When you report an issue, some data is collected - This data is: your browsers User Agent string and the size of the window you
|
||||||
|
are viewing the website in.</p>
|
||||||
|
<p>Any data that is submitted when you report an issue will be publically viewable alongside the
|
||||||
|
<a href="https://git.fjla.uk/owlboard/backend/issues" target="_blank">OwlBoard/backend git repository</a>.</p>
|
||||||
|
</div>
|
||||||
|
<Nav />
|
||||||
|
|
||||||
|
<style>
|
||||||
<Nav />
|
div {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: var(--second-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user