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",
className: "btn-default",
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");
uploadWaitDialog = bootbox.dialog({
message: `
<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>
`,
message: waitMessage,
closeButton: false
});
let nFiles = files.files.length;
@ -603,20 +604,20 @@
hideUploadBox();
break;
}
console.log(files.files[i]);
console.log(files.files[i].name);
const progressHtml = `
<div>
${path + '/' + files.files[i]}:
<div
<div style="width: 100%; min-width: 100%;">
${files.files[i].name}:
<br><div
id="upload-progress-bar-${i + 1}"
class="progress-bar progress-bar-striped progress-bar-animated"
role="progressbar"
style="width: 0%"
style="width: 100%; height: 10px;"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
></div>
</div>
</div><br>
`;
$('#upload-progress-bar-parent').append(progressHtml);
sendFile(files.files[i], path, server_id, (progress) => {

View File

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