Commit
Β·
34e00a7
1
Parent(s):
1cd87bb
updated theme and header
Browse files
app.py
CHANGED
|
@@ -1407,7 +1407,99 @@ def _create_gradio_lite_html(python_code: str) -> str:
|
|
| 1407 |
"""
|
| 1408 |
return html_template
|
| 1409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1411 |
# endregion
|
| 1412 |
|
| 1413 |
# region MAIN LAYOUT DEFINITION
|
|
@@ -1432,11 +1524,66 @@ css = """
|
|
| 1432 |
.min-h-50px { min-height: 50px; }
|
| 1433 |
"""
|
| 1434 |
generated_theme_state = None # Setting global instead gr.State()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1435 |
|
| 1436 |
-
with gr.Blocks(theme=
|
| 1437 |
css_data_transport = gr.Textbox(visible=False)
|
| 1438 |
|
| 1439 |
-
gr.
|
| 1440 |
|
| 1441 |
# GLOBAL CONFIGURATION
|
| 1442 |
with gr.Accordion("βοΈ Global Configuration (Configure tools here)", open=True):
|
|
|
|
| 1407 |
"""
|
| 1408 |
return html_template
|
| 1409 |
|
| 1410 |
+
def _get_mcp_header():
|
| 1411 |
+
html = """
|
| 1412 |
+
<style>
|
| 1413 |
+
.header-container {
|
| 1414 |
+
background: linear-gradient(314deg, #64748b 0%, #373f4a 100%);
|
| 1415 |
+
padding: 30px 20px;
|
| 1416 |
+
border-radius: 16px;
|
| 1417 |
+
color: white !important;
|
| 1418 |
+
text-align: center;
|
| 1419 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 1420 |
+
margin-bottom: 25px;
|
| 1421 |
+
font-family: 'Inter', -apple-system, sans-serif;
|
| 1422 |
+
}
|
| 1423 |
+
|
| 1424 |
+
.header-content {
|
| 1425 |
+
max-width: 800px;
|
| 1426 |
+
margin: 0 auto;
|
| 1427 |
+
}
|
| 1428 |
+
|
| 1429 |
+
.header-title {
|
| 1430 |
+
color: white !important;
|
| 1431 |
+
font-size: 2.5rem;
|
| 1432 |
+
font-weight: 800;
|
| 1433 |
+
margin: 0;
|
| 1434 |
+
display: flex;
|
| 1435 |
+
align-items: center;
|
| 1436 |
+
justify-content: center;
|
| 1437 |
+
gap: 15px;
|
| 1438 |
+
letter-spacing: -0.02em;
|
| 1439 |
+
text-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 1440 |
+
}
|
| 1441 |
+
|
| 1442 |
+
.header-icon {
|
| 1443 |
+
font-size: 3rem;
|
| 1444 |
+
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
|
| 1445 |
+
}
|
| 1446 |
|
| 1447 |
+
.header-subtitle {
|
| 1448 |
+
color: #e2e8f0 !important; /* Fallback para var(--neutral-200) */
|
| 1449 |
+
font-size: 1.1rem;
|
| 1450 |
+
font-weight: 400;
|
| 1451 |
+
margin-top: 8px;
|
| 1452 |
+
opacity: 0.9;
|
| 1453 |
+
letter-spacing: 0.01em;
|
| 1454 |
+
}
|
| 1455 |
+
|
| 1456 |
+
.header-footer {
|
| 1457 |
+
color: #e2e8f0 !important;
|
| 1458 |
+
margin-top: 25px;
|
| 1459 |
+
padding-top: 15px;
|
| 1460 |
+
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
| 1461 |
+
font-size: 0.85rem;
|
| 1462 |
+
font-weight: 500;
|
| 1463 |
+
opacity: 0.85;
|
| 1464 |
+
display: flex;
|
| 1465 |
+
justify-content: center;
|
| 1466 |
+
flex-wrap: wrap;
|
| 1467 |
+
gap: 15px;
|
| 1468 |
+
}
|
| 1469 |
+
|
| 1470 |
+
.header-tag {
|
| 1471 |
+
color: #e2e8f0 !important;
|
| 1472 |
+
display: flex;
|
| 1473 |
+
align-items: center;
|
| 1474 |
+
gap: 6px;
|
| 1475 |
+
}
|
| 1476 |
+
|
| 1477 |
+
.separator {
|
| 1478 |
+
color: #e2e8f0 !important;
|
| 1479 |
+
opacity: 0.4;
|
| 1480 |
+
}
|
| 1481 |
+
</style>
|
| 1482 |
+
|
| 1483 |
+
<div class="header-container">
|
| 1484 |
+
<div class="header-content">
|
| 1485 |
+
<div class="header-title">
|
| 1486 |
+
<span class="header-icon">π΅οΈββοΈ</span> GitRepo Inspector
|
| 1487 |
+
</div>
|
| 1488 |
+
<div class="header-subtitle">
|
| 1489 |
+
MCP Server: AI Tools for GitHub Analysis & Automation
|
| 1490 |
+
</div>
|
| 1491 |
+
|
| 1492 |
+
<div class="header-footer">
|
| 1493 |
+
<span class="header-tag">Powered by Gradio π</span>
|
| 1494 |
+
<span class="separator">|</span>
|
| 1495 |
+
<span class="header-tag">Official MCP Protocol π</span>
|
| 1496 |
+
<span class="separator">|</span>
|
| 1497 |
+
<span class="header-tag">Gemini β’ SambaNova β’ OpenAI β’ Nebius</span>
|
| 1498 |
+
</div>
|
| 1499 |
+
</div>
|
| 1500 |
+
</div>
|
| 1501 |
+
"""
|
| 1502 |
+
return html
|
| 1503 |
# endregion
|
| 1504 |
|
| 1505 |
# region MAIN LAYOUT DEFINITION
|
|
|
|
| 1524 |
.min-h-50px { min-height: 50px; }
|
| 1525 |
"""
|
| 1526 |
generated_theme_state = None # Setting global instead gr.State()
|
| 1527 |
+
theme = gr.themes.Default(
|
| 1528 |
+
primary_hue='blue',
|
| 1529 |
+
secondary_hue='teal',
|
| 1530 |
+
neutral_hue='neutral'
|
| 1531 |
+
).set(
|
| 1532 |
+
body_background_fill='*neutral_100',
|
| 1533 |
+
body_background_fill_dark='*neutral_900',
|
| 1534 |
+
body_text_color='*neutral_700',
|
| 1535 |
+
body_text_color_dark='*neutral_200',
|
| 1536 |
+
body_text_weight='400',
|
| 1537 |
+
link_text_color='*primary_500',
|
| 1538 |
+
link_text_color_dark='*primary_400',
|
| 1539 |
+
code_background_fill='*neutral_100',
|
| 1540 |
+
code_background_fill_dark='*neutral_800',
|
| 1541 |
+
shadow_drop='0 1px 3px rgba(0,0,0,0.1)',
|
| 1542 |
+
shadow_inset='inset 0 2px 4px rgba(0,0,0,0.05)',
|
| 1543 |
+
block_background_fill='*neutral_50',
|
| 1544 |
+
block_background_fill_dark='*neutral_700',
|
| 1545 |
+
block_border_color='*neutral_200',
|
| 1546 |
+
block_border_color_dark='*neutral_600',
|
| 1547 |
+
block_border_width='1px',
|
| 1548 |
+
block_border_width_dark='1px',
|
| 1549 |
+
block_label_background_fill='*primary_50',
|
| 1550 |
+
block_label_background_fill_dark='*primary_600',
|
| 1551 |
+
block_label_text_color='*primary_600',
|
| 1552 |
+
block_label_text_color_dark='*primary_50',
|
| 1553 |
+
panel_background_fill='white',
|
| 1554 |
+
panel_background_fill_dark='*neutral_800',
|
| 1555 |
+
panel_border_color='*neutral_200',
|
| 1556 |
+
panel_border_color_dark='*neutral_700',
|
| 1557 |
+
panel_border_width='1px',
|
| 1558 |
+
panel_border_width_dark='1px',
|
| 1559 |
+
input_background_fill='white',
|
| 1560 |
+
input_background_fill_dark='*neutral_800',
|
| 1561 |
+
input_border_color='*neutral_300',
|
| 1562 |
+
input_border_color_dark='*neutral_700',
|
| 1563 |
+
slider_color='*primary_500',
|
| 1564 |
+
slider_color_dark='*primary_400',
|
| 1565 |
+
button_primary_background_fill='*primary_600',
|
| 1566 |
+
button_primary_background_fill_dark='*primary_500',
|
| 1567 |
+
button_primary_background_fill_hover='*primary_700',
|
| 1568 |
+
button_primary_background_fill_hover_dark='*primary_400',
|
| 1569 |
+
button_primary_border_color='transparent',
|
| 1570 |
+
button_primary_border_color_dark='transparent',
|
| 1571 |
+
button_primary_text_color='white',
|
| 1572 |
+
button_primary_text_color_dark='white',
|
| 1573 |
+
button_secondary_background_fill='*neutral_200',
|
| 1574 |
+
button_secondary_background_fill_dark='*neutral_600',
|
| 1575 |
+
button_secondary_background_fill_hover='*neutral_300',
|
| 1576 |
+
button_secondary_background_fill_hover_dark='*neutral_500',
|
| 1577 |
+
button_secondary_border_color='transparent',
|
| 1578 |
+
button_secondary_border_color_dark='transparent',
|
| 1579 |
+
button_secondary_text_color='*neutral_700',
|
| 1580 |
+
button_secondary_text_color_dark='*neutral_200'
|
| 1581 |
+
)
|
| 1582 |
|
| 1583 |
+
with gr.Blocks(theme=theme, css=css, head=THEME_JS, title="GitRepo Inspector (MCP Server)") as app:
|
| 1584 |
css_data_transport = gr.Textbox(visible=False)
|
| 1585 |
|
| 1586 |
+
gr.HTML(_get_mcp_header())
|
| 1587 |
|
| 1588 |
# GLOBAL CONFIGURATION
|
| 1589 |
with gr.Accordion("βοΈ Global Configuration (Configure tools here)", open=True):
|