feat: runner list filtered by created_via

This commit is contained in:
2025-04-09 11:56:59 +02:00
parent aa720f2460
commit 991716a7f5
8 changed files with 29 additions and 15 deletions

View File

@@ -6,7 +6,7 @@
{#if !runner}
{$_("non-blanko")}
{:else}
<a href={`/runners/${runner.id}`}>
<a href={`/runners/detail/${runner.id}`}>
{#if runner.middlename}
{runner.firstname} {runner.middlename} {runner.lastname}
{:else}

View File

@@ -220,7 +220,7 @@
<StatCard
title={$_("runner_via_selfservice")}
value={stats.runnersViaSelfservice}
href="/runners/"
href="/runners/selfservice/"
>
<svg
height="24"
@@ -237,7 +237,7 @@
<StatCard
title={$_('runners_via_kiosk')}
value={stats.runnersViaKiosk}
href="/runners/"
href="/runners/kiosk/"
>
<svg
height="24"

View File

@@ -8,7 +8,7 @@
{:else}
<div class="text-sm font-medium text-gray-900">
<a
href="../runners/{runner.id}"
href="../runners/detail/{runner.id}"
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
>{runner.firstname}
{#if runner.middlename}{runner.middlename}{/if}

View File

@@ -100,7 +100,7 @@
<nav class="w-full flex">
<ol class="list-none flex flex-row items-center justify-start">
<li class="flex items-center">
<a class="mr-2" href="./"
<a class="mr-2" href="/runners/"
><svg
xmlns="http://www.w3.org/2000/svg"
width="24"

View File

@@ -32,6 +32,7 @@
$: active_delete = undefined;
let dataLoaded = false;
export let created_via = "all";
export let current_runners = [];
$: sponsoring_contracts_show = selected.length > 0;
$: cards_show = selected.length > 0;
@@ -103,7 +104,7 @@
header: () => $_("action"),
cell: (info) => {
return renderComponent(TableActions, {
detailsLink: `./${info.row.original.id}`,
detailsLink: `/runners/detail/${info.row.original.id}`,
deleteAction: () => {
active_delete =
current_runners[
@@ -161,7 +162,11 @@
let page = 0;
while (page >= 0) {
const runners = await RunnerService.runnerControllerGetAll(page, 500);
const runners = await RunnerService.runnerControllerGetAll(
page,
500,
created_via
);
if (runners.length == 0) {
page = -2;
}
@@ -190,6 +195,9 @@
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
{$_("runners")}
</h4>
{#if created_via !== "all"}
<p>created_via={created_via}</p>
{/if}
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")}
<button
on:click={() => {