Compare commits

...

3 Commits

Author SHA1 Message Date
96c55db63d
Added translation
ref #143
2023-02-02 17:13:16 +01:00
fecb07ee37
Re-added copy modal
ref #143
2023-02-02 17:11:46 +01:00
e10c6480a5
Removed Key after creation
ref #143
2023-02-02 17:08:29 +01:00
7 changed files with 17 additions and 26 deletions

View File

@ -4,7 +4,7 @@
import Toastify from "toastify-js";
import { tick, createEventDispatcher } from "svelte";
export let copy_modal_open;
export let new_station;
export let new_client;
const dispatch = createEventDispatcher();
let valueCopy = null;
let areaDom;
@ -13,7 +13,7 @@
copy_modal_open = false;
}
async function copy() {
valueCopy = new_station.key;
valueCopy = new_client.key;
await tick();
areaDom.focus();
areaDom.select();
@ -80,7 +80,7 @@
</h3>
<div class="mt-2 mb-6">
<p class="text-sm text-gray-500">
{$_('the-scanstations-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-wont-be-able-to-change-or-view-it-again')}
<br />
{$_('please-copy-the-token-and-store-it-somewhere-save')}
</p>
@ -94,7 +94,7 @@
name="token"
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">
{new_station.key}
{new_client.key}
</p>
<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">

View File

@ -80,7 +80,7 @@
</div>
<div class="mb-8 text-3xl font-extrabold leading-tight">
#{original_data.id}
<span data-id="stations_actions_${editable.id}">
<span data-id="stations_actions_${original_data.id}">
{#if store.state.jwtinfo.userdetails.permissions.includes('STATSCLIENT:DELETE')}
{#if delete_triggered}
<button
@ -98,7 +98,7 @@
delete_triggered = true;
}}
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-station')}</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>
{/if}
{/if}
</span>

View File

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

View File

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

View File

@ -57,11 +57,6 @@
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
{$_('prefix')}
</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">
<span class="sr-only">{$_('action')}</span>
</th>
@ -92,14 +87,6 @@
</div>
</div>
</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}
<td
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">

View File

@ -469,5 +469,7 @@
"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",
"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,5 +470,7 @@
"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",
"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"
}