2024-07-27 19:13:59 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
|
|
|
|
import FileTransferViewModel, {
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals,
|
2026-04-01 08:29:39 +00:00
|
|
|
FileTransferOption,
|
2024-07-27 19:13:59 +02:00
|
|
|
} from "../../ViewModel/Global/fileTransferViewModel";
|
|
|
|
|
|
2024-07-28 19:37:04 +02:00
|
|
|
import ConnectionViewModel from "../../ViewModel/Global/connectionViewModel";
|
2024-07-27 19:13:59 +02:00
|
|
|
import StorageModel from "../../Model/Global/storageModel";
|
2024-07-28 02:27:09 +02:00
|
|
|
import { StringToTextSpan } from "../Components/textSpan";
|
2024-07-28 03:46:08 +02:00
|
|
|
import { reload } from "../utility";
|
2026-04-09 16:48:22 +00:00
|
|
|
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
|
2024-07-27 19:13:59 +02:00
|
|
|
|
2024-07-28 00:02:17 +02:00
|
|
|
export function DataTransferModalWrapper(
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel: CoreViewModel,
|
2026-04-01 08:29:39 +00:00
|
|
|
connectionViewModel: ConnectionViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
2024-07-27 19:13:59 +02:00
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{DirectionSelectionModal(
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel,
|
2026-04-01 08:29:39 +00:00
|
|
|
connectionViewModel,
|
|
|
|
|
fileTransferViewModel,
|
|
|
|
|
)}
|
2026-04-09 16:48:22 +00:00
|
|
|
{FileSelectionModal(coreViewModel, fileTransferViewModel)}
|
|
|
|
|
{TransferDataDisplayModal(coreViewModel, fileTransferViewModel)}
|
|
|
|
|
{TransferDisplayModal(coreViewModel, fileTransferViewModel)}
|
|
|
|
|
{TransferDataInputModal(coreViewModel, fileTransferViewModel)}
|
|
|
|
|
{DataReceptionModal(coreViewModel, fileTransferViewModel)}
|
2026-04-01 08:29:39 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-28 00:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
2024-07-28 19:37:04 +02:00
|
|
|
function DirectionSelectionModal(
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel: CoreViewModel,
|
2026-04-01 08:29:39 +00:00
|
|
|
connectionViewModel: ConnectionViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
2024-07-28 19:37:04 +02:00
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.DirectionSelection,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const isDisconnected = React.createProxyState(
|
|
|
|
|
[connectionViewModel.isConnected],
|
|
|
|
|
() => connectionViewModel.isConnected.value == false,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<p
|
|
|
|
|
class="error"
|
|
|
|
|
toggle:hidden={connectionViewModel.isConnected}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.notConnectedError
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="flex-column gap content-margin-bottom"
|
|
|
|
|
toggle:hidden={isDisconnected}
|
|
|
|
|
>
|
|
|
|
|
<button
|
|
|
|
|
class="tile"
|
|
|
|
|
on:click={
|
|
|
|
|
fileTransferViewModel.showFileSelectionModal
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">upload</span>
|
|
|
|
|
<div>
|
|
|
|
|
<b>
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.fromThisDeviceButton
|
|
|
|
|
}
|
|
|
|
|
</b>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="icon">arrow_forward</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="tile"
|
|
|
|
|
on:click={
|
|
|
|
|
fileTransferViewModel.showTransferDataInputModal
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">download</span>
|
|
|
|
|
<div>
|
|
|
|
|
<b>
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.toThisDeviceButton
|
|
|
|
|
}
|
|
|
|
|
</b>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="icon">arrow_forward</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
2026-04-14 17:19:35 +00:00
|
|
|
<button on:click={fileTransferViewModel.close}>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.closeButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">close</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-28 00:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
function FileSelectionModal(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
// option
|
|
|
|
|
const OptionConverter: React.StateItemConverter<FileTransferOption> = (
|
|
|
|
|
fileOption: FileTransferOption,
|
|
|
|
|
) => {
|
|
|
|
|
return OptionEntry(fileOption, fileTransferViewModel);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function OptionEntry(
|
|
|
|
|
fileOption: FileTransferOption,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
|
|
|
|
) {
|
|
|
|
|
const isSelected = new React.State(false);
|
|
|
|
|
if (fileTransferViewModel.selectedPaths.value.has(fileOption.path)) {
|
|
|
|
|
isSelected.value = true;
|
|
|
|
|
}
|
|
|
|
|
isSelected.subscribeSilent((isSelected) => {
|
|
|
|
|
if (isSelected == true) {
|
|
|
|
|
fileTransferViewModel.selectedPaths.add(fileOption.path);
|
|
|
|
|
} else {
|
|
|
|
|
fileTransferViewModel.selectedPaths.remove(fileOption.path);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
function toggle() {
|
|
|
|
|
isSelected.value = !isSelected.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<button class="tile" toggle:selected={isSelected} on:click={toggle}>
|
|
|
|
|
<div>
|
|
|
|
|
<b class="ellipsis">{fileOption.label}</b>
|
|
|
|
|
<span class="secondary ellipsis">
|
|
|
|
|
{StorageModel.pathComponentsToString(
|
|
|
|
|
...fileOption.path,
|
|
|
|
|
)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
|
|
|
|
);
|
2024-07-28 00:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
// state
|
|
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.FileSelection,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
2024-07-28 00:02:17 +02:00
|
|
|
return (
|
2026-04-01 08:29:39 +00:00
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
<span class="secondary">
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.selectionDescription
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<hr></hr>
|
|
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
<h3>
|
|
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.generalHeadline
|
|
|
|
|
}
|
|
|
|
|
</h3>
|
2026-04-01 08:29:39 +00:00
|
|
|
<div
|
|
|
|
|
class="flex-column gap content-margin-bottom"
|
|
|
|
|
children:append={[
|
|
|
|
|
fileTransferViewModel.generalFileOptions,
|
|
|
|
|
OptionConverter,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
<h3>
|
|
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.chatsHeadline
|
|
|
|
|
}
|
|
|
|
|
</h3>
|
2026-04-01 08:29:39 +00:00
|
|
|
<div
|
|
|
|
|
class="flex-column gap"
|
|
|
|
|
children:append={[
|
|
|
|
|
fileTransferViewModel.chatFileOptions,
|
|
|
|
|
OptionConverter,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
</main>
|
|
|
|
|
<div class="flex-row width-100">
|
|
|
|
|
<button
|
|
|
|
|
class="flex"
|
|
|
|
|
on:click={
|
|
|
|
|
fileTransferViewModel.showDirectionSelectionModal
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.backButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="primary flex"
|
|
|
|
|
on:click={fileTransferViewModel.showTransferDataModal}
|
|
|
|
|
toggle:disabled={
|
|
|
|
|
fileTransferViewModel.hasNoPathsSelected
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.continueButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">arrow_forward</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-07-28 00:02:17 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-27 19:13:59 +02:00
|
|
|
}
|
2024-07-28 00:25:51 +02:00
|
|
|
|
|
|
|
|
function TransferDataDisplayModal(
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel: CoreViewModel,
|
2026-04-01 08:29:39 +00:00
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
2024-07-28 00:25:51 +02:00
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.TransferDataDisplay,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<span class="secondary">
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.dataEntryDescription
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<hr></hr>
|
|
|
|
|
|
|
|
|
|
<div class="flex-column gap content-margin-bottom">
|
|
|
|
|
<div class="tile">
|
|
|
|
|
<span class="icon">forum</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="secondary">
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.transferChannelHeadline
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
<b
|
|
|
|
|
subscribe:innerText={
|
|
|
|
|
fileTransferViewModel.transferChannel
|
|
|
|
|
}
|
|
|
|
|
></b>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tile">
|
|
|
|
|
<span class="icon">key</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="secondary">
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.transferKeyHeadline
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
<b
|
|
|
|
|
subscribe:innerText={
|
|
|
|
|
fileTransferViewModel.transferKey
|
|
|
|
|
}
|
|
|
|
|
></b>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
<div class="flex-row width-100">
|
|
|
|
|
<button
|
|
|
|
|
class="flex"
|
|
|
|
|
on:click={fileTransferViewModel.showFileSelectionModal}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.backButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
</button>
|
2026-04-06 15:50:13 +00:00
|
|
|
<button disabled class="flex">
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.waitingLabel}
|
2026-04-01 08:29:39 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
2024-07-28 00:25:51 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
2024-07-28 00:25:51 +02:00
|
|
|
}
|
2024-07-28 02:27:09 +02:00
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
function TransferDisplayModal(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.TransferDisplay,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<p
|
|
|
|
|
class="secondary"
|
|
|
|
|
subscribe:innerText={
|
|
|
|
|
fileTransferViewModel.filesSentText
|
|
|
|
|
}
|
|
|
|
|
></p>
|
|
|
|
|
|
|
|
|
|
<p
|
|
|
|
|
class="secondary"
|
|
|
|
|
toggle:hidden={
|
|
|
|
|
fileTransferViewModel.didNotFinishSending
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.allFilesSent
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<hr></hr>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="tile flex-column align-start"
|
|
|
|
|
children:append={[
|
|
|
|
|
fileTransferViewModel.filePathsSent,
|
|
|
|
|
StringToTextSpan,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
</main>
|
|
|
|
|
<div class="flex-row width-100">
|
|
|
|
|
<button
|
|
|
|
|
class="flex"
|
|
|
|
|
on:click={fileTransferViewModel.initiateTransfer}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.sendAgainButton
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">restart_alt</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="flex"
|
2026-04-14 17:19:35 +00:00
|
|
|
on:click={fileTransferViewModel.close}
|
2026-04-01 08:29:39 +00:00
|
|
|
toggle:disabled={
|
|
|
|
|
fileTransferViewModel.didNotFinishSending
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.closeButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">close</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-07-28 19:32:04 +02:00
|
|
|
</div>
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
2024-07-28 02:27:09 +02:00
|
|
|
}
|
2024-07-28 03:46:08 +02:00
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
function TransferDataInputModal(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.TransferDataInput,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<span class="secondary">
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.dataEntryInputDescription
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<hr></hr>
|
|
|
|
|
|
|
|
|
|
<div class="flex-column gap content-margin-bottom">
|
|
|
|
|
<label class="tile">
|
|
|
|
|
<span class="icon">forum</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="secondary">
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.transferChannelHeadline
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
<input
|
2026-04-13 11:23:17 +00:00
|
|
|
on:enter={
|
|
|
|
|
fileTransferViewModel.prepareReceivingData
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
bind:value={
|
|
|
|
|
fileTransferViewModel.receivingTransferChannel
|
|
|
|
|
}
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="tile">
|
|
|
|
|
<span class="icon">key</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="secondary">
|
|
|
|
|
{
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel.translations
|
|
|
|
|
.dataTransferModal
|
2026-04-01 08:29:39 +00:00
|
|
|
.transferKeyHeadline
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
<input
|
2026-04-13 11:23:17 +00:00
|
|
|
on:enter={
|
|
|
|
|
fileTransferViewModel.prepareReceivingData
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
bind:value={
|
|
|
|
|
fileTransferViewModel.receivingTransferKey
|
|
|
|
|
}
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
<div class="flex-row width-100">
|
|
|
|
|
<button
|
|
|
|
|
class="flex"
|
|
|
|
|
on:click={
|
|
|
|
|
fileTransferViewModel.showDirectionSelectionModal
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.backButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="primary flex"
|
|
|
|
|
on:click={fileTransferViewModel.prepareReceivingData}
|
|
|
|
|
toggle:disabled={
|
|
|
|
|
fileTransferViewModel.cannotPrepareToReceive
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.continueButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">arrow_forward</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-07-28 03:46:08 +02:00
|
|
|
</div>
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
2024-07-28 03:46:08 +02:00
|
|
|
}
|
|
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
function DataReceptionModal(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
fileTransferViewModel: FileTransferViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
const isPresented = React.createProxyState(
|
|
|
|
|
[fileTransferViewModel.presentedModal],
|
|
|
|
|
() =>
|
|
|
|
|
fileTransferViewModel.presentedModal.value ==
|
2026-04-08 14:02:12 +00:00
|
|
|
FileTransferModals.ReceptionDisplay,
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div class="modal" toggle:open={isPresented}>
|
|
|
|
|
<div>
|
|
|
|
|
<main>
|
|
|
|
|
<h2>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.dataTransferModal
|
|
|
|
|
.transferDataHeadline
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</h2>
|
|
|
|
|
|
|
|
|
|
<p
|
|
|
|
|
class="secondary"
|
|
|
|
|
subscribe:innerText={
|
|
|
|
|
fileTransferViewModel.filesReceivedText
|
|
|
|
|
}
|
|
|
|
|
></p>
|
|
|
|
|
|
|
|
|
|
<hr></hr>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="tile flex-column align-start"
|
|
|
|
|
children:append={[
|
|
|
|
|
fileTransferViewModel.filePathsReceived,
|
|
|
|
|
StringToTextSpan,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
</main>
|
|
|
|
|
<button on:click={reload}>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.reloadAppButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">refresh</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-28 03:46:08 +02:00
|
|
|
}
|