2022-12-20 01:21:01 +00:00
{% 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 > {{ _("Disk Images") }} = {{ env["image_dir"] }}< / li >
2023-03-24 03:07:19 +00:00
{% if file_server_dir_exists %}
2022-12-20 01:21:01 +00:00
< li > {{ _("Shared Files") }} = {{ FILE_SERVER_DIR }}< / li >
2023-03-24 03:07:19 +00:00
{% endif %}
2023-01-28 22:34:34 +00:00
< li > {{ _("PiSCSI Config") }} = {{ CFG_DIR }}< / li >
2022-12-20 01:21:01 +00:00
< / ul >
< form name = "dropper" action = "/files/upload" method = "post" class = "dropzone dz-clickable" enctype = "multipart/form-data" id = "dropper" >
2023-11-01 13:28:53 +00:00
< fieldset >
< legend > {{ _("Destination") }}< / legend >
2023-11-04 09:21:54 +00:00
< label for = "disk_images" class = "hidden" > {{ _("Disk Images") }}< / label >
2022-12-20 01:21:01 +00:00
< input type = "radio" name = "destination" id = "disk_images" value = "disk_images" checked = "checked" >
2023-11-01 13:28:53 +00:00
< label for = "images_subdir" class = "hidden" > {{ _("Directory") }}< / label >
2023-03-05 00:57:32 +00:00
< select name = "images_subdir" id = "images_subdir" >
{% for dir in images_subdirs %}
2023-11-04 09:21:54 +00:00
< option value = "{{dir}}" > {{ env['image_root_dir'] }}/{{dir}}< / option >
2023-02-25 01:28:58 +00:00
{% endfor %}
2023-11-04 09:21:54 +00:00
< option value = "" selected > {{ env['image_root_dir'] }}/< / option >
2023-02-25 01:28:58 +00:00
< / select >
2023-03-24 03:07:19 +00:00
{% if file_server_dir_exists %}
2023-11-04 09:21:54 +00:00
< label for = "shared_files" class = "hidden" > {{ _("Shared Files") }}< / label >
2022-12-20 01:21:01 +00:00
< input type = "radio" name = "destination" id = "shared_files" value = "shared_files" >
2023-11-01 13:28:53 +00:00
< label for = "shared_subdir" class = "hidden" > {{ _("Directory") }}< / label >
2023-03-05 00:57:32 +00:00
< select name = "shared_subdir" id = "shared_subdir" >
{% for dir in shared_subdirs %}
2023-11-04 09:21:54 +00:00
< option value = "{{dir}}" > {{ env['shared_root_dir'] }}/{{dir}}< / option >
2023-03-05 00:57:32 +00:00
{% endfor %}
2023-11-04 09:21:54 +00:00
< option value = "" selected > {{ env['shared_root_dir'] }}/< / option >
2023-03-05 00:57:32 +00:00
< / select >
2023-03-24 03:07:19 +00:00
{% endif %}
2023-01-28 22:34:34 +00:00
< input type = "radio" name = "destination" id = "piscsi_config" value = "piscsi_config" >
< label for = "piscsi_config" > {{ _("PiSCSI Config") }}< / label >
2023-11-01 13:28:53 +00:00
< / fieldset >
2022-12-20 01:21:01 +00:00
< / form >
2023-11-01 13:28:53 +00:00
< script
type="application/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"
integrity="sha384-PwiT+fWTPpIySx6DrH1FKraKo+LvVpOClsjx0TSdMYTKi7BR1hR149f4VHLUUnfA"
crossorigin="anonymous"
>< / script >
2023-02-15 02:48:53 +00:00
2022-12-20 01:21:01 +00:00
< 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 >
2023-02-15 02:48:53 +00:00
< noscript >
< div class = "noscriptmsg" >
{{ _("The file uploading functionality requires JavaScript.") }}
< / div >
< / noscript >
2023-02-13 21:20:57 +00:00
2022-12-20 01:21:01 +00:00
{% endblock content %}