Initial commit
This commit is contained in:
commit
a437c068c8
64 changed files with 561683 additions and 0 deletions
33
scripts/progress.js
Normal file
33
scripts/progress.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
(function () {
|
||||
|
||||
const progressWrapper = document.querySelector('[data-3d-progress]');
|
||||
|
||||
if (!progressWrapper) {
|
||||
return;
|
||||
}
|
||||
|
||||
const entityId = progressWrapper.dataset.entityId;
|
||||
|
||||
function checkProgress() {
|
||||
|
||||
fetch('/dfg-3dviewer/progress/' + entityId)
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
|
||||
const bar = document.querySelector('#progress-bar');
|
||||
const label = document.querySelector('#progress-label');
|
||||
|
||||
if (!bar || !label) return;
|
||||
|
||||
bar.style.width = data.progress + '%';
|
||||
label.innerText = data.progress + '%';
|
||||
|
||||
if (data.status === 'ready') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(checkProgress, 3000);
|
||||
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue