RASCSI/python/web/src/templates/upload.html
Daniel Markstedt 6b6a303986
Tweak dropzone config and introduce dedicated Upload page (#1040)
- Introduce a dedicated Upload page and move the upload form there
- Style the utility hyperlinks on the index page with icons and bold text
- Display the cancel / dismiss downloads link, and tweak the link text to make more sense. Note: Cancelled downloads won't remove the partially uploaded file.
- Hide image preview thumbnails. Not relevant to our usecase, and mess up the layout when it happens.
- Turn on chunk retries and tweaks chunk size to be a full MiB (probably won't make a big difference)
2022-12-19 17:21:01 -08:00

55 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block content %}
<h2>{{ _("Upload File from Local Computer") }}</h2>
<ul>
<li>{{ _("The largest file size accepted in this form is %(max_file_size)s MiB. Use other file transfer means for larger files.", max_file_size=max_file_size) }}</li>
<li>{{ _("You have to manually clean up partially uploaded files, as a result of cancelling the upload or closing this page.") }}</li>
<li>{{ _("Disk Images") }} = {{ env["image_dir"] }}</li>
<li>{{ _("Shared Files") }} = {{ FILE_SERVER_DIR }}</li>
</ul>
<h3>{{ _("Destination") }}</h3>
<form name="dropper" action="/files/upload" method="post" class="dropzone dz-clickable" enctype="multipart/form-data" id="dropper">
<label for="disk_images">{{ _("Disk Images") }}</label>
<input type="radio" name="destination" id="disk_images" value="disk_images" checked="checked">
<label for="shared_files">{{ _("Shared Files") }}</label>
<input type="radio" name="destination" id="shared_files" value="shared_files">
</form>
<script type="application/javascript">
Dropzone.options.dropper = {
paramName: 'file',
url: '/files/upload',
maxFilesize: {{ max_file_size }}, // max allowed file size in MiB
chunking: true,
forceChunking: true,
parallelChunkUploads: false,
chunkSize: 1048576, // 1 MiB
retryChunks: true,
retryChunksLimit: 3,
createImageThumbnails: false,
addRemoveLinks: true,
dictDefaultMessage: "{{ _("Drop files here to upload") }}",
dictFallbackMessage: "{{ _("Your browser does not support drag'n'drop file uploads.") }}",
dictFallbackText: "{{ _("Please use the fallback form below to upload your files like in the olden days.") }}",
dictFileTooBig: "{{ _("File is too big: {{filesize}}MiB. Max filesize: {{maxFilesize}}MiB.") }}",
dictInvalidFileType: "{{ _("You can't upload files of this type.") }}",
dictResponseError: "{{ _("Server responded with code: {{statusCode}}") }}",
dictCancelUpload:" {{ _("Cancel upload") }}",
dictUploadCanceled: "{{ _("Upload canceled.") }}",
dictCancelUploadConfirmation: "{{ _("Are you sure you want to cancel this upload?") }}",
dictRemoveFile: "{{ _("Dismiss") }}",
dictMaxFilesExceeded: "{{ _("You can not upload any more files.") }}",
dictFileSizeUnits: {
tb: "{{ _("TiB") }}",
gb: "{{ _("GiB") }}",
mb: "{{ _("MiB") }}",
kb: "{{ _("KiB") }}",
b: "{{ _("B") }}"
}
}
</script>
{% endblock content %}