Compare commits

..

No commits in common. "7df190220f83954e94a934cffc51b262e6596a33" and "847545760b25598d58fc3594ba6546c9690f02a2" have entirely different histories.

8 changed files with 68 additions and 212 deletions

View File

@ -19,7 +19,7 @@
{link.toUpperCase()}
</a>
{:else if link.length === 4}
<a class="link" href="/train?headcode={link}">
<a class="link" href="/result-timetable?headcode={link}">
{link.toUpperCase()}
</a>
{/if}

View File

@ -19,9 +19,3 @@
{/each}
</Island>
<style>
p {
color: white;
}
</style>

View File

@ -1,6 +1,5 @@
<script>
export let station = "";
export let title = "Loading...";
import { onMount } from 'svelte'
import Loading from '$lib/navigation/loading.svelte';
@ -9,41 +8,25 @@
let jsonData = null;
let services = [];
let busServices = [];
let ferryServices = [];
let dataAge = null;
let isLoading = true;
$: {
if (jsonData === null && requestedStation) {
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?.GetStationBoardResult?.busServices?.service) {
busServices = jsonData.GetStationBoardResult.busServices.service;
}
if (jsonData?.GetStationBoardResult?.ferryServices?.service) {
ferryServices = jsonData.GetStationBoardResult.ferryServices.service;
}
if (jsonData?.GetStationBoardResult?.locationName) {
title = jsonData.GetStationBoardResult.locationName
} else {
title = "Loading Board"
}
if (jsonData === null && requestedStation) {
fetchData();
}
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.generatedAt) {
dataAge = new Date(jsonData.GetStationBoardResult.generatedAt);
}
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.trainServices && jsonData.GetStationBoardResult.trainServices.service) {
services = jsonData.GetStationBoardResult.trainServices.service;
} else {
services = [];
}
}
async function fetchData() {
isLoading = true; // Set loading state
try {
@ -107,119 +90,48 @@
<Loading />
{:else}
<p id="timestamp">Updated: {dataAge.toLocaleTimeString()}</p>
{#if services.length}
<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>
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
<td class="plat">{service.platform || '-'}</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>
<p>Public LDB for {station}</p>
<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 service.cancelReason}
<p class="service-detail">{service.cancelReason}</p>
{/if}
</td></tr>
{/each}
</table>
{:else}
<p>No Scheduled Train Services</p>
{/if}
{#if busServices.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>
<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>
<td class="origdest from">{service.origin?.location?.locationName || ''}</td>
<td class="origdest to">{service.destination?.location?.locationName || ''}</td>
<td class="plat">{service.platform || '-'}</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>
{#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>
<!-- service-detail elements are currently contained within the 'From' column
It should be underneath the row. I will need to look at the vanilla interface
to establish what I did differently there. Or, I can insert a new row
with colspan="7" to add a row spanning all columns.-->
<tr><td colspan="7">
<p class="service-detail">
A {service.operator || 'Unknown'} service
{#if service['length']}
with {service['length'] || 'some'} coaches
{/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}
</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>
{/if}
<style>
#timestamp {

View File

@ -1,6 +1,5 @@
<script>
export let station = "";
export let title = "";
import { onMount } from 'svelte'
import Loading from '$lib/navigation/loading.svelte';
import Nav from '$lib/navigation/nav.svelte';
@ -8,7 +7,7 @@
let requestedStation;
$: requestedStation = station;
let jsonData = {};
let jsonData = null;
let services = [];
let dataAge = null;
let isLoading = true;
@ -18,21 +17,15 @@
fetchData();
}
if (jsonData?.GetStationBoardResult?.generatedAt) {
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.generatedAt) {
dataAge = new Date(jsonData.GetStationBoardResult.generatedAt);
}
if (jsonData?.GetStationBoardResult?.trainServices?.service) {
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.trainServices && jsonData.GetStationBoardResult.trainServices.service) {
services = jsonData.GetStationBoardResult.trainServices.service;
} else {
services = [];
}
if (jsonData?.GetStationBoardResult?.locationName) {
title = jsonData.GetStationBoardResult.locationName
} else {
title = "Loading Board"
}
}
async function fetchData() {
@ -48,7 +41,7 @@
}
}
function parseTime(string = ""){
function parseTime(string){
let output
let change
switch (string) {

View File

@ -14,7 +14,7 @@ const inputIslands = [
},
{
title: "Train Details & PIS",
action: "/train",
action: "/result-timetable",
placeholder: "Enter Headcode",
queryName: "headcode"
}

View File

@ -6,25 +6,23 @@
import { uuid } from '$lib/stores/uuid.js';
import {onMount} from 'svelte'
let title = "Loading"
const title = "Public Board"
async function getHeadcode() {
return new URLSearchParams(window.location.search).get('station');
}
let station = "";
let staff = false;
let uuidValue = "";
let station;
let staff;
let uuidValue;
$: uuidValue = $uuid;
onMount(async () => {
station = await getHeadcode() || "";
if (uuidValue !== null && uuidValue !== "" && uuidValue !== "null") {
if (uuidValue !== null) {
staff = true;
title = "Staff Board"
} else {
title = "Public Board"
staff = false;
}
})
@ -34,7 +32,7 @@
<!-- If 'uuid' exists in store then load StaffLdb else load PublicLdb -->
{#if !staff}
<PublicLdb {station} bind:title={title} />
<PublicLdb {station} />
{:else}
<StaffLdb {station} />
{/if}

View File

@ -6,48 +6,7 @@
</script>
<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>
div {
text-align: left;
}
h2 {
color: var(--second-text-color);
}
p {
color: white;
}
</style>