Added automatic download mechanism
- Added tooltips to options - Updated privacy policy
This commit is contained in:
@ -28,17 +28,18 @@
|
||||
<div class="w-full mb-10">
|
||||
<label class="block text-gray-700 text-l font-bold mb-4">Options</label>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="flex items-center">
|
||||
<input id="shortStorage" [(ngModel)]="shortStorage" type="checkbox" class="toggle" checked />
|
||||
<label for="shortStorage" class="ml-2 text-gray-700">Store for only one hour</label>
|
||||
<div class="flex items-center" >
|
||||
<input id="shortStorage" [(ngModel)]="shortStorage" type="checkbox" class="toggle" [disabled]="true"/>
|
||||
<label for="shortStorage" class="ml-2 text-gray-700 tooltip" data-tip="This feature will be available with the next update!">Store for only one hour</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="singleDownload" [(ngModel)]="singleDownload" type="checkbox" class="toggle" />
|
||||
<label for="singleDownload" class="ml-2 text-gray-700">Allow only one download</label>
|
||||
<label for="singleDownload" class="ml-2 text-gray-700 tooltip" data-tip="If enabled, the uploaded file can only be downloaded once.">Allow only one download</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="passwordProtected" [(ngModel)]="passwordProtected" type="checkbox" class="toggle" />
|
||||
<label for="passwordProtected" class="ml-2 text-gray-700">Protect download with password</label>
|
||||
<label for="passwordProtected" class="ml-2 text-gray-700 tooltip"
|
||||
data-tip="The password will be generated by the server and is displayed after the upload is finished.">Protect download with password</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user