🧹 cleanup
This commit is contained in:
parent
b3f7002556
commit
f7274378b8
|
@ -9,6 +9,7 @@
|
|||
</head>
|
||||
|
||||
<body class="bg-white font-family-karla h-screen">
|
||||
<script src="./env.js"></script>
|
||||
<script type="module" src="./src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
const config = {
|
||||
endpoint: 'https://dev.lauf-fuer-kaya.de/'
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
const config = {
|
||||
endpoint: 'https://dev.lauf-fuer-kaya.de/'
|
||||
};
|
|
@ -1,4 +1,5 @@
|
|||
<script>
|
||||
console.log("app started with base url " + config.endpoint);
|
||||
import { addMessages, init } from "svelte-i18n";
|
||||
import en from "./locales/en.json";
|
||||
import de from "./locales/de.json";
|
||||
|
@ -13,8 +14,6 @@
|
|||
import { apikey, lang, page } from "./store.js";
|
||||
$: is_configured = $apikey && $apikey !== "null" && $apikey !== "";
|
||||
$: settings_open = $page === "settings";
|
||||
console.log($page);
|
||||
//
|
||||
init({
|
||||
fallbackLocale: "en-US",
|
||||
initialLocale: $lang,
|
||||
|
|
|
@ -79,18 +79,16 @@
|
|||
axios
|
||||
.request({
|
||||
method: "GET",
|
||||
url: "https://dev.lauf-fuer-kaya.de/api/stations/me",
|
||||
url: config.endpoint + "api/stations/me",
|
||||
headers: { Authorization: "Bearer " + token },
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
error = false;
|
||||
errormessage = "";
|
||||
apikey.set(token);
|
||||
stationinfo.set(JSON.stringify(response.data));
|
||||
})
|
||||
.catch(function (e) {
|
||||
console.log(e.response.data.short);
|
||||
error = true;
|
||||
errormessage = e.response.data.short;
|
||||
});
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
axios
|
||||
.request({
|
||||
method: "POST",
|
||||
url: "https://dev.lauf-fuer-kaya.de/api/scans/trackscans",
|
||||
url: config.endpoint + "api/scans/trackscans",
|
||||
headers: { Authorization: "Bearer " + $apikey },
|
||||
data: { card },
|
||||
})
|
||||
|
@ -100,7 +100,7 @@
|
|||
>
|
||||
<label class="block">
|
||||
<span class="block mb-1 text-xs font-medium text-gray-700"
|
||||
>{$_('runner_card')}</span
|
||||
>{$_("runner_card")}</span
|
||||
>
|
||||
<input
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mt-1 leading-tight focus:outline-none focus:shadow-outline"
|
||||
|
@ -121,9 +121,11 @@
|
|||
<h1 class="text-3xl font-bold text-center">lap time</h1>
|
||||
<h1 class="text-8xl font-bold text-center">{lastscan_laptime}</h1>
|
||||
{:else}
|
||||
<h1 class="text-3xl font-bold text-center">{$_('please_scan_a_card')}</h1>
|
||||
<h1 class="text-3xl font-bold text-center">
|
||||
{$_("please_scan_a_card")}
|
||||
</h1>
|
||||
{/if}
|
||||
<button type="submit" class="hidden">{$_('scan')}</button>
|
||||
<button type="submit" class="hidden">{$_("scan")}</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { _ } from "svelte-i18n";
|
||||
|
||||
import { apikey, lang, page, stationinfo } from "./store.js";
|
||||
</script>
|
||||
|
@ -8,30 +8,36 @@ import { _ } from "svelte-i18n";
|
|||
<h1 class="font-bold text-3xl w-full text-center text-gray-900">
|
||||
Lauf Für Kaya! Scan 📷
|
||||
</h1>
|
||||
<h1 class="text-3xl w-full text-center text-gray-900">{$_('settings')}</h1>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('api_key')}</p>
|
||||
<h1 class="text-3xl w-full text-center text-gray-900">{$_("settings")}</h1>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_("api_key")}</p>
|
||||
<p class="block text-sm text-gray-700">{$apikey}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('station_description')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">
|
||||
{$_("station_description")}
|
||||
</p>
|
||||
<p class="block text-sm text-gray-700">
|
||||
{JSON.parse($stationinfo).description}
|
||||
</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('station_id')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_("station_id")}</p>
|
||||
<p class="block text-sm text-gray-700">{JSON.parse($stationinfo).id}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_id')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_("track_id")}</p>
|
||||
<p class="block text-sm text-gray-700">{JSON.parse($stationinfo).track.id}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_name')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_("track_name")}</p>
|
||||
<p class="block text-sm text-gray-700">
|
||||
{JSON.parse($stationinfo).track.name}
|
||||
</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_distance')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">
|
||||
{$_("track_distance")}
|
||||
</p>
|
||||
<p class="block text-sm text-gray-700">
|
||||
{JSON.parse($stationinfo).track.distance}
|
||||
</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('minimum_lap_time')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">
|
||||
{$_("minimum_lap_time")}
|
||||
</p>
|
||||
<p class="block text-sm text-gray-700">
|
||||
{JSON.parse($stationinfo).track.minimumLapTime}s
|
||||
</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('language')}</p>
|
||||
<p class="block text-sm font-bold text-gray-700 mt-2">{$_("language")}</p>
|
||||
<div class="w-full">
|
||||
<div class="inline-block mr-2 mt-2">
|
||||
<button
|
||||
|
@ -92,7 +98,7 @@ import { _ } from "svelte-i18n";
|
|||
page.set("");
|
||||
}}
|
||||
class="mb-3 w-full py-3 border-black border-3 text-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black"
|
||||
>{$_('back_to_scanner')}</button
|
||||
>{$_("back_to_scanner")}</button
|
||||
>
|
||||
<button
|
||||
on:click={() => {
|
||||
|
@ -100,6 +106,6 @@ import { _ } from "svelte-i18n";
|
|||
page.set("");
|
||||
}}
|
||||
class="w-full py-3 bg-black text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black"
|
||||
>{$_('log_out_from_this_client')}</button
|
||||
>{$_("log_out_from_this_client")}</button
|
||||
>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue