Compare commits

..

No commits in common. "1.10.0" and "1.9.11" have entirely different histories.

7 changed files with 17 additions and 99 deletions

View File

@ -2,16 +2,9 @@
All notable changes to this project will be documented in this file. Dates are displayed in UTC. All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [1.10.0](https://git.odit.services/lfk/frontend/compare/1.9.11...1.10.0)
- feat: working CardAssignment [`ac4ef8f`](https://git.odit.services/lfk/frontend/commit/ac4ef8fb6ded5c5d5678a651420e356b3ef45399)
#### [1.9.11](https://git.odit.services/lfk/frontend/compare/1.9.10...1.9.11) #### [1.9.11](https://git.odit.services/lfk/frontend/compare/1.9.10...1.9.11)
> 8 April 2025
- feat(dash): add runnersViaKiosk [`5291f8a`](https://git.odit.services/lfk/frontend/commit/5291f8a4d1721cd0c745191ebc85f221c34a23c8) - feat(dash): add runnersViaKiosk [`5291f8a`](https://git.odit.services/lfk/frontend/commit/5291f8a4d1721cd0c745191ebc85f221c34a23c8)
- chore(release): 1.9.11 [`eae0afd`](https://git.odit.services/lfk/frontend/commit/eae0afda23a54020e25821c0188d8cbec3139593)
#### [1.9.10](https://git.odit.services/lfk/frontend/compare/1.9.9...1.9.10) #### [1.9.10](https://git.odit.services/lfk/frontend/compare/1.9.9...1.9.10)

View File

@ -13,7 +13,7 @@
<body> <body>
<span style="display: none; visibility: hidden" id="buildinfo" <span style="display: none; visibility: hidden" id="buildinfo"
>RELEASE_INFO-1.10.0-RELEASE_INFO</span >RELEASE_INFO-1.9.11-RELEASE_INFO</span
> >
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/env.js"></script> <script src="/env.js"></script>

View File

@ -1,6 +1,6 @@
{ {
"name": "@odit/lfk-frontend", "name": "@odit/lfk-frontend",
"version": "1.10.0", "version": "1.9.11",
"type": "module", "type": "module",
"scripts": { "scripts": {
"i18n-order": "node order.js", "i18n-order": "node order.js",

Binary file not shown.

View File

@ -41,27 +41,7 @@
</svg> </svg>
<span>{$_("dashboard-title")}</span> <span>{$_("dashboard-title")}</span>
</a> </a>
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET") && store.state.jwtinfo.userdetails.permissions.includes("CARD:GET")} {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
<a
class:activenav={$router.path.includes("/cardassignment/")}
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"
href="/cardassignment/"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="flex-shrink-0 w-5 h-5 mr-2 transition group-hover:text-gray-600"
>
<path
fill-rule="evenodd"
d="M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z"
clip-rule="evenodd"
/>
</svg>
<span>Card Assignment</span>
</a>
<a <a
class:activenav={$router.path.includes("/runners/")} class:activenav={$router.path.includes("/runners/")}
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold" class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"

View File

@ -1,30 +1,26 @@
<script> <script>
import { RunnerCardService, RunnerService } from "@odit/lfk-client-js";
import QrCodeScanner from "./QrCodeScanner.svelte"; import QrCodeScanner from "./QrCodeScanner.svelte";
let state = "scan_runner"; let state = "scan_runner";
let runnerinfo = { id: 0, firstname: "", lastname: "" }; let runnerID = undefined;
let cardCode = ""; let cardInfo = "";
$: scannerActive = state.includes("scan");
</script> </script>
<div class="p-4"> <div class="p-4">
<h3 class="text-3xl font-bold">Card Assignment for Mobile</h3> <h3 class="text-3xl font-bold">Card Assignment for Mobile</h3>
<!-- <p>state</p> {#if state === "done"}
<p>{state}</p> <p>Assigned Card {cardInfo}</p>
<p>scannerActive</p> <p>(not really, needs to be implemented)</p>
<p>{scannerActive}</p> --> {:else}
{#if state.includes("scan_")}
<!-- --> <!-- -->
{#if state === "scan_runner"} {#if state === "scan_runner"}
<h3 class="text-xl font-bold">Scan Runner (Selfservice QR)</h3> <h3 class="text-xl font-bold">Scan Runner (Selfservice QR)</h3>
{/if} {/if}
{#if state === "scan_card"} {#if state === "scan_card"}
<h3 class="text-xl font-bold">Runner Scanned</h3> <h3 class="text-xl font-bold">Runner Scanned</h3>
<p>{runnerinfo.firstname} {runnerinfo.lastname} [#{runnerinfo.id}]</p> <p>{runnerID}</p>
<h3 class="text-xl font-bold">Scan Card (Code 128 Barcode)</h3> <h3 class="text-xl font-bold">Scan Card (Code 128 Barcode)</h3>
{/if} {/if}
<QrCodeScanner <QrCodeScanner
paused={!scannerActive}
on:detect={(e) => { on:detect={(e) => {
console.log({ type: "DETECT", code: e.detail.decodedText }); console.log({ type: "DETECT", code: e.detail.decodedText });
if (state === "scan_runner") { if (state === "scan_runner") {
@ -33,18 +29,13 @@
"https://portal.lauf-fuer-kaya.de/profile/" "https://portal.lauf-fuer-kaya.de/profile/"
) )
) { ) {
const runnerID = JSON.parse( runnerID = JSON.parse(
atob( atob(
e.detail.decodedText e.detail.decodedText
.replace("https://portal.lauf-fuer-kaya.de/profile/", "") .replace("https://portal.lauf-fuer-kaya.de/profile/", "")
.split(".")[1] .split(".")[1]
) )
).id; ).id;
new Audio("/beep.mp3").play();
RunnerService.runnerControllerGetOne(runnerID).then((runner) => {
console.log(runner);
runnerinfo = runner;
});
state = "scan_card"; state = "scan_card";
} }
} }
@ -54,25 +45,8 @@
"https://portal.lauf-fuer-kaya.de/profile/" "https://portal.lauf-fuer-kaya.de/profile/"
) )
) { ) {
cardCode = e.detail.decodedText; cardInfo = e.detail.decodedText;
new Audio("/beep.mp3").play();
state = "assigning";
RunnerCardService.runnerCardControllerGetAll().then((cards) => {
console.log(cards);
const card = cards.find((c) => c.code === cardCode);
if (card) {
console.log("card found", card);
RunnerCardService.runnerCardControllerPut(card.id, {
enabled: true,
id: card.id,
runner: runnerinfo.id,
}).then(() => {
state = "done"; state = "done";
});
} else {
state = "error_card_404";
}
});
} }
} }
}} }}
@ -84,8 +58,8 @@
<button <button
on:click={() => { on:click={() => {
state = "scan_runner"; state = "scan_runner";
runnerinfo = { id: 0, firstname: "", lastname: "" }; runnerID = undefined;
cardCode = ""; cardInfo = "";
}} }}
type="button" type="button"
class="py-3 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-red-100 text-red-800 hover:bg-red-200 focus:outline-hidden focus:bg-red-200 disabled:opacity-50 disabled:pointer-events-none dark:text-red-500 dark:bg-red-800/30 dark:hover:bg-red-800/20 dark:focus:bg-red-800/20 w-full mt-2" class="py-3 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-red-100 text-red-800 hover:bg-red-200 focus:outline-hidden focus:bg-red-200 disabled:opacity-50 disabled:pointer-events-none dark:text-red-500 dark:bg-red-800/30 dark:hover:bg-red-800/20 dark:focus:bg-red-800/20 w-full mt-2"
@ -94,30 +68,5 @@
</button> </button>
{/if} {/if}
<!-- --> <!-- -->
{:else}
<!-- -->
{#if state === "assigning"}
<p>Assigning Card {cardCode}</p>
<p>Please wait a moment while we assign the card...</p>
{/if}
{#if state === "done"}
<p>
Assigned Card {cardCode} to {runnerinfo.firstname}
{runnerinfo.lastname} [#{runnerinfo.id}] ✅
</p>
<button
on:click={() => {
// state = "scan_runner";
// runnerinfo = { id: 0, firstname: "", lastname: "" };
// cardCode = "";
location.reload();
}}
type="button"
class="py-3 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200 focus:outline-hidden focus:bg-blue-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-500 dark:bg-blue-800/30 dark:hover:bg-blue-800/20 dark:focus:bg-blue-800/20 w-full mt-2"
>
Done
</button>
{/if}
<!-- -->
{/if} {/if}
</div> </div>

View File

@ -14,17 +14,13 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
function onScanSuccess(decodedText, decodedResult) { function onScanSuccess(decodedText, decodedResult) {
if (!paused) {
dispatch("detect", { decodedText }); dispatch("detect", { decodedText });
} }
}
// usually better to ignore and keep scanning // usually better to ignore and keep scanning
function onScanFailure(message) { function onScanFailure(message) {
if (!paused) {
dispatch("error", { message }); dispatch("error", { message });
} }
}
let scanner; let scanner;
onMount(() => { onMount(() => {