diff --git a/servers/demo/src/api.ts b/servers/demo/src/api.ts index 526a36b..67c1cfe 100644 --- a/servers/demo/src/api.ts +++ b/servers/demo/src/api.ts @@ -21,3 +21,11 @@ export const createExpenseReportClientUrl = async ({ endpointId }: { endpointId: export const createDeExpenseReportClientUrl = async ({ endpointId }: { endpointId: string }) => { return `${window.location.origin}${base}/belegeinreichung-client/${endpointId}`; }; + +export const createFlottformFileSharingClientUrl = async ({ + endpointId +}: { + endpointId: string; +}) => { + return `${window.location.origin}${base}/flottform-file-sharing-client/${endpointId}`; +}; diff --git a/servers/demo/src/lib/components/FileExchangeProgress.svelte b/servers/demo/src/lib/components/FileExchangeProgress.svelte new file mode 100644 index 0000000..19d260c --- /dev/null +++ b/servers/demo/src/lib/components/FileExchangeProgress.svelte @@ -0,0 +1,27 @@ + + +
+

+ {fileExchangeType === 'sending' ? 'sending' : 'receiving'} ({exchangeFilesMetaData.currentFileProgress}%): + {exchangeFilesMetaData.fileName} +

+ +
+
+
+

+ {exchangeFilesMetaData.fileIndex} of {exchangeFilesMetaData.totalFileCount} files +

+
diff --git a/servers/demo/src/lib/components/ReceivedFilesList.svelte b/servers/demo/src/lib/components/ReceivedFilesList.svelte new file mode 100644 index 0000000..183a939 --- /dev/null +++ b/servers/demo/src/lib/components/ReceivedFilesList.svelte @@ -0,0 +1,38 @@ + + +
+ {#each receivedFiles as file, index} +
  • + {file.name} +
    + + Download + + +
    +
  • + {/each} +
    diff --git a/servers/demo/src/routes/+page.svelte b/servers/demo/src/routes/+page.svelte index 0ba96a6..8b553dd 100644 --- a/servers/demo/src/routes/+page.svelte +++ b/servers/demo/src/routes/+page.svelte @@ -64,5 +64,10 @@ title="Customized default UI" description="See how you can tailor Flottform's default UI to better match your design, while still retaining all the powerful features of the original interface. This demo lets you explore how easy it is to adapt the default elements to fit seamlessly with your brand's style." /> + diff --git a/servers/demo/src/routes/flottform-file-sharing-client/[endpointId]/+page.svelte b/servers/demo/src/routes/flottform-file-sharing-client/[endpointId]/+page.svelte new file mode 100644 index 0000000..a15c6b4 --- /dev/null +++ b/servers/demo/src/routes/flottform-file-sharing-client/[endpointId]/+page.svelte @@ -0,0 +1,192 @@ + + +
    +
    +

    Flottform File Sharing - Client

    +
    + {#if connectionStatus === 'init'} +

    Connecting to the host...

    + {:else if connectionStatus === 'connected'} +
    +

    File Sharing

    + +
    +

    Send one or multiple File

    +
    + + +
    + {#if sendingFilesMetaData.sending} + + {/if} +
    + + +
    +

    Received Files

    +
      + {#if receivedFiles.length === 0} +

      ---No Files Received Yet---

      + {:else} + + {/if} +
    + {#if receivingFilesMetaData.receiving} + + {/if} +
    + +
    + {:else if connectionStatus === 'disconnected'} +
    +

    Channel is disconnected!

    +

    + Do want to connect one more time? Scan the QR code or copy the link from the other + device! +

    +
    + {:else if connectionStatus === 'error'} +
    +

    + Connection Channel Failed with the following error: {error} +

    +
    + {/if} +
    +
    +
    diff --git a/servers/demo/src/routes/flottform-file-sharing/+page.svelte b/servers/demo/src/routes/flottform-file-sharing/+page.svelte new file mode 100644 index 0000000..66fb1f3 --- /dev/null +++ b/servers/demo/src/routes/flottform-file-sharing/+page.svelte @@ -0,0 +1,247 @@ + + + + Flottform DEMO + + +
    +
    +

    Flottform File Sharing - Host

    +
    + {#if connectionStatus === 'new'} +
    +

    + Start a new connection to exchange files with someone else! +

    + +
    + {:else if connectionStatus === 'endpoint-created'} +
    +
    + QR Code +
    +

    + Scan the QR code or use the link below to connect your device +

    +
    + {connectionInfo.link} + +
    + +
    + {:else if connectionStatus === 'connected'} +
    +

    File Sharing

    + +
    +

    Send one or multiple File

    +
    + + +
    + {#if sendingFilesMetaData.sending} + + {/if} +
    + + +
    +

    Received Files

    +
      + {#if receivedFiles.length === 0} +

      ---No Files Received Yet---

      + {:else} + + {/if} +
    + {#if receivingFilesMetaData.receiving} + + {/if} +
    + +
    + {:else if connectionStatus === 'disconnected'} +
    +

    Channel is disconnected!

    +

    Do want to connect one more time? Click the button below!

    + +
    + {:else if connectionStatus === 'error'} +
    +

    + Connection Channel Failed with the following error: {error} +

    + +
    + {/if} +
    +
    +