Re-added copy modal

ref #143
This commit is contained in:
Nicolai Ort 2023-02-02 17:11:40 +01:00
parent e10c6480a5
commit fecb07ee37
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
5 changed files with 13 additions and 11 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

@ -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

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

View File

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