@@ -4,8 +4,7 @@
|
||||
import { ScanStationService, TrackService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import { edit } from "marked/src/helpers";
|
||||
import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
let data_loaded = false;
|
||||
let modal_open;
|
||||
let delete_station;
|
||||
@@ -32,7 +31,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: "Station is being updated",
|
||||
text: $_('station-is-being-updated'),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
ScanStationService.scanStationControllerPut(original_data.id, editable)
|
||||
@@ -40,7 +39,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
Object.assign(original_data, editable);
|
||||
original_data = original_data;
|
||||
Toastify({
|
||||
text: "Updated station",
|
||||
text: $_('updated-station'),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
@@ -53,7 +52,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
ScanStationService.scanStationControllerRemove(original_data.id, false)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: "Station deleted",
|
||||
text: $_('station-deleted'),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
@@ -68,7 +67,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
|
||||
<ConfirmScanStationDeletion bind:modal_open bind:delete_station />
|
||||
{#await promise}
|
||||
Loading station details
|
||||
{$_('loading-station-details')}
|
||||
{:then}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
@@ -86,7 +85,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
d="M2 22a8 8 0 1 1 16 0H2zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm10 4h4v2h-4v-2zm-3-5h7v2h-7v-2zm2-5h5v2h-5V7z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center ml-2">
|
||||
<a class="mr-2" href="./">Scanstation</a><svg
|
||||
<a class="mr-2" href="./">{$_('scanstation')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
@@ -130,8 +129,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
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-station')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
@@ -161,10 +159,10 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="description"
|
||||
class="font-medium text-gray-700">Description</label>
|
||||
class="font-medium text-gray-700">{$_('description')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Description"
|
||||
placeholder="{$_('description')}"
|
||||
type="text"
|
||||
bind:value={editable.description}
|
||||
name="description"
|
||||
@@ -173,7 +171,7 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="enabled"
|
||||
class="ml-1 font-medium text-gray-700">Enabled</label>
|
||||
class="ml-1 font-medium text-gray-700">{$_('enabled')}</label>
|
||||
<br />
|
||||
<p class="text-gray-500">
|
||||
<input
|
||||
@@ -185,8 +183,8 @@ import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
type="checkbox"
|
||||
checked={editable.enabled}
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
This scanstation is
|
||||
{#if editable.enabled}enabled{:else}disabled{/if}
|
||||
{$_('this-scanstation-is')}
|
||||
{#if editable.enabled}{$_('enabled')}{:else}{$_('disabled')}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user