AppleSwing commited on
Commit
f5dc9b9
·
verified ·
1 Parent(s): 939748f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +159 -127
app.py CHANGED
@@ -271,191 +271,223 @@ def auto_refresh_from_dir(
271
 
272
  def build_app() -> gr.Blocks:
273
  row_css = """
274
- /* Force light theme everywhere */
275
- body, .gradio-container {
 
 
276
  background-color: #f5f7fa !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  color: #24292e !important;
278
  }
279
 
280
- /* --------------------------------------
281
- FIXED SEARCH BOX CSS STARTS HERE
282
- --------------------------------------
283
- */
 
 
 
284
 
285
- /* The outer Group container */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  .search-box {
287
  background: white !important;
288
  padding: 16px !important;
289
- border-radius: 6px;
290
  border: 2px solid #e1e4e8 !important;
291
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
292
  margin-bottom: 16px;
293
  }
294
 
295
- /* Reset the internal Gradio Block styles so they fit in the white box */
296
- .search-box .block {
 
 
 
297
  background: transparent !important;
298
  border: none !important;
299
  padding: 0 !important;
 
300
  }
301
 
302
- /* Style the Label Text (🔍 Search) */
303
  .search-box label span {
304
  color: #24292e !important;
305
  font-weight: 600;
306
  font-size: 14px;
307
  margin-bottom: 8px;
308
- background: transparent !important;
309
  }
310
 
311
- /* Style the actual Input Field */
312
- .search-box input.scroll-hide {
313
  background-color: white !important;
314
  color: #24292e !important;
315
- border: 1.5px solid #e1e4e8 !important;
316
- border-radius: 4px !important;
317
  padding: 10px !important;
318
  box-shadow: none !important;
319
  }
320
 
321
- /* Fix focus state */
322
- .search-box input.scroll-hide:focus {
323
  border-color: #0366d6 !important;
324
- ring: 0 !important;
325
- outline: none !important;
326
  }
327
 
328
- /* --------------------------------------
329
- END FIXED SEARCH BOX CSS
330
- --------------------------------------
331
- */
332
-
333
- /* Override all dark backgrounds (Global) */
334
- .gradio-container .block,
335
- .gradio-container .form,
336
- .gradio-container fieldset,
337
- .gradio-container .input-block,
338
- .gradio-container .wrap,
339
- .gradio-container .gr-box,
340
- .gradio-container .gr-form {
341
- background-color: white !important;
342
- }
343
-
344
- /* Table styling */
345
- .gradio-container table.metrics-table th,
346
- .gradio-container table.metrics-table td {
347
- padding: 10px 14px;
348
- border: 1.5px solid #e1e4e8;
349
- white-space: nowrap;
350
- font-size: 13px;
351
- text-align: left;
352
- color: #24292e !important;
353
- }
354
-
355
- .gradio-container table.metrics-table th {
356
- background: linear-gradient(to bottom, #fafbfc, #f6f8fa);
357
- font-weight: 600;
358
- color: #24292e !important;
359
- position: sticky;
360
- top: 0;
361
- z-index: 10;
362
- border-bottom: 2px solid #d1d5da;
363
- }
364
-
365
- .gradio-container table.metrics-table tbody tr:nth-child(even) {
366
- background-color: #f6f8fa;
367
- }
368
-
369
- .gradio-container table.metrics-table tbody tr:hover {
370
- background-color: #e1e4e8;
371
- }
372
-
373
- .gradio-container table.metrics-table {
374
- border-collapse: collapse;
375
- width: 100%;
376
- background: white;
377
- }
378
-
379
- .gradio-container table.metrics-table a {
380
- color: #0366d6 !important;
381
- text-decoration: none;
382
- }
383
-
384
- .gradio-container table.metrics-table a:hover {
385
- color: #0366d6 !important;
386
- text-decoration: underline;
387
- }
388
-
389
- /* Scrollable table container */
390
- .table-container {
391
- overflow-x: auto;
392
- overflow-y: auto;
393
- max-height: 75vh;
394
- border: 2px solid #e1e4e8;
395
- border-radius: 6px;
396
- background: white;
397
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
398
- }
399
-
400
- /* Filter section styling */
401
  .filter-section {
402
  background: white !important;
403
  padding: 0 !important;
404
- border-radius: 6px;
405
  border: 2px solid #e1e4e8 !important;
406
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
407
  }
408
-
409
- .filter-section * {
410
- color: #24292e !important;
411
- }
412
-
413
  .filter-section .wrap {
414
  padding: 20px !important;
415
- }
416
-
417
- .filter-section label {
418
  background: transparent !important;
419
- color: #24292e !important;
420
  }
421
-
422
- .filter-section fieldset {
423
- background: transparent !important;
424
- border-color: #e1e4e8 !important;
 
425
  }
426
-
427
- /* Accordion styling */
 
 
428
  .gradio-container .accordion {
429
  background: white !important;
430
  border: 2px solid #e1e4e8 !important;
431
- border-radius: 6px !important;
432
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
433
  }
434
-
435
- .gradio-container .accordion label,
436
- .gradio-container .accordion button,
437
- .gradio-container .accordion span {
438
- background: transparent !important;
439
- color: #24292e !important;
440
- }
441
-
442
- /* Info section */
443
  .info-section {
444
  padding: 16px;
445
  background: white !important;
446
  }
 
 
 
 
 
447
 
448
- .info-section * {
 
 
 
 
449
  color: #24292e !important;
450
  }
451
-
452
  .info-section a {
453
  color: #0366d6 !important;
 
454
  }
455
-
456
- /* Checkbox styling */
457
- .gradio-container input[type="checkbox"] {
458
- accent-color: #0366d6 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  }
460
  """
461
 
 
271
 
272
  def build_app() -> gr.Blocks:
273
  row_css = """
274
+ /* ==============================================
275
+ GLOBAL RESET & THEME
276
+ ============================================== */
277
+ body {
278
  background-color: #f5f7fa !important;
279
+ }
280
+
281
+ .gradio-container {
282
+ max-width: 100% !important;
283
+ padding: 20px !important;
284
+ background-color: #f5f7fa !important;
285
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
286
+ }
287
+
288
+ /* Force all main text to be dark */
289
+ .gradio-container,
290
+ .gradio-container label,
291
+ .gradio-container p,
292
+ .gradio-container span,
293
+ .gradio-container div {
294
  color: #24292e !important;
295
  }
296
 
297
+ /* Explicitly force Headings to Black */
298
+ .gradio-container h1,
299
+ .gradio-container h2,
300
+ .gradio-container h3 {
301
+ color: #24292e !important;
302
+ font-weight: 700;
303
+ }
304
 
305
+ /* Fix h1 spacing */
306
+ .gradio-container h1 {
307
+ margin-bottom: 24px;
308
+ }
309
+
310
+ /* Override default Gradio component backgrounds to White */
311
+ .gradio-container .block,
312
+ .gradio-container .form,
313
+ .gradio-container fieldset,
314
+ .gradio-container .gr-box,
315
+ .gradio-container .gr-form,
316
+ .gradio-container .panel {
317
+ background-color: white !important;
318
+ border-color: #e1e4e8 !important;
319
+ }
320
+
321
+ /* Remove transparent wrapper backgrounds */
322
+ .gradio-container > div,
323
+ .gradio-container .container,
324
+ .gradio-container .wrap {
325
+ background-color: transparent !important;
326
+ }
327
+
328
+ /* ==============================================
329
+ SEARCH BOX (FIXED)
330
+ ============================================== */
331
  .search-box {
332
  background: white !important;
333
  padding: 16px !important;
334
+ border-radius: 8px;
335
  border: 2px solid #e1e4e8 !important;
336
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
337
  margin-bottom: 16px;
338
  }
339
 
340
+ /* Reset internal block styles so they don't overlap */
341
+ .search-box .block,
342
+ .search-box .form,
343
+ .search-box .wrap,
344
+ .search-box .container {
345
  background: transparent !important;
346
  border: none !important;
347
  padding: 0 !important;
348
+ margin: 0 !important;
349
  }
350
 
351
+ /* Style the Label */
352
  .search-box label span {
353
  color: #24292e !important;
354
  font-weight: 600;
355
  font-size: 14px;
356
  margin-bottom: 8px;
357
+ display: block;
358
  }
359
 
360
+ /* Style the Input Field itself */
361
+ .search-box input {
362
  background-color: white !important;
363
  color: #24292e !important;
364
+ border: 1.5px solid #d1d5da !important;
365
+ border-radius: 6px !important;
366
  padding: 10px !important;
367
  box-shadow: none !important;
368
  }
369
 
370
+ .search-box input:focus {
 
371
  border-color: #0366d6 !important;
372
+ outline: 2px solid rgba(3, 102, 214, 0.3) !important;
 
373
  }
374
 
375
+ /* ==============================================
376
+ FILTERS SECTION
377
+ ============================================== */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  .filter-section {
379
  background: white !important;
380
  padding: 0 !important;
381
+ border-radius: 8px;
382
  border: 2px solid #e1e4e8 !important;
383
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
384
  }
385
+
 
 
 
 
386
  .filter-section .wrap {
387
  padding: 20px !important;
 
 
 
388
  background: transparent !important;
 
389
  }
390
+
391
+ /* Checkbox styling */
392
+ .gradio-container input[type="checkbox"] {
393
+ accent-color: #0366d6 !important;
394
+ margin-right: 6px;
395
  }
396
+
397
+ /* ==============================================
398
+ ABOUT / INFO SECTION (ACCORDION)
399
+ ============================================== */
400
  .gradio-container .accordion {
401
  background: white !important;
402
  border: 2px solid #e1e4e8 !important;
403
+ border-radius: 8px !important;
404
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
405
  }
406
+
407
+ /* Internal Info Section Content */
 
 
 
 
 
 
 
408
  .info-section {
409
  padding: 16px;
410
  background: white !important;
411
  }
412
+
413
+ /* Ensure all text inside About/Info is strictly black */
414
+ .info-section h3 { margin-top: 0; margin-bottom: 10px; }
415
+ .info-section ul { padding-left: 20px; margin-bottom: 15px; }
416
+ .info-section li { margin-bottom: 4px; }
417
 
418
+ .info-section,
419
+ .info-section p,
420
+ .info-section li,
421
+ .info-section strong,
422
+ .info-section span {
423
  color: #24292e !important;
424
  }
425
+
426
  .info-section a {
427
  color: #0366d6 !important;
428
+ text-decoration: none;
429
  }
430
+ .info-section a:hover { text-decoration: underline; }
431
+
432
+ /* ==============================================
433
+ DASHBOARD TABLE
434
+ ============================================== */
435
+ /* The Container - WIDER BORDER APPLIED HERE */
436
+ .table-container {
437
+ overflow-x: auto;
438
+ overflow-y: auto;
439
+ max-height: 75vh;
440
+
441
+ /* Changed from 2px to 4px for a wider border */
442
+ border: 4px solid #e1e4e8;
443
+
444
+ border-radius: 8px;
445
+ background: white;
446
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
447
+ }
448
+
449
+ table.metrics-table {
450
+ border-collapse: collapse;
451
+ width: 100%;
452
+ background: white;
453
+ font-size: 13px;
454
+ }
455
+
456
+ table.metrics-table th,
457
+ table.metrics-table td {
458
+ padding: 12px 16px;
459
+ border: 1px solid #e1e4e8;
460
+ white-space: nowrap;
461
+ text-align: left;
462
+ color: #24292e !important;
463
+ }
464
+
465
+ table.metrics-table th {
466
+ background: #f6f8fa;
467
+ font-weight: 700;
468
+ color: #24292e !important;
469
+ position: sticky;
470
+ top: 0;
471
+ z-index: 10;
472
+ border-bottom: 2px solid #d1d5da;
473
+ }
474
+
475
+ table.metrics-table tbody tr:nth-child(even) {
476
+ background-color: #fafbfc;
477
+ }
478
+
479
+ table.metrics-table tbody tr:hover {
480
+ background-color: #f1f8ff;
481
+ }
482
+
483
+ table.metrics-table a {
484
+ color: #0366d6 !important;
485
+ text-decoration: none;
486
+ font-weight: 500;
487
+ }
488
+
489
+ table.metrics-table a:hover {
490
+ text-decoration: underline;
491
  }
492
  """
493