23
src/routes/err/404/+page.svelte
Normal file
23
src/routes/err/404/+page.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import Header from "$lib/navigation/header.svelte";
|
||||
import Nav from "$lib/navigation/nav.svelte";
|
||||
|
||||
const title = "404 - Not Found"
|
||||
</script>
|
||||
|
||||
<Header {title} />
|
||||
<h1 class="heading">There's no light at the end of this tunnel</h1>
|
||||
<p>The page you were looking for wasn't found</p>
|
||||
<p>Use the menu bar to try another destination</p>
|
||||
<br>
|
||||
<p class="err_code">Status: 404<br>Message: NOT_FOUND</p>
|
||||
<Nav />
|
||||
|
||||
<style>
|
||||
.heading {
|
||||
color: var(--second-text-color);
|
||||
}
|
||||
.err_code {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
23
src/routes/err/50x/+page.svelte
Normal file
23
src/routes/err/50x/+page.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import Header from "$lib/navigation/header.svelte";
|
||||
import Nav from "$lib/navigation/nav.svelte";
|
||||
|
||||
const title = "50x - Server Error"
|
||||
|
||||
</script>
|
||||
|
||||
<Header {title} />
|
||||
<h1 class="heading">This page has been delayed by more servers than usual needing repairs at the same time</h1>
|
||||
<p>There was an error with the server, please try again later</p>
|
||||
<p>Use the menu bar to try another destination, you can report an issue from the 'Menu'</p>
|
||||
<br>
|
||||
<p class="err_code">Status: 50x<br>Message: INTERNAL_SERVER_ERROR</p>
|
||||
<Nav />
|
||||
|
||||
<style>
|
||||
.heading {
|
||||
color: var(--second-text-color);
|
||||
}
|
||||
.err_code {
|
||||
color: white;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
const title = 'Location Codes';
|
||||
|
||||
let val = {
|
||||
@@ -16,7 +17,7 @@
|
||||
let isLoading = false;
|
||||
|
||||
async function getData(type = '', value = '') {
|
||||
const url = `https://owlboard.info/api/v2/ref/locationCode/${type}/${value}`;
|
||||
const url = `${getApiUrl()}/api/v2/ref/locationCode/${type}/${value}`;
|
||||
const res = await fetch(url);
|
||||
const data = await res.json();
|
||||
isLoading = false;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
import { uuid } from '$lib/stores/uuid.js';
|
||||
import { onMount } from 'svelte';
|
||||
const title = 'Your Data';
|
||||
@@ -18,7 +19,7 @@
|
||||
|
||||
async function fetchData() {
|
||||
if ($uuid != 'null') {
|
||||
const url = `https://owlboard.info/api/v2/user/${$uuid}`;
|
||||
const url = `${getApiUrl()}/api/v2/user/${$uuid}`;
|
||||
const res = await fetch(url);
|
||||
const json = await res.json();
|
||||
if (json.length) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import ResultIsland from '$lib/islands/result-island.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
|
||||
const title = 'Reason Codes';
|
||||
let isLoading = false;
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
async function getData() {
|
||||
if (inputValue) {
|
||||
const url = `https://owlboard.info/api/v2/ref/reasonCode/${inputValue}`;
|
||||
const url = `${getApiUrl()}/api/v2/ref/reasonCode/${inputValue}`;
|
||||
const res = await fetch(url);
|
||||
return await res.json();
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { checkAuth, logout } from '$lib/libauth';
|
||||
import LogoutButton from '$lib/navigation/LogoutButton.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
|
||||
const title = 'Register';
|
||||
|
||||
@@ -18,7 +19,7 @@
|
||||
|
||||
async function request() {
|
||||
isLoading = true;
|
||||
const url = 'https://owlboard.info/api/v2/user/request';
|
||||
const url = `${getApiUrl()}/api/v2/user/request`;
|
||||
const request = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
import { uuid } from '$lib/stores/uuid.js';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
@@ -14,7 +15,7 @@
|
||||
}
|
||||
|
||||
async function submit(id) {
|
||||
const url = 'https://owlboard.info/api/v2/user/register';
|
||||
const url = `${getApiUrl()}/api/v2/user/register`;
|
||||
const request = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Done from '$lib/navigation/done.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
|
||||
const title = 'Report Issue';
|
||||
let isLoading = false;
|
||||
@@ -47,7 +48,7 @@
|
||||
`User Message:\n` +
|
||||
`${reportMsg}`
|
||||
});
|
||||
const url = `https://owlboard.info/misc/issue`;
|
||||
const url = `${getApiUrl()}/misc/issue`;
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
const title = 'Statistics';
|
||||
|
||||
async function getData() {
|
||||
const url = 'https://owlboard.info/misc/server/stats';
|
||||
const url = `${getApiUrl()}/misc/server/stats`;
|
||||
const res = await fetch(url);
|
||||
return await res.json();
|
||||
}
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import LargeLogo from '$lib/images/large-logo.svelte';
|
||||
import { version, versionTag } from '$lib/stores/version';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
const title = 'Versions';
|
||||
|
||||
async function getData() {
|
||||
const url = 'https://owlboard.info/misc/server/versions';
|
||||
const url = `${getApiUrl()}/misc/server/versions`;
|
||||
const res = await fetch(url);
|
||||
return await res.json();
|
||||
}
|
||||
@@ -23,7 +24,7 @@
|
||||
{:then data}
|
||||
<Island>
|
||||
<p>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/owlboard-svelte" target="_blank">Web-app version<br /><span class="data">{version}-{versionTag}</span></a>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/owlboard-svelte" target="_blank">Web-app version<br /><span class="data">{version}{#if versionTag}-{versionTag}{/if}</span></a>
|
||||
</p>
|
||||
<p>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/backend" target="_blank">API Server version<br /><span class="data">{data?.backend || 'Unknown'}</span></a>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import { uuid } from '$lib/stores/uuid';
|
||||
import StylesToc from '$lib/train/styles-toc.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
|
||||
const title = 'PIS Finder';
|
||||
const variables = { title: 'Results' };
|
||||
@@ -18,14 +19,14 @@
|
||||
|
||||
async function findByStartEnd() {
|
||||
isLoading = true;
|
||||
const url = `https://owlboard.info/api/v2/pis/byStartEnd/${entryStartCRS}/${entryEndCRS}`;
|
||||
const url = `${getApiUrl()}/api/v2/pis/byStartEnd/${entryStartCRS}/${entryEndCRS}`;
|
||||
await fetchData(url);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
async function findByPis() {
|
||||
isLoading = true;
|
||||
const url = `https://owlboard.info/api/v2/pis/byCode/${entryPIS}`;
|
||||
const url = `${getApiUrl()}/api/v2/pis/byCode/${entryPIS}`;
|
||||
await fetchData(url);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import { onMount } from 'svelte';
|
||||
import TrainDetail from '$lib/train/train-detail.svelte';
|
||||
import { getApiUrl } from '$lib/scripts/upstream';
|
||||
|
||||
let title = 'Timetable Results';
|
||||
let id = '';
|
||||
@@ -50,7 +51,7 @@
|
||||
uuid: $uuid
|
||||
}
|
||||
};
|
||||
const url = `https://owlboard.info/api/v2/timetable/train/${date}/${searchType}/${id}`;
|
||||
const url = `${getApiUrl()}/api/v2/timetable/train/${date}/${searchType}/${id}`;
|
||||
try {
|
||||
const res = await fetch(url, options);
|
||||
if (res.status == 200) {
|
||||
|
||||
Reference in New Issue
Block a user