Update app.py
Browse files
app.py
CHANGED
|
@@ -395,13 +395,13 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 395 |
|
| 396 |
/* Header styles */
|
| 397 |
.header {
|
| 398 |
-
background: linear-gradient(135deg, #
|
| 399 |
color: white;
|
| 400 |
padding: 2rem;
|
| 401 |
border-radius: 0.5rem;
|
| 402 |
margin-bottom: 2rem;
|
| 403 |
text-align: center;
|
| 404 |
-
border: 1px solid #
|
| 405 |
}
|
| 406 |
.header h1 {
|
| 407 |
margin: 0;
|
|
@@ -443,28 +443,6 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 443 |
color: #e5e5e5 !important;
|
| 444 |
}
|
| 445 |
|
| 446 |
-
/* Blue background for specific blocks */
|
| 447 |
-
.blue-header-block {
|
| 448 |
-
background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
|
| 449 |
-
border: 1px solid #1e40af !important;
|
| 450 |
-
border-radius: 0.5rem !important;
|
| 451 |
-
padding: 1rem !important;
|
| 452 |
-
}
|
| 453 |
-
|
| 454 |
-
.blue-header-block .gr-label {
|
| 455 |
-
color: #ffffff !important;
|
| 456 |
-
font-weight: 600 !important;
|
| 457 |
-
}
|
| 458 |
-
|
| 459 |
-
.blue-header-block .gr-textbox,
|
| 460 |
-
.blue-header-block .gr-markdown,
|
| 461 |
-
.blue-header-block .gr-code {
|
| 462 |
-
background-color: #2d2d2d !important;
|
| 463 |
-
border: 1px solid #404040 !important;
|
| 464 |
-
border-radius: 0.375rem !important;
|
| 465 |
-
margin-top: 0.5rem !important;
|
| 466 |
-
}
|
| 467 |
-
|
| 468 |
/* Input field styles */
|
| 469 |
.gr-textbox input,
|
| 470 |
.gr-textbox textarea,
|
|
@@ -549,9 +527,9 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 549 |
}
|
| 550 |
""") as demo:
|
| 551 |
|
| 552 |
-
# Header
|
| 553 |
gr.HTML("""
|
| 554 |
-
<div class="header
|
| 555 |
<h1>Kwekel Companies Contact Search Tool</h1>
|
| 556 |
</div>
|
| 557 |
""")
|
|
@@ -562,7 +540,7 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 562 |
<h3>Instructions:</h3>
|
| 563 |
<ol>
|
| 564 |
<li>Enter the website URL you want to search for contacts</li>
|
| 565 |
-
<li>Click "Search Contacts"
|
| 566 |
<li>View formatted results and raw JSON response</li>
|
| 567 |
</ol>
|
| 568 |
<p><strong>API Endpoint:</strong> {API_ENDPOINT}</p>
|
|
@@ -572,14 +550,12 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 572 |
|
| 573 |
with gr.Row():
|
| 574 |
with gr.Column(scale=2):
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
lines=1
|
| 582 |
-
)
|
| 583 |
|
| 584 |
with gr.Row():
|
| 585 |
search_btn = gr.Button("Search Contacts", variant="primary", scale=2)
|
|
@@ -593,13 +569,11 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 593 |
)
|
| 594 |
|
| 595 |
with gr.Column(scale=1):
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
value=""
|
| 602 |
-
)
|
| 603 |
|
| 604 |
# Event handlers
|
| 605 |
search_btn.click(
|
|
@@ -608,13 +582,6 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
|
|
| 608 |
outputs=[results_output, json_output]
|
| 609 |
)
|
| 610 |
|
| 611 |
-
# Add Enter key functionality to URL input
|
| 612 |
-
url_input.submit(
|
| 613 |
-
fn=search_contacts,
|
| 614 |
-
inputs=[url_input],
|
| 615 |
-
outputs=[results_output, json_output]
|
| 616 |
-
)
|
| 617 |
-
|
| 618 |
clear_btn.click(
|
| 619 |
fn=lambda: ("", ""),
|
| 620 |
outputs=[url_input, results_output]
|
|
@@ -635,4 +602,4 @@ if __name__ == "__main__":
|
|
| 635 |
server_port=7860,
|
| 636 |
show_error=True,
|
| 637 |
debug=True
|
| 638 |
-
)
|
|
|
|
| 395 |
|
| 396 |
/* Header styles */
|
| 397 |
.header {
|
| 398 |
+
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
|
| 399 |
color: white;
|
| 400 |
padding: 2rem;
|
| 401 |
border-radius: 0.5rem;
|
| 402 |
margin-bottom: 2rem;
|
| 403 |
text-align: center;
|
| 404 |
+
border: 1px solid #404040;
|
| 405 |
}
|
| 406 |
.header h1 {
|
| 407 |
margin: 0;
|
|
|
|
| 443 |
color: #e5e5e5 !important;
|
| 444 |
}
|
| 445 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 446 |
/* Input field styles */
|
| 447 |
.gr-textbox input,
|
| 448 |
.gr-textbox textarea,
|
|
|
|
| 527 |
}
|
| 528 |
""") as demo:
|
| 529 |
|
| 530 |
+
# Header
|
| 531 |
gr.HTML("""
|
| 532 |
+
<div class="header">
|
| 533 |
<h1>Kwekel Companies Contact Search Tool</h1>
|
| 534 |
</div>
|
| 535 |
""")
|
|
|
|
| 540 |
<h3>Instructions:</h3>
|
| 541 |
<ol>
|
| 542 |
<li>Enter the website URL you want to search for contacts</li>
|
| 543 |
+
<li>Click "Search Contacts" to get results</li>
|
| 544 |
<li>View formatted results and raw JSON response</li>
|
| 545 |
</ol>
|
| 546 |
<p><strong>API Endpoint:</strong> {API_ENDPOINT}</p>
|
|
|
|
| 550 |
|
| 551 |
with gr.Row():
|
| 552 |
with gr.Column(scale=2):
|
| 553 |
+
url_input = gr.Textbox(
|
| 554 |
+
label="Website URL",
|
| 555 |
+
placeholder="example.com or https://example.com",
|
| 556 |
+
info="Enter the website URL to search for contacts",
|
| 557 |
+
lines=1
|
| 558 |
+
)
|
|
|
|
|
|
|
| 559 |
|
| 560 |
with gr.Row():
|
| 561 |
search_btn = gr.Button("Search Contacts", variant="primary", scale=2)
|
|
|
|
| 569 |
)
|
| 570 |
|
| 571 |
with gr.Column(scale=1):
|
| 572 |
+
json_output = gr.Code(
|
| 573 |
+
label="Raw JSON Response",
|
| 574 |
+
language="json",
|
| 575 |
+
value=""
|
| 576 |
+
)
|
|
|
|
|
|
|
| 577 |
|
| 578 |
# Event handlers
|
| 579 |
search_btn.click(
|
|
|
|
| 582 |
outputs=[results_output, json_output]
|
| 583 |
)
|
| 584 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 585 |
clear_btn.click(
|
| 586 |
fn=lambda: ("", ""),
|
| 587 |
outputs=[url_input, results_output]
|
|
|
|
| 602 |
server_port=7860,
|
| 603 |
show_error=True,
|
| 604 |
debug=True
|
| 605 |
+
)
|