From d9e621165d8108682a18bcaecb81a7b96bc02997 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 18 Feb 2024 14:38:34 +0100 Subject: [PATCH] Added automatic download mechanism - Added tooltips to options - Updated privacy policy --- .../src/app/download/download.component.ts | 22 +++++++++++++++-- frontend/src/app/home/home.component.html | 24 +++++++++---------- frontend/src/app/upload/upload.component.html | 11 +++++---- frontend/src/app/upload/upload.component.ts | 13 ++++++---- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/frontend/src/app/download/download.component.ts b/frontend/src/app/download/download.component.ts index 8d889a5..5d66e8f 100644 --- a/frontend/src/app/download/download.component.ts +++ b/frontend/src/app/download/download.component.ts @@ -4,7 +4,7 @@ import {DevelopmentStore} from "../../store/DevelopmentStore"; import {FormsModule} from "@angular/forms"; import {DecimalPipe, NgClass, NgIf} from "@angular/common"; import funfacts from "../../assets/funfacts"; -import {RouterLink} from "@angular/router"; +import {ActivatedRoute, RouterLink} from "@angular/router"; @Component({ selector: 'app-download', @@ -40,8 +40,21 @@ export class DownloadComponent { funfact: string = ""; - constructor(private developmentStore: DevelopmentStore) { + constructor(private developmentStore: DevelopmentStore, private activatedRoute: ActivatedRoute) { this.funfact = funfacts[Math.floor(Math.random() * funfacts.length)]; + + this.activatedRoute.queryParams.subscribe(params => { + const fileId = params['fileId']; + const password = params['password']; + if(password) { + this.filePassword = password; + } + if(fileId) { + this.inputFileId = fileId; + this.requestDownload(); + } + }); + this.speedTest(); } @@ -70,6 +83,11 @@ export class DownloadComponent { return; } else if(this.downloadInfo?.passwordProtected) { + if(this.filePassword) { + console.log("Requesting download with password"); + this.downloadFile(); + return; + } this.waitingForPassword = true; console.log("Password protected"); } diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index 2bdf784..4c30bf4 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -38,13 +38,13 @@
  1. Uploaded files are stored on a secure server.
  2. Files are stored for a maximum of 24 hours.
  3. -
  4. Sharepulse tracks your IP address when uploading files.
  5. -
  6. Sharepulse may track your IP address when downloading files.
  7. -
  8. Sharepulse does not track you when accessing the website.
  9. -
  10. Personal information collected by Sharepulse is used solely for data protection and is not processed.
  11. -
  12. Sharepulse will not sell, rent, or share personal information with third parties without user consent, except as required by law.
  13. -
  14. Users have the right to request the deletion of their data from Sharepulse's servers at any time.
  15. -
  16. Sharepulse does not store any cookies on your device.
  17. +
  18. SharePulse tracks your IP address when uploading files. This serves as a method of identification, allowing you to check the status of your upload.
  19. +
  20. SharePulse may track your IP address when downloading files.
  21. +
  22. SharePulse does not track you when accessing the website.
  23. +
  24. Personal information collected by SharePulse is used solely for data protection and is not processed.
  25. +
  26. SharePulse will not sell, rent, or share personal information with third parties without user consent, except as required by law.
  27. +
  28. Users have the right to request the deletion of their data from SharePulse's servers at any time.
  29. +
  30. SharePulse does not store any cookies on your device.
  31. Operators do not view or manipulate uploaded files.
  32. Users are encouraged to review the privacy policy periodically for any changes or updates.
@@ -69,12 +69,12 @@
  1. Users must not upload files that contain malware, illegal content, or violate copyright laws.
  2. -
  3. Sharepulse is not responsible for the content of the files shared through its service.
  4. -
  5. By using Sharepulse, users agree not to attempt to breach the security of the service.
  6. -
  7. Sharepulse reserves the right to remove any files or suspend users that violate these terms without notice.
  8. +
  9. SharePulse is not responsible for the content of the files shared through its service.
  10. +
  11. By using SharePulse, users agree not to attempt to breach the security of the service.
  12. +
  13. SharePulse reserves the right to remove any files or suspend users that violate these terms without notice.
  14. The service is provided "as is" without warranty of any kind, express or implied.
  15. -
  16. Users agree to indemnify and hold harmless Sharepulse from any claims resulting from the use of the service.
  17. -
  18. Sharepulse reserves the right to modify these terms at any time. Continued use of the service after such changes constitutes acceptance of the new terms.
  19. +
  20. Users agree to indemnify and hold harmless SharePulse from any claims resulting from the use of the service.
  21. +
  22. SharePulse reserves the right to modify these terms at any time. Continued use of the service after such changes constitutes acceptance of the new terms.
diff --git a/frontend/src/app/upload/upload.component.html b/frontend/src/app/upload/upload.component.html index a862c5b..482a7d7 100644 --- a/frontend/src/app/upload/upload.component.html +++ b/frontend/src/app/upload/upload.component.html @@ -28,17 +28,18 @@
-
- - +
+ +
- +
- +
diff --git a/frontend/src/app/upload/upload.component.ts b/frontend/src/app/upload/upload.component.ts index 8251840..783101a 100644 --- a/frontend/src/app/upload/upload.component.ts +++ b/frontend/src/app/upload/upload.component.ts @@ -115,14 +115,19 @@ export class UploadComponent { buildFileUrls(fileDetails: FileDetails) { const baseUrl = this.developmentStore.getBaseUrl(); const fileId = fileDetails.fileId; - const downloadUrl = `${baseUrl}download?fileId=${fileId}`; - const deleteUrl = `${baseUrl}api/v1/deletefile?fileId=${fileId}`; - const statusUrl = `${baseUrl}status?fileId=${fileId}`; + let passwordUrlPart = ''; + if(fileDetails.passwordProtected) { + passwordUrlPart = `&password=${fileDetails.password}`; + } + const downloadUrl = `${baseUrl}download?fileId=${fileId}${passwordUrlPart}`; + const deleteUrl = `${baseUrl}api/v1/deletefile?fileId=${fileId}${passwordUrlPart}`; + const statusUrl = `${baseUrl}status?fileId=${fileId}${passwordUrlPart}`; return { downloadUrl, statusUrl, deleteUrl, - }; } + }; + } buildFormDataObject(): FormData { const formData = new FormData();