Spaces:
Sleeping
Sleeping
Commit ·
4d2bbdb
1
Parent(s): 99e1f27
Rename compare tab labels from Base/Comparison to Old/New image.
Browse filesMakes the change detection workflow clearer by showing Old Image (T1) and
New Image (T2) instead of base and comparison terminology.
- static/js/dda/compare.js +3 -3
- templates/index_dda.html +10 -10
static/js/dda/compare.js
CHANGED
|
@@ -57,7 +57,7 @@ function populateSelects(items) {
|
|
| 57 |
const sel = document.getElementById(id);
|
| 58 |
if (!sel) return;
|
| 59 |
const current = sel.value;
|
| 60 |
-
const label = id === 'select-t1' ? '— Choose
|
| 61 |
sel.innerHTML = `<option value="">${label}</option>` +
|
| 62 |
items.map((img) => `<option value="${encodePath(img.path)}">${escapeHtml(img.breadcrumb || img.nodePath || img.filename)}</option>`).join('');
|
| 63 |
if (current) sel.value = current;
|
|
@@ -199,7 +199,7 @@ async function openPicker(slotKey) {
|
|
| 199 |
if (!modal || !list) return;
|
| 200 |
|
| 201 |
if (title) {
|
| 202 |
-
title.textContent = slotKey === 't1' ? 'Select
|
| 203 |
}
|
| 204 |
list.innerHTML = '<p class="dim">Loading library…</p>';
|
| 205 |
modal.classList.remove('hidden');
|
|
@@ -435,7 +435,7 @@ async function pollJobUntilDone(jobId) {
|
|
| 435 |
|
| 436 |
async function runLibraryDetection() {
|
| 437 |
if (!compareState.t1 || !compareState.t2) {
|
| 438 |
-
if (typeof showDdaError === 'function') showDdaError('Select both T1 (
|
| 439 |
return;
|
| 440 |
}
|
| 441 |
const btn = document.getElementById('btn-run-job');
|
|
|
|
| 57 |
const sel = document.getElementById(id);
|
| 58 |
if (!sel) return;
|
| 59 |
const current = sel.value;
|
| 60 |
+
const label = id === 'select-t1' ? '— Choose old image —' : '— Choose new image —';
|
| 61 |
sel.innerHTML = `<option value="">${label}</option>` +
|
| 62 |
items.map((img) => `<option value="${encodePath(img.path)}">${escapeHtml(img.breadcrumb || img.nodePath || img.filename)}</option>`).join('');
|
| 63 |
if (current) sel.value = current;
|
|
|
|
| 199 |
if (!modal || !list) return;
|
| 200 |
|
| 201 |
if (title) {
|
| 202 |
+
title.textContent = slotKey === 't1' ? 'Select Old Image (T1)' : 'Select New Image (T2)';
|
| 203 |
}
|
| 204 |
list.innerHTML = '<p class="dim">Loading library…</p>';
|
| 205 |
modal.classList.remove('hidden');
|
|
|
|
| 435 |
|
| 436 |
async function runLibraryDetection() {
|
| 437 |
if (!compareState.t1 || !compareState.t2) {
|
| 438 |
+
if (typeof showDdaError === 'function') showDdaError('Select both T1 (old) and T2 (new) images first.');
|
| 439 |
return;
|
| 440 |
}
|
| 441 |
const btn = document.getElementById('btn-run-job');
|
templates/index_dda.html
CHANGED
|
@@ -121,21 +121,21 @@
|
|
| 121 |
<main class="dda-main">
|
| 122 |
<div class="card">
|
| 123 |
<div class="card-header"><h3>Compare Images</h3></div>
|
| 124 |
-
<p class="sub">Select <strong>
|
| 125 |
<div class="dda-compare-slots">
|
| 126 |
<div class="dda-slot" id="slot-t1" data-slot="t1">
|
| 127 |
-
<span class="dda-slot-label">
|
| 128 |
<div id="slot-t1-preview" class="dda-slot-preview-wrap"></div>
|
| 129 |
-
<select id="select-t1" class="dda-image-select" aria-label="Select
|
| 130 |
-
<option value="">— Choose
|
| 131 |
</select>
|
| 132 |
<button type="button" class="btn btn-secondary btn-sm dda-slot-pick" data-pick="t1">Browse library</button>
|
| 133 |
</div>
|
| 134 |
<div class="dda-slot" id="slot-t2" data-slot="t2">
|
| 135 |
-
<span class="dda-slot-label">
|
| 136 |
<div id="slot-t2-preview" class="dda-slot-preview-wrap"></div>
|
| 137 |
-
<select id="select-t2" class="dda-image-select" aria-label="Select
|
| 138 |
-
<option value="">— Choose
|
| 139 |
</select>
|
| 140 |
<button type="button" class="btn btn-secondary btn-sm dda-slot-pick" data-pick="t2">Browse library</button>
|
| 141 |
</div>
|
|
@@ -219,8 +219,8 @@
|
|
| 219 |
<div class="dda-view-toolbar">
|
| 220 |
<span class="dda-view-label">View:</span>
|
| 221 |
<button type="button" class="dda-view-btn active" data-view="slider">Slider</button>
|
| 222 |
-
<button type="button" class="dda-view-btn" data-view="t1">
|
| 223 |
-
<button type="button" class="dda-view-btn" data-view="t2">
|
| 224 |
<button type="button" class="dda-view-btn" data-view="overlay">Overlay</button>
|
| 225 |
<button type="button" class="btn btn-secondary btn-sm" id="dda-locate-btn" title="Locate selected region" disabled>Locate</button>
|
| 226 |
</div>
|
|
@@ -326,7 +326,7 @@
|
|
| 326 |
<script src="/static/js/dda/tree.js?v=2"></script>
|
| 327 |
<script src="/static/js/dda/library.js?v=10"></script>
|
| 328 |
<script src="/static/js/dda/result.js?v=7"></script>
|
| 329 |
-
<script src="/static/js/dda/compare.js?v=
|
| 330 |
<script src="/static/js/dda/reports.js?v=4"></script>
|
| 331 |
<script src="/static/js/dda/notifications.js?v=1"></script>
|
| 332 |
</body>
|
|
|
|
| 121 |
<main class="dda-main">
|
| 122 |
<div class="card">
|
| 123 |
<div class="card-header"><h3>Compare Images</h3></div>
|
| 124 |
+
<p class="sub">Select <strong>Old Image (T1)</strong> and <strong>New Image (T2)</strong> from the library, then run detection.</p>
|
| 125 |
<div class="dda-compare-slots">
|
| 126 |
<div class="dda-slot" id="slot-t1" data-slot="t1">
|
| 127 |
+
<span class="dda-slot-label">Old Image (T1)</span>
|
| 128 |
<div id="slot-t1-preview" class="dda-slot-preview-wrap"></div>
|
| 129 |
+
<select id="select-t1" class="dda-image-select" aria-label="Select old image">
|
| 130 |
+
<option value="">— Choose old image —</option>
|
| 131 |
</select>
|
| 132 |
<button type="button" class="btn btn-secondary btn-sm dda-slot-pick" data-pick="t1">Browse library</button>
|
| 133 |
</div>
|
| 134 |
<div class="dda-slot" id="slot-t2" data-slot="t2">
|
| 135 |
+
<span class="dda-slot-label">New Image (T2)</span>
|
| 136 |
<div id="slot-t2-preview" class="dda-slot-preview-wrap"></div>
|
| 137 |
+
<select id="select-t2" class="dda-image-select" aria-label="Select new image">
|
| 138 |
+
<option value="">— Choose new image —</option>
|
| 139 |
</select>
|
| 140 |
<button type="button" class="btn btn-secondary btn-sm dda-slot-pick" data-pick="t2">Browse library</button>
|
| 141 |
</div>
|
|
|
|
| 219 |
<div class="dda-view-toolbar">
|
| 220 |
<span class="dda-view-label">View:</span>
|
| 221 |
<button type="button" class="dda-view-btn active" data-view="slider">Slider</button>
|
| 222 |
+
<button type="button" class="dda-view-btn" data-view="t1">Old Image (T1)</button>
|
| 223 |
+
<button type="button" class="dda-view-btn" data-view="t2">New Image (T2)</button>
|
| 224 |
<button type="button" class="dda-view-btn" data-view="overlay">Overlay</button>
|
| 225 |
<button type="button" class="btn btn-secondary btn-sm" id="dda-locate-btn" title="Locate selected region" disabled>Locate</button>
|
| 226 |
</div>
|
|
|
|
| 326 |
<script src="/static/js/dda/tree.js?v=2"></script>
|
| 327 |
<script src="/static/js/dda/library.js?v=10"></script>
|
| 328 |
<script src="/static/js/dda/result.js?v=7"></script>
|
| 329 |
+
<script src="/static/js/dda/compare.js?v=14"></script>
|
| 330 |
<script src="/static/js/dda/reports.js?v=4"></script>
|
| 331 |
<script src="/static/js/dda/notifications.js?v=1"></script>
|
| 332 |
</body>
|