renderReminders: re-indent body inside paintAtomic callback
argus 🟡 nit on #480 — the `if (!rows.length)` block sat at +6 inside the paintAtomic callback, but the `const ul` + for loop underneath stayed at the pre-wrap +4. Code was correct, just visually inconsistent. Re-indented the whole callback body uniformly. renderScheduleNewForm has the same cosmetic mis-indent but its body is ~100 lines; leaving that for a separate sweep so the diff stays focused.
This commit is contained in:
parent
d4a53d83d3
commit
062e2d3055
1 changed files with 57 additions and 57 deletions
|
|
@ -1875,66 +1875,66 @@ window.marked = marked;
|
|||
root.append(el('p', { class: 'empty' }, 'no queued reminders'));
|
||||
return;
|
||||
}
|
||||
const ul = el('ul', { class: 'reminders' });
|
||||
for (const r of rows) {
|
||||
const failed = (r.attempt_count || 0) > 0;
|
||||
const li = el('li', { class: 'reminder-row' + (failed ? ' reminder-failed' : '') });
|
||||
const dueIn = r.due_at - Math.floor(Date.now() / 1000);
|
||||
const dueLabel = dueIn <= 0
|
||||
? `overdue ${fmtAgo(r.due_at)}`
|
||||
: `in ${fmtDuration(dueIn)}`;
|
||||
const head = el('div', { class: 'reminder-head' },
|
||||
el('span', { class: 'agent' }, r.agent), ' ',
|
||||
el('span', { class: 'meta', title: new Date(r.due_at * 1000).toISOString() }, dueLabel),
|
||||
' ',
|
||||
el('span', { class: 'meta' }, `· id ${r.id}`),
|
||||
);
|
||||
if (r.file_path) {
|
||||
head.append(' ', el('span', { class: 'meta' }, '· payload → '));
|
||||
appendLinkified(head, r.file_path);
|
||||
}
|
||||
if (failed) {
|
||||
head.append(' ', el('span',
|
||||
{
|
||||
class: 'badge badge-warn',
|
||||
title: 'consecutive failed delivery attempts (capped at 5; over the cap the scheduler stops retrying until you click R3TRY or cancel)',
|
||||
},
|
||||
`⚠ ${r.attempt_count} failed`));
|
||||
}
|
||||
const body = el('div', { class: 'reminder-body' });
|
||||
appendLinkified(body, r.message);
|
||||
li.append(head, body);
|
||||
if (r.last_error) {
|
||||
li.append(el('div', { class: 'reminder-error' },
|
||||
el('span', { class: 'msg-sep' }, 'error: '),
|
||||
r.last_error,
|
||||
));
|
||||
}
|
||||
const actions = el('div', { class: 'reminder-actions' });
|
||||
if (failed) {
|
||||
// Retry resets the failure counters so the scheduler picks
|
||||
// the row up again on its next 5s tick. No data-no-refresh
|
||||
// — the resulting refreshState re-fires refreshReminders.
|
||||
const retryForm = el('form', {
|
||||
method: 'POST', action: '/retry-reminder/' + r.id,
|
||||
const ul = el('ul', { class: 'reminders' });
|
||||
for (const r of rows) {
|
||||
const failed = (r.attempt_count || 0) > 0;
|
||||
const li = el('li', { class: 'reminder-row' + (failed ? ' reminder-failed' : '') });
|
||||
const dueIn = r.due_at - Math.floor(Date.now() / 1000);
|
||||
const dueLabel = dueIn <= 0
|
||||
? `overdue ${fmtAgo(r.due_at)}`
|
||||
: `in ${fmtDuration(dueIn)}`;
|
||||
const head = el('div', { class: 'reminder-head' },
|
||||
el('span', { class: 'agent' }, r.agent), ' ',
|
||||
el('span', { class: 'meta', title: new Date(r.due_at * 1000).toISOString() }, dueLabel),
|
||||
' ',
|
||||
el('span', { class: 'meta' }, `· id ${r.id}`),
|
||||
);
|
||||
if (r.file_path) {
|
||||
head.append(' ', el('span', { class: 'meta' }, '· payload → '));
|
||||
appendLinkified(head, r.file_path);
|
||||
}
|
||||
if (failed) {
|
||||
head.append(' ', el('span',
|
||||
{
|
||||
class: 'badge badge-warn',
|
||||
title: 'consecutive failed delivery attempts (capped at 5; over the cap the scheduler stops retrying until you click R3TRY or cancel)',
|
||||
},
|
||||
`⚠ ${r.attempt_count} failed`));
|
||||
}
|
||||
const body = el('div', { class: 'reminder-body' });
|
||||
appendLinkified(body, r.message);
|
||||
li.append(head, body);
|
||||
if (r.last_error) {
|
||||
li.append(el('div', { class: 'reminder-error' },
|
||||
el('span', { class: 'msg-sep' }, 'error: '),
|
||||
r.last_error,
|
||||
));
|
||||
}
|
||||
const actions = el('div', { class: 'reminder-actions' });
|
||||
if (failed) {
|
||||
// Retry resets the failure counters so the scheduler picks
|
||||
// the row up again on its next 5s tick. No data-no-refresh
|
||||
// — the resulting refreshState re-fires refreshReminders.
|
||||
const retryForm = el('form', {
|
||||
method: 'POST', action: '/retry-reminder/' + r.id,
|
||||
class: 'inline', 'data-async': '',
|
||||
});
|
||||
retryForm.append(el('button',
|
||||
{ type: 'submit', class: 'btn btn-restart' }, '↻ R3TRY'));
|
||||
actions.append(retryForm);
|
||||
}
|
||||
const cancelForm = el('form', {
|
||||
method: 'POST', action: '/cancel-reminder/' + r.id,
|
||||
class: 'inline', 'data-async': '',
|
||||
'data-confirm': `cancel reminder ${r.id} for ${r.agent}? this drops the queued delivery; no undo.`,
|
||||
});
|
||||
retryForm.append(el('button',
|
||||
{ type: 'submit', class: 'btn btn-restart' }, '↻ R3TRY'));
|
||||
actions.append(retryForm);
|
||||
cancelForm.append(el('button', { type: 'submit', class: 'btn btn-deny' }, '✗ C4NC3L'));
|
||||
actions.append(cancelForm);
|
||||
li.append(actions);
|
||||
ul.append(li);
|
||||
}
|
||||
const cancelForm = el('form', {
|
||||
method: 'POST', action: '/cancel-reminder/' + r.id,
|
||||
class: 'inline', 'data-async': '',
|
||||
'data-confirm': `cancel reminder ${r.id} for ${r.agent}? this drops the queued delivery; no undo.`,
|
||||
});
|
||||
cancelForm.append(el('button', { type: 'submit', class: 'btn btn-deny' }, '✗ C4NC3L'));
|
||||
actions.append(cancelForm);
|
||||
li.append(actions);
|
||||
ul.append(li);
|
||||
}
|
||||
root.append(ul);
|
||||
}); // paintAtomic
|
||||
root.append(ul);
|
||||
});
|
||||
}
|
||||
function fmtDuration(secs) {
|
||||
if (secs < 60) return secs + 's';
|
||||
|
|
|
|||
Loading…
Reference in a new issue