MCPcopy Create free account
hub / github.com/error311/FileRise / setItemStatus

Function setItemStatus

public/js/sharedDropView.js:414–439  ·  view source on GitHub ↗
(item, status, pct, message)

Source from the content-addressed store, hash-verified

412 }
413
414 function setItemStatus(item, status, pct, message) {
415 const refs = ensureRow(item);
416 item.status = status;
417 item.progress = Math.max(0, Math.min(100, Math.round(Number(pct || 0))));
418 refs.progressFill.style.width = item.progress + '%';
419
420 if (status === 'uploading') {
421 refs.row.classList.remove('is-error', 'is-done');
422 refs.statusEl.textContent = message || tx('share_uploading_progress', { pct: item.progress }, 'Uploading ' + item.progress + '%');
423 return;
424 }
425 if (status === 'done') {
426 refs.row.classList.remove('is-error');
427 refs.row.classList.add('is-done');
428 refs.statusEl.textContent = message || tx('share_drop_status_uploaded', null, 'Uploaded');
429 refs.progressFill.style.width = '100%';
430 return;
431 }
432 if (status === 'error') {
433 refs.row.classList.add('is-error');
434 refs.row.classList.remove('is-done');
435 refs.statusEl.textContent = message || tx('share_drop_status_failed', null, 'Failed');
436 return;
437 }
438 refs.statusEl.textContent = message || tx('share_drop_status_queued', null, 'Queued');
439 }
440
441 function validateQueueItem(item) {
442 if (!item || !isFileLike(item.file)) {

Callers 5

uploadSingleFunction · 0.85
uploadChunkedFunction · 0.85
uploadItemFunction · 0.85
runQueueFunction · 0.85
enqueueFilesFunction · 0.85

Calls 2

ensureRowFunction · 0.85
txFunction · 0.70

Tested by

no test coverage detected