Merge branch 'uploads' into 'dev'

Fixes upload indicator

See merge request crafty-controller/crafty-commander!58
This commit is contained in:
Andrew 2021-08-23 21:55:25 +00:00
commit e9f5eae28b
2 changed files with 17 additions and 16 deletions

View File

@ -583,17 +583,18 @@
label: "Upload", label: "Upload",
className: "btn-default", className: "btn-default",
callback: async function () { callback: async function () {
var height = files.files.length*50;
var waitMessage = '<p class="text-center mb-0">'+
'<i class="fa fa-spin fa-cog"></i>'+
'Please wait while we upload your files... This may take a while.<br>'+
'<strong>DO NOT CLOSE THIS PAGE.</strong>'+
'</p>'+
'<div class="progress" id="upload-progress-bar-parent" style="height:'+height +'px; width:100%; display: block;">'+
'</div>'
files = document.getElementById("files"); files = document.getElementById("files");
uploadWaitDialog = bootbox.dialog({ uploadWaitDialog = bootbox.dialog({
message: ` message: waitMessage,
<p class="text-center mb-0">
<i class="fa fa-spin fa-cog"></i>
Please wait while we upload your files... This may take a while.<br>
<strong>DO NOT CLOSE THIS PAGE.</strong>
</p>
<div class="progress" id="upload-progress-bar-parent">
</div>
`,
closeButton: false closeButton: false
}); });
let nFiles = files.files.length; let nFiles = files.files.length;
@ -603,20 +604,20 @@
hideUploadBox(); hideUploadBox();
break; break;
} }
console.log(files.files[i]); console.log(files.files[i].name);
const progressHtml = ` const progressHtml = `
<div> <div style="width: 100%; min-width: 100%;">
${path + '/' + files.files[i]}: ${files.files[i].name}:
<div <br><div
id="upload-progress-bar-${i + 1}" id="upload-progress-bar-${i + 1}"
class="progress-bar progress-bar-striped progress-bar-animated" class="progress-bar progress-bar-striped progress-bar-animated"
role="progressbar" role="progressbar"
style="width: 0%" style="width: 100%; height: 10px;"
aria-valuenow="0" aria-valuenow="0"
aria-valuemin="0" aria-valuemin="0"
aria-valuemax="100" aria-valuemax="100"
></div> ></div>
</div> </div><br>
`; `;
$('#upload-progress-bar-parent').append(progressHtml); $('#upload-progress-bar-parent').append(progressHtml);
sendFile(files.files[i], path, server_id, (progress) => { sendFile(files.files[i], path, server_id, (progress) => {

View File

@ -67,7 +67,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>T
</div> </div>
<style> <style>
#virt_console::-webkit-scrollbar { #virt_console::-webkit-scrollbar {