diff --git a/src/App.svelte b/src/App.svelte index 4eef8994..f148ca50 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -72,6 +72,7 @@ import Scans from "./components/scans/Scans.svelte"; import ScanDetail from "./components/scans/ScanDetail.svelte"; import Cards from "./components/cards/Cards.svelte"; + import StatsClients from "./components/statsclients/StatsClients.svelte"; store.init(); @@ -206,6 +207,14 @@ + + + + + + + + diff --git a/src/components/statsclients/AddScanStationModal.svelte b/src/components/statsclients/AddStatsClientModal.svelte similarity index 64% rename from src/components/statsclients/AddScanStationModal.svelte rename to src/components/statsclients/AddStatsClientModal.svelte index 64603c54..f4a8c00c 100644 --- a/src/components/statsclients/AddScanStationModal.svelte +++ b/src/components/statsclients/AddStatsClientModal.svelte @@ -2,26 +2,17 @@ import { _ } from "svelte-i18n"; import { clickOutside } from "../base/outsideclick"; import { focusTrap } from "svelte-focus-trap"; - import { ScanStationService, TrackService } from "@odit/lfk-client-js"; + import { StatsClientService } from "@odit/lfk-client-js"; import Toastify from "toastify-js"; - import Select from "svelte-select"; export let modal_open; - export let new_station; - export let current_stations; + export let new_client; + export let current_clients; export let copy_modal_open; - let tracks = []; - TrackService.trackControllerGetAll().then((val) => { - tracks = val.map((t) => { - return { label: t.name || `#${t.id}`, value: t }; - }); - }); function focus(el) { el.focus(); } $: description = ""; - $: track = null; - $: enabled = true; - $: createbtnenabled = track != null; + $: createbtnenabled = description != ""; $: processed_last_submit = true; (() => { document.onkeydown = (e) => { @@ -41,19 +32,13 @@ if (processed_last_submit === true) { processed_last_submit = false; const toast = Toastify({ - text: $_("scanstation-is-being-added"), + text: $_("statsclient-is-being-added"), duration: -1, }).showToast(); - let postdata = { - description, - enabled, - track, - }; - ScanStationService.scanStationControllerPost(postdata) + + StatsClientService.statsClientControllerPost({description}) .then((result) => { description = ""; - track = tracks[0].id; - enabled = true; modal_open = false; // Toastify({ @@ -61,9 +46,9 @@ duration: 500, backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", }).showToast(); - current_stations.push(result); - current_stations = current_stations; - new_station = result; + current_clients.push(result); + current_clients = current_clients; + new_client = result; copy_modal_open = true; }) .catch((err) => { @@ -117,34 +102,14 @@

- {$_('create-a-new-scanstation')} + {$_('create-a-new-statsclient')}

- {$_('please-provide-the-required-information-to-create-a-new-scanstation')} + {$_('please-provide-the-required-information-to-create-a-new-statsclient')}

-
- - { - enabled = !enabled; - }} - name="enabled" - type="checkbox" - checked={enabled} - class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> - {$_('this-scanstation-is')} - {#if enabled}{$_('enabled')}{:else}{$_('disabled')}{/if} -

-
diff --git a/src/components/statsclients/StatsClientsEmptyState.svelte b/src/components/statsclients/StatsClientsEmptyState.svelte index 5a1baec6..869b0eab 100644 --- a/src/components/statsclients/StatsClientsEmptyState.svelte +++ b/src/components/statsclients/StatsClientsEmptyState.svelte @@ -1,6 +1,6 @@