Passwords: open entries instantly from an in-memory copy; one-time code loads separately
build-container / build (push) Successful in 6m17s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-29 11:17:59 -04:00
1 parent 4752aca43c
commit 5f5d5ae214
2 files changed
+12 -10

No files matched your search

+3 -2
View File
@@ -75,15 +75,16 @@ async function vtList(st) {
async function vtOpen(id, lockedOut, reload) {
let it; try { it = await vtReq('/item/' + encodeURIComponent(id)); } catch (e) { return e.locked ? lockedOut() : toast(e.message); }
const field = (label, value, key, secret) => value ? `<div class="vtf" style="margin:10px 0"><small style="color:var(--muted)">${esc(label)}</small><div style="display:flex;gap:8px;align-items:center"><span class="grow vtv" data-k="${key}" style="word-break:break-all;font-family:${secret ? 'ui-monospace,monospace' : 'inherit'}">${secret ? '••••••••••' : esc(value)}</span>${secret ? `<button class="btn ghost vtshow" data-k="${key}">Show</button>` : ''}<button class="btn ghost vtcp" data-k="${key}" data-w="${esc(label)}">Copy</button></div></div>` : '';
const vals = { user: it.username, pass: it.password, totp: it.totp };
const vals = { user: it.username, pass: it.password, totp: '' };
const extra = []; if (it.card) { vals.cnum = it.card.number; vals.ccode = it.card.code; }
(it.fields || []).forEach((f, n) => { vals['f' + n] = f.value; });
const links = it.uris.map(vtSafeUrl).filter(Boolean);
const el = openSheet(it.name || 'Entry', vtType[it.type] || '', `${field('Username', it.username, 'user')}${field('Password', it.password, 'pass', true)}${field('One-time code', it.totp, 'totp')}
const el = openSheet(it.name || 'Entry', vtType[it.type] || '', `${field('Username', it.username, 'user')}${field('Password', it.password, 'pass', true)}${it.hasTotp ? field('One-time code', '…', 'totp') : ''}
${it.card ? field('Cardholder', it.card.holder, 'chold') + field('Card number', it.card.number, 'cnum', true) + field('Security code', it.card.code, 'ccode', true) + field('Expires', [it.card.expMonth, it.card.expYear].filter(Boolean).join('/'), 'cexp') : ''}
${(it.fields || []).map((f, n) => field(f.name || 'Field', f.value, 'f' + n, f.hidden)).join('')}
${links.map(u => `<div class="vtf" style="margin:10px 0"><small style="color:var(--muted)">Website</small><div><a href="${esc(u)}" target="_blank" rel="noopener" style="color:var(--accent);word-break:break-all">${esc(u)}</a></div></div>`).join('')}
${it.notes ? `<div class="vtf" style="margin:10px 0"><small style="color:var(--muted)">Notes</small><div style="white-space:pre-wrap">${esc(it.notes)}</div></div>` : ''}`);
if (it.hasTotp) vtReq('/totp/' + encodeURIComponent(id)).then(r => { vals.totp = r.code; const sp = el.querySelector('.vtv[data-k=totp]'); if (sp) sp.textContent = r.code; }, () => { const sp = el.querySelector('.vtv[data-k=totp]'); if (sp) sp.textContent = 'unavailable'; });
if (it.type === 1 || it.type === 2) el.insertAdjacentHTML('beforeend', '<div class="bar"><button class="btn ghost" id="vted" style="flex:1;justify-content:center">Edit</button></div>');
if ($('#vted')) $('#vted').onclick = () => { closeSheet(); vtEdit(it, reload, lockedOut); };
Object.assign(vals, { chold: it.card && it.card.holder, cexp: it.card && [it.card.expMonth, it.card.expYear].filter(Boolean).join('/') });