updated code UI ✅✅
Browse files- mediSync/app.py +3 -14
mediSync/app.py
CHANGED
|
@@ -535,23 +535,12 @@ def create_interface():
|
|
| 535 |
)
|
| 536 |
|
| 537 |
with gr.Row():
|
| 538 |
-
# --- Appointment ID auto-population logic
|
| 539 |
-
import urllib.parse
|
| 540 |
-
try:
|
| 541 |
-
url_params = {}
|
| 542 |
-
if hasattr(gr, 'get_current_url'):
|
| 543 |
-
current_url = gr.get_current_url()
|
| 544 |
-
if current_url:
|
| 545 |
-
parsed = urllib.parse.urlparse(current_url)
|
| 546 |
-
url_params = urllib.parse.parse_qs(parsed.query)
|
| 547 |
-
default_appointment_id = url_params.get('appointment_id', [''])[0]
|
| 548 |
-
except Exception:
|
| 549 |
-
default_appointment_id = ""
|
| 550 |
appointment_id_input = gr.Textbox(
|
| 551 |
label="Appointment ID",
|
| 552 |
placeholder="Enter your appointment ID here...",
|
| 553 |
info="This will be automatically populated if you came from the doctors page",
|
| 554 |
-
value=
|
| 555 |
elem_id="appointment_id_input"
|
| 556 |
)
|
| 557 |
|
|
@@ -740,7 +729,7 @@ def create_interface():
|
|
| 740 |
outputs=[end_consultation_status]
|
| 741 |
)
|
| 742 |
|
| 743 |
-
# ---
|
| 744 |
# This script will robustly set the value of the Gradio textbox, even in Gradio 4.x shadow DOM.
|
| 745 |
gr.HTML("""
|
| 746 |
<script>
|
|
|
|
| 535 |
)
|
| 536 |
|
| 537 |
with gr.Row():
|
| 538 |
+
# --- Appointment ID auto-population logic: always leave value blank, use JS to set value after render ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
appointment_id_input = gr.Textbox(
|
| 540 |
label="Appointment ID",
|
| 541 |
placeholder="Enter your appointment ID here...",
|
| 542 |
info="This will be automatically populated if you came from the doctors page",
|
| 543 |
+
value="", # Always blank, let JS set value after render
|
| 544 |
elem_id="appointment_id_input"
|
| 545 |
)
|
| 546 |
|
|
|
|
| 729 |
outputs=[end_consultation_status]
|
| 730 |
)
|
| 731 |
|
| 732 |
+
# --- Improved JavaScript for appointment ID auto-population ---
|
| 733 |
# This script will robustly set the value of the Gradio textbox, even in Gradio 4.x shadow DOM.
|
| 734 |
gr.HTML("""
|
| 735 |
<script>
|