Skip to content

Commit 2bfb1dd

Browse files
committed
quick fix
1 parent 0e4a802 commit 2bfb1dd

3 files changed

Lines changed: 89 additions & 32 deletions

File tree

‎frontend/src/App.tsx‎

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -167,31 +167,23 @@ export const App: React.FC = () => {
167167
{metrics.jobs_summary.length === 0 ? (
168168
<p className="hint">No jobs yet.</p>
169169
) : (
170-
<div className="jobs-table">
171-
<table>
172-
<thead>
173-
<tr>
174-
<th>Job ID</th>
175-
<th>Origin</th>
176-
<th>Depth</th>
177-
<th>Status</th>
178-
<th>Processed</th>
179-
<th>Created</th>
180-
</tr>
181-
</thead>
182-
<tbody>
183-
{metrics.jobs_summary.map((job) => (
184-
<tr key={job.id}>
185-
<td>{job.id.slice(0, 8)}…</td>
186-
<td>{job.origin_url}</td>
187-
<td>{job.max_depth}</td>
188-
<td>{job.status}</td>
189-
<td>{job.processed_urls}</td>
190-
<td>{new Date(job.created_at).toLocaleTimeString()}</td>
191-
</tr>
192-
))}
193-
</tbody>
194-
</table>
170+
<div className="jobs-list">
171+
{metrics.jobs_summary.map((job) => (
172+
<article className="job-card" key={job.id}>
173+
<div className="job-card-header">
174+
<strong>{job.id.slice(0, 8)}…</strong>
175+
<span className={`badge badge-${job.status === "running" ? "normal" : "idle"}`}>
176+
{job.status}
177+
</span>
178+
</div>
179+
<div className="job-card-url">{job.origin_url}</div>
180+
<div className="job-card-meta">
181+
<span>Depth: {job.max_depth}</span>
182+
<span>Processed: {job.processed_urls}</span>
183+
<span>{new Date(job.created_at).toLocaleTimeString()}</span>
184+
</div>
185+
</article>
186+
))}
195187
</div>
196188
)}
197189
</>
@@ -220,7 +212,7 @@ export const App: React.FC = () => {
220212
{results.length === 0 ? (
221213
<p className="hint">No results yet. Try searching after indexing.</p>
222214
) : (
223-
<table>
215+
<table className="search-table">
224216
<thead>
225217
<tr>
226218
<th style={{ width: "40%" }}>URL</th>
@@ -233,12 +225,12 @@ export const App: React.FC = () => {
233225
<tbody>
234226
{results.map((r) => (
235227
<tr key={`${r.relevant_url}-${r.depth}`}>
236-
<td>
237-
<a href={r.relevant_url} target="_blank" rel="noreferrer">
228+
<td className="url-cell">
229+
<a className="result-link" href={r.relevant_url} target="_blank" rel="noreferrer">
238230
{r.relevant_url}
239231
</a>
240232
</td>
241-
<td>{r.origin_url}</td>
233+
<td className="url-cell">{r.origin_url}</td>
242234
<td>{r.depth}</td>
243235
<td>{r.score?.toFixed(2)}</td>
244236
<td>{r.title}</td>

‎frontend/src/styles.css‎

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,19 @@ button:disabled {
185185
flex: 1;
186186
min-height: 0;
187187
overflow: auto;
188+
border: 1px solid rgba(148, 163, 184, 0.18);
189+
border-radius: 0.75rem;
190+
background: rgba(7, 12, 26, 0.45);
188191
}
189192

190-
.jobs-table {
193+
.jobs-list {
191194
margin-top: 0.4rem;
192-
max-height: 220px;
195+
max-height: 320px;
193196
overflow: auto;
197+
display: flex;
198+
flex-direction: column;
199+
gap: 0.75rem;
200+
padding-right: 0.2rem;
194201
}
195202

196203
table {
@@ -203,19 +210,71 @@ table {
203210
th,
204211
td {
205212
border-bottom: 1px solid rgba(55, 65, 81, 0.8);
206-
padding: 0.3rem 0.35rem;
213+
padding: 0.65rem 0.7rem;
207214
text-align: left;
215+
vertical-align: top;
208216
}
209217

210218
th {
211219
font-weight: 600;
212220
color: #e5e7eb;
221+
position: sticky;
222+
top: 0;
223+
background: rgba(15, 23, 42, 0.98);
224+
z-index: 1;
213225
}
214226

215227
td a {
216228
color: #a5b4fc;
217229
}
218230

231+
.search-table th {
232+
font-size: 0.75rem;
233+
letter-spacing: 0.02em;
234+
}
235+
236+
.url-cell {
237+
word-break: break-word;
238+
overflow-wrap: anywhere;
239+
}
240+
241+
.result-link {
242+
display: inline-block;
243+
word-break: break-word;
244+
overflow-wrap: anywhere;
245+
}
246+
247+
.job-card {
248+
border: 1px solid rgba(148, 163, 184, 0.2);
249+
border-radius: 0.75rem;
250+
padding: 0.8rem 0.9rem;
251+
background: rgba(7, 12, 26, 0.45);
252+
}
253+
254+
.job-card-header {
255+
display: flex;
256+
align-items: center;
257+
justify-content: space-between;
258+
gap: 0.75rem;
259+
margin-bottom: 0.45rem;
260+
}
261+
262+
.job-card-url {
263+
font-size: 0.82rem;
264+
color: #cbd5f5;
265+
word-break: break-word;
266+
overflow-wrap: anywhere;
267+
margin-bottom: 0.55rem;
268+
}
269+
270+
.job-card-meta {
271+
display: flex;
272+
flex-wrap: wrap;
273+
gap: 0.5rem 0.9rem;
274+
font-size: 0.78rem;
275+
color: #9ca3af;
276+
}
277+
219278
@media (max-width: 800px) {
220279
.app {
221280
padding: 0.75rem;

‎package-lock.json‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)