Compare commits

..

No commits in common. "96c55db63dbfed92b78ff0e7bdab7a8cce4d76e9" and "f3cc07c009ed0a34e61f1aad47a1a31778145439" have entirely different histories.

7 changed files with 26 additions and 17 deletions

View File

@ -4,7 +4,7 @@
import Toastify from "toastify-js"; import Toastify from "toastify-js";
import { tick, createEventDispatcher } from "svelte"; import { tick, createEventDispatcher } from "svelte";
export let copy_modal_open; export let copy_modal_open;
export let new_client; export let new_station;
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let valueCopy = null; let valueCopy = null;
let areaDom; let areaDom;
@ -13,7 +13,7 @@
copy_modal_open = false; copy_modal_open = false;
} }
async function copy() { async function copy() {
valueCopy = new_client.key; valueCopy = new_station.key;
await tick(); await tick();
areaDom.focus(); areaDom.focus();
areaDom.select(); areaDom.select();
@ -80,7 +80,7 @@
</h3> </h3>
<div class="mt-2 mb-6"> <div class="mt-2 mb-6">
<p class="text-sm text-gray-500"> <p class="text-sm text-gray-500">
{$_('the-statsclient-api-token-will-only-get-displayed-once-you-wont-be-able-to-change-or-view-it-again')} {$_('the-scanstations-api-token-will-only-get-displayed-once-you-wont-be-able-to-change-or-view-it-again')}
<br /> <br />
{$_('please-copy-the-token-and-store-it-somewhere-save')} {$_('please-copy-the-token-and-store-it-somewhere-save')}
</p> </p>
@ -94,7 +94,7 @@
name="token" name="token"
class:bg-green-200={copied} class:bg-green-200={copied}
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"> class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2">
{new_client.key} {new_station.key}
</p> </p>
<div <div
class="bg-gray-200 border-gray-300 border-t border-b border-r text-black rounded-r-md sm:text-sm p-2 mt-1 cursor-pointer"> class="bg-gray-200 border-gray-300 border-t border-b border-r text-black rounded-r-md sm:text-sm p-2 mt-1 cursor-pointer">

View File

@ -80,7 +80,7 @@
</div> </div>
<div class="mb-8 text-3xl font-extrabold leading-tight"> <div class="mb-8 text-3xl font-extrabold leading-tight">
#{original_data.id} #{original_data.id}
<span data-id="stations_actions_${original_data.id}"> <span data-id="stations_actions_${editable.id}">
{#if store.state.jwtinfo.userdetails.permissions.includes('STATSCLIENT:DELETE')} {#if store.state.jwtinfo.userdetails.permissions.includes('STATSCLIENT:DELETE')}
{#if delete_triggered} {#if delete_triggered}
<button <button
@ -98,7 +98,7 @@
delete_triggered = true; delete_triggered = true;
}} }}
type="button" type="button"
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-statsclient')}</button> class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-station')}</button>
{/if} {/if}
{/if} {/if}
</span> </span>

View File

@ -2,8 +2,8 @@
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
import store from "../../store"; import store from "../../store";
import AddStatsClientModal from "./AddStatsClientModal.svelte"; import AddStatsClientModal from "./AddStatsClientModal.svelte";
import CopyStatsClientTokenModal from "./CopyStatsClientTokenModal.svelte"; // import CopyStatsClientsTokenModal from "./CopyStatsClientsTokenModal.svelte";
import StatsClientsOverview from "./StatsClientsOverview.svelte"; import StatsClientssOverview from "./StatsClientsOverview.svelte";
export let modal_open = false; export let modal_open = false;
export let copy_modal_open = false; export let copy_modal_open = false;
export let new_client = {}; export let new_client = {};
@ -24,10 +24,10 @@
</button> </button>
{/if} {/if}
</span> </span>
<StatsClientsOverview bind:current_clients bind:modal_open bind:new_client bind:copy_modal_open /> <StatsClientssOverview bind:current_clients bind:modal_open bind:new_client bind:copy_modal_open />
</section> </section>
{#if store.state.jwtinfo.userdetails.permissions.includes('STATSCLIENT:CREATE')} {#if store.state.jwtinfo.userdetails.permissions.includes('STATSCLIENT:CREATE')}
<AddStatsClientModal bind:modal_open bind:current_clients bind:new_client bind:copy_modal_open/> <AddStatsClientModal bind:modal_open bind:current_clients bind:new_client bind:copy_modal_open/>
<CopyStatsClientTokenModal bind:copy_modal_open bind:new_client /> <!-- <CopyStatsClientsTokenModal bind:copy_modal_open bind:new_client /> -->
{/if} {/if}

View File

@ -1,7 +1,7 @@
<script> <script>
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
import AddStatsClientModal from "./AddStatsClientModal.svelte"; import AddStatsClientModal from "./AddStatsClientModal.svelte";
import CopyScanStationTokenModal from "./CopyStatsClientTokenModal.svelte"; import CopyScanStationTokenModal from "./CopyScanStationTokenModal.svelte";
import scanstations_empty from "./statsclients_empty.svg"; import scanstations_empty from "./statsclients_empty.svg";
let modal_open = false; let modal_open = false;
let copy_modal_open = false; let copy_modal_open = false;

View File

@ -57,6 +57,11 @@
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
{$_('prefix')} {$_('prefix')}
</th> </th>
<th
scope="col"
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
{$_('key')}
</th>
<th scope="col" class="relative px-6 py-3"> <th scope="col" class="relative px-6 py-3">
<span class="sr-only">{$_('action')}</span> <span class="sr-only">{$_('action')}</span>
</th> </th>
@ -87,6 +92,14 @@
</div> </div>
</div> </div>
</td> </td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">
{c.key}
</div>
</div>
</td>
{#if active_deletes[c.id] === true} {#if active_deletes[c.id] === true}
<td <td
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">

View File

@ -469,7 +469,5 @@
"statsclient-is-being-added": "Statsclient wird angelegt...", "statsclient-is-being-added": "Statsclient wird angelegt...",
"please-provide-the-required-information-to-create-a-new-statsclient": "Bitte gebe alle für einen Statsclient notwendigen Informationen an", "please-provide-the-required-information-to-create-a-new-statsclient": "Bitte gebe alle für einen Statsclient notwendigen Informationen an",
"you-dont-have-any-scanclients-yet": "Es gibt noch keine Statsclients", "you-dont-have-any-scanclients-yet": "Es gibt noch keine Statsclients",
"add-the-first-statsclient": "Erstelle deinen ersten Statsclient.", "add-the-first-statsclient": "Erstelle deinen ersten Statsclient."
"the-statsclient-api-token-will-only-get-displayed-once-you-wont-be-able-to-change-or-view-it-again": "Der Statsclient Token wird nur einmal angezeigt - du kannst ihn nicht ändern oder ihn dir nochmal anzeigen lassen!",
"delete-statsclient": "Statsclient löschen"
} }

View File

@ -470,7 +470,5 @@
"statsclient-is-being-added": "Statsclient is being added...", "statsclient-is-being-added": "Statsclient is being added...",
"please-provide-the-required-information-to-create-a-new-statsclient": "Please provide the required information to create a new statsclient", "please-provide-the-required-information-to-create-a-new-statsclient": "Please provide the required information to create a new statsclient",
"you-dont-have-any-scanclients-yet": "You don't have any statsclients yet", "you-dont-have-any-scanclients-yet": "You don't have any statsclients yet",
"add-the-first-statsclient": "Add your first statsclient.", "add-the-first-statsclient": "Add your first statsclient."
"the-statsclient-api-token-will-only-get-displayed-once-you-wont-be-able-to-change-or-view-it-again": "The statsclient api token will only get displayed once - you won't be able to change or view it again!",
"delete-statsclient": "Delete statsclient"
} }