minor fix

This commit is contained in:
2026-06-11 15:55:31 +08:00
parent 789f341aeb
commit 510a664b04
+3 -3
View File
@@ -439,7 +439,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
await writable.close(); await writable.close();
await Rpc2.notify('close'); await Rpc2.notify('close');
} catch (e) { } catch (e) {
alert('(ERROR) ' + String(e ?? 'File operation failed')); alert('(ERROR) ' + new String(e ?? 'File operation failed'));
await writable.abort().catch(() => void 0); await writable.abort().catch(() => void 0);
} }
writable = null; writable = null;
@@ -454,14 +454,14 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
let chunk = $('#chunksize').valueAsNumber; let chunk = $('#chunksize').valueAsNumber;
let total = $('#slice').checked ? Math.min(chunk, limit - chunk * $('#offset').valueAsNumber) : limit; let total = $('#slice').checked ? Math.min(chunk, limit - chunk * $('#offset').valueAsNumber) : limit;
$('#progressLabel').innerText = `${parseFloat(index / total * 100).toFixed(2)}% (${index}/${total})` $('#progressLabel').innerText = `${parseFloat(index / total * 100).toFixed(2)}% (${index}/${total})`;
$('#subjectLabel').innerText = subject ?? ''; $('#subjectLabel').innerText = subject ?? '';
$('#recipientLabel').innerText = recipient ? `${recipient} <${email}>` : email ?? ''; $('#recipientLabel').innerText = recipient ? `${recipient} <${email}>` : email ?? '';
let uptime = await Rpc2.invoke('uptime').catch(() => 0); let uptime = await Rpc2.invoke('uptime').catch(() => 0);
$('#uptimeLabel').innerText = Temporal.Duration.from({ seconds: uptime }).round({ largestUnit: 'hours' }).toLocaleString('en', { style: 'digital' }); $('#uptimeLabel').innerText = Temporal.Duration.from({ seconds: uptime }).round({ largestUnit: 'hours' }).toLocaleString('en', { style: 'digital' });
let rate = index / uptime let rate = index / uptime;
let remaining = index ? Math.floor((total - index) / rate) : 0; let remaining = index ? Math.floor((total - index) / rate) : 0;
$('#remainingLabel').innerText = remaining ? `${Temporal.Duration.from({ seconds: remaining }).round({ largestUnit: 'hours' }).toLocaleString('en')} (${rate.toFixed(2)}/min)` : ''; $('#remainingLabel').innerText = remaining ? `${Temporal.Duration.from({ seconds: remaining }).round({ largestUnit: 'hours' }).toLocaleString('en')} (${rate.toFixed(2)}/min)` : '';
break; break;