|
230 | 230 | return s.replace(regexp, '<span class="hili">$1</span>'); |
231 | 231 | } |
232 | 232 |
|
233 | | - /** |
234 | | - * @param {HTMLElement} node |
235 | | - */ |
236 | | - function scrollToBottom(node) { |
237 | | - // node.scroll({ top: node.scrollHeight, behavior: "smooth" }); |
238 | | - node.scroll({ top: node.scrollHeight }); |
239 | | - } |
240 | | -
|
241 | 233 | let windowTitle = "Logview " + version; |
242 | 234 | // @ts-ignore |
243 | 235 | window.runtime?.WindowSetTitle(windowTitle); |
|
310 | 302 | {#each tabs as tab, idx} |
311 | 303 | {#if idx === selectedTabIdx} |
312 | 304 | <button class="tab tab-selected" |
313 | | - >{tab.tabName} ({idx + 1}) |
| 305 | + >{tab.tabName} <span class="kbd">[{idx + 1}]</span> |
314 | 306 | <!-- svelte-ignore a11y_click_events_have_key_events --> |
315 | 307 | <!-- svelte-ignore a11y_no_static_element_interactions --> |
316 | 308 | <span onclick={() => closeTab(idx)} class="tab-close">×</span> |
317 | 309 | </button> |
318 | 310 | {:else} |
319 | 311 | <button onclick={() => selectTab(idx)} class="tab" |
320 | | - >{tab.tabName} ({idx + 1}) |
| 312 | + >{tab.tabName} <span class="kbd">[{idx + 1}]</span> |
321 | 313 | <!-- svelte-ignore a11y_click_events_have_key_events --> |
322 | 314 | <!-- svelte-ignore a11y_no_static_element_interactions --> |
323 | 315 | <span onclick={() => closeTab(idx)} class="tab-close">×</span> |
|
327 | 319 | </div> |
328 | 320 |
|
329 | 321 | {#if selectedTabIdx < 0} |
330 | | - <div class="grow"> |
| 322 | + <div class="grow bg-white"> |
331 | 323 | <div class="no-results">No logs yet</div> |
332 | 324 | </div> |
333 | 325 | {:else if len(filteredLogs) == 0} |
334 | 326 | {#if getLogsCount() == 0} |
335 | | - <div class="grow"> |
| 327 | + <div class="grow bg-white"> |
336 | 328 | <div class="no-results">No logs yet</div> |
337 | 329 | </div> |
338 | 330 | {:else} |
339 | | - <div class="grow"> |
| 331 | + <div class="grow bg-white"> |
340 | 332 | <div class="no-results">No results matching '<b>{filter}</b>'</div> |
341 | 333 | </div> |
342 | 334 | {/if} |
|
373 | 365 | .grow { |
374 | 366 | flex-grow: 1; |
375 | 367 | } |
| 368 | + .bg-white { |
| 369 | + background-color: white; |
| 370 | + } |
| 371 | +
|
376 | 372 | .hidden { |
377 | 373 | display: none; |
378 | 374 | } |
|
402 | 398 | display: flex; |
403 | 399 | } |
404 | 400 |
|
| 401 | + .kbd { |
| 402 | + color: gray; |
| 403 | + margin-left: 0.25rem; |
| 404 | + } |
| 405 | +
|
405 | 406 | .tab { |
| 407 | + display: flex; |
| 408 | + align-items: center; |
406 | 409 | border: 0; |
407 | | - padding: 4px 1rem; |
| 410 | + padding: 4px 0.5rem; |
408 | 411 | cursor: pointer; |
409 | 412 | &:hover { |
410 | 413 | background-color: rgba(128, 128, 128, 0.2); |
|
423 | 426 | background-color: rgba(128, 128, 128, 0.4); |
424 | 427 | } |
425 | 428 | } |
| 429 | +
|
426 | 430 | .no-results { |
427 | 431 | text-align: center; |
428 | 432 | font-size: 120%; |
429 | 433 | margin-top: 30%; /* from eyeballing */ |
430 | | - /* background-color: bisque; */ |
431 | 434 | } |
432 | 435 | .btn-pause { |
433 | 436 | min-width: 8rem; |
434 | 437 | } |
435 | 438 |
|
436 | | - .log-area { |
437 | | - overflow: auto; |
438 | | - padding: 4px 1rem; |
439 | | - /* background: rgb(239, 250, 254); */ |
440 | | - background-color: white; |
441 | | - font-family: monospace; |
442 | | - } |
443 | | -
|
444 | | - .log-line { |
445 | | - /* content-visibility: auto; */ |
446 | | - /* contain-intrinsic-size: 1rem; */ |
447 | | - } |
448 | | -
|
449 | 439 | :global(.hili) { |
450 | 440 | background-color: yellow; |
451 | 441 | } |
|
0 commit comments