This commit is contained in:
mike
2026-06-27 01:22:26 +02:00
parent 36a244cab4
commit 4f388901f3
6 changed files with 150 additions and 52 deletions

View File

@@ -1867,9 +1867,9 @@
<button class="btn" onclick="setIntervalTime(120)">2m</button>
<button class="btn primary" onclick="refreshNow()">Refresh Now</button>
<button class="btn" id="archiveViewBtn" onclick="toggleArchiveView()" title="View archived items">📦 Archive</button>
<a href="trash.html" class="btn" title="View database inconsistencies" style="text-decoration:none;display:inline-flex;align-items:center;">🗑️ Trash</a>
<button class="btn" id="selectBtn" onclick="toggleSelectMode()">Select</button>
<button class="btn" id="privacyBtn" onclick="togglePrivacyMode()" title="Privacy mode — hides content on focus loss (P)">🔓</button>
<button class="btn" onclick="cleanupDb()" title="Remove DB records for deleted/missing files" style="font-size:11px;opacity:0.6">Clean DB</button>
</div>
<div class="status">
<span class="status-dot" id="statusDot"></span>
@@ -5226,7 +5226,6 @@
const poseEntries = [...selectedPoses].map(p => ({ name: p, text: availablePoses[p]?.text ?? availablePoses[p] }));
if (!prompt && poseEntries.length === 0) { showToast('Enter a prompt or select a pose', 'info'); return; }
if (selectedFiles.size === 0) { showToast('No images selected', 'info'); return; }
// Build parallel prompt+pose arrays
const prompts = [];
@@ -5642,16 +5641,6 @@
} catch(e) { console.error(e); }
}
async function cleanupDb() {
try {
const r = await fetch(`${API}/db/cleanup`, { method: 'POST' });
const d = await r.json();
showToast(`Cleaned ${d.removed} orphan record${d.removed !== 1 ? 's' : ''}`);
if (d.removed > 0) refreshNow();
} catch(e) {
showToast('Cleanup failed');
}
}
async function lbUndress() {
const fname = lbNames[lbIdx];
@@ -6218,7 +6207,16 @@
async function submitSbGenerate() {
if (!_fsModelFilename) return;
const promptVal = (document.getElementById('sbGenPromptInput')?.value || '').trim();
// Read pad values (persisted in module vars for re-renders)
const hasPoses = _fsSelectedPoses.size > 0 || _sbSelectedAngles.size > 0;
const getV = (id) => document.getElementById(id)?.value || '0';
const padValStr = getV('sbPadTop') + getV('sbPadRight') + getV('sbPadBottom') + getV('sbPadLeft');
const hasPadding = padValStr.replace(/[0%\s]/g, '').length > 0;
const outpaint = document.getElementById('sbPadOutpaint')?.checked;
const hasPaddingAction = hasPadding && outpaint;
if (!hasPoses && !hasPaddingAction) {
// If no poses or padding, we'll run base_prompts
}
_sbPadTop = document.getElementById('sbPadTop')?.value || '0';
_sbPadRight = document.getElementById('sbPadRight')?.value || '0';
_sbPadBottom = document.getElementById('sbPadBottom')?.value || '0';