Skip to content

Commit fbd844d

Browse files
committed
feat: Add loading indicator to Map Now button and switch default LLM to deepseek-r1:1.5b
1 parent a087717 commit fbd844d

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

demo/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ async function onFiles(files) {
166166

167167
async function mapNow() {
168168
els.mapBtn.disabled = true;
169+
els.mapBtn.classList.add("loading"); // Add loading class
169170
try {
170171
const body = {
171172
version_from: "2.x",
@@ -197,6 +198,7 @@ async function mapNow() {
197198
alert(`Map failed: ${e.message || e}`);
198199
} finally {
199200
els.mapBtn.disabled = false;
201+
els.mapBtn.classList.remove("loading"); // Remove loading class
200202
els.clearBtn.disabled = state.rows.length === 0; // Enable Clear after mapping/error
201203
}
202204
}

demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h1>IAB 2.x → 3.0 Mapper</h1>
5757
<input id="search" type="search" placeholder="Search…" title="Client‑side filter across all columns." />
5858
</div>
5959
<div class="spacer"></div>
60-
<button id="mapBtn" disabled>Map Now</button>
60+
<button id="mapBtn" disabled>Map Now <i class="fas fa-spinner fa-spin loading-spinner"></i></button>
6161
<div class="exports">
6262
<button id="exportCsv" disabled>Download CSV</button>
6363
<button id="exportJson" disabled>Download JSON</button>
@@ -86,7 +86,7 @@ <h1>IAB 2.x → 3.0 Mapper</h1>
8686

8787
<div class="field">
8888
<label for="llmModel">LLM model <i class="fa-regular fa-circle-question help-icon" data-tooltip="Ollama model name to use for re‑rank (e.g., llama3.1:8b)."></i></label>
89-
<input id="llmModel" type="text" value="llama3.1:8b" />
89+
<input id="llmModel" type="text" value="deepseek-r1:1.5b" />
9090
</div>
9191

9292
<div class="field">

demo/styles.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ h1{ font-size:20px; margin:0 0 6px 0; }
4949
.control select[multiple]{ min-width:180px; }
5050
.method-group{ display:flex; gap:10px; flex-wrap:wrap; }
5151
.method-group label{ display:flex; align-items:center; gap:6px; background:#0f1520; border:1px solid var(--border); border-radius:8px; padding:6px 10px; color:var(--text); }
52+
.method-group label:hover,
53+
.method-group label:focus-within {
54+
background-color: #e0e0e0;
55+
}
56+
5257
.spacer{ flex:1; }
5358
button{ background:linear-gradient(180deg,#1c2838,#152030); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:10px 14px; cursor:pointer; transition:transform .08s ease, box-shadow .12s ease, border-color .12s ease; }
5459
button:disabled{ opacity:0.6; cursor:not-allowed; }
@@ -70,6 +75,21 @@ button#mapBtn:active{ transform: translateY(0); }
7075
button#mapBtn:disabled{ background:#1b2a3a; color:var(--muted); border-color:var(--border); box-shadow:none; }
7176
.exports button{ margin-left:8px; }
7277

78+
.loading-spinner {
79+
display: none;
80+
margin-left: 8px; /* Space between text and spinner */
81+
}
82+
83+
#mapBtn.loading {
84+
cursor: not-allowed;
85+
background: #6c757d; /* A grayed-out look */
86+
border-color: #6c757d;
87+
}
88+
89+
#mapBtn.loading .loading-spinner {
90+
display: inline-block;
91+
}
92+
7393
.results{ margin:16px 0 40px; }
7494
table{ width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
7595
thead th{ text-align:left; padding:10px; background:#0f1520; color:var(--muted); font-weight:600; border-bottom:1px solid var(--border); }

uvicorn.log

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
INFO: Will watch for changes in these directories: ['/Users/ethan/Dev/mixpeek/tools/iab-mapper']
22
INFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)
3-
INFO: Started reloader process [78622] using WatchFiles
4-
INFO: Started server process [78671]
5-
INFO: Waiting for application startup.
6-
INFO: Application startup complete.
7-
WARNING: WatchFiles detected changes in 'iab_mapper/pipeline.py'. Reloading...
8-
INFO: Shutting down
9-
INFO: Waiting for application shutdown.
10-
INFO: Application shutdown complete.
11-
INFO: Finished server process [78671]
12-
INFO: Started server process [78773]
13-
INFO: Waiting for application startup.
14-
INFO: Application startup complete.
15-
WARNING: WatchFiles detected changes in 'iab_mapper/pipeline.py'. Reloading...
16-
INFO: Shutting down
17-
INFO: Waiting for application shutdown.
18-
INFO: Application shutdown complete.
19-
INFO: Finished server process [78773]
20-
INFO: Started server process [90044]
21-
INFO: Waiting for application startup.
22-
INFO: Application startup complete.
23-
WARNING: WatchFiles detected changes in 'iab_mapper/pipeline.py'. Reloading...
24-
INFO: Shutting down
25-
INFO: Waiting for application shutdown.
26-
INFO: Application shutdown complete.
27-
INFO: Finished server process [90044]
28-
INFO: Started server process [90125]
3+
INFO: Started reloader process [24745] using WatchFiles
4+
INFO: Started server process [24794]
295
INFO: Waiting for application startup.
306
INFO: Application startup complete.

0 commit comments

Comments
 (0)