Spaces:
Sleeping
Sleeping
neerajkalyank
commited on
Commit
•
c88ed1d
1
Parent(s):
6c55cc0
Update app.py
Browse files
app.py
CHANGED
@@ -102,19 +102,21 @@ with gr.Blocks() as app:
|
|
102 |
|
103 |
register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
|
104 |
|
105 |
-
|
106 |
gr.HTML("""
|
107 |
-
<
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
118 |
""")
|
119 |
|
120 |
with gr.Tab("Tests"):
|
|
|
102 |
|
103 |
register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
|
104 |
|
105 |
+
# Custom HTML for Copy ID Button
|
106 |
gr.HTML("""
|
107 |
+
<div style="margin-top: 10px;">
|
108 |
+
<button onclick="copyPatientID()" style="background-color: #3b74f2; color: white; padding: 10px; border-radius: 5px; border: none; cursor: pointer;">Copy Patient ID</button>
|
109 |
+
<script>
|
110 |
+
function copyPatientID() {
|
111 |
+
const patientID = document.querySelector('[aria-label="hidden_patient_id"] textarea').value;
|
112 |
+
navigator.clipboard.writeText(patientID).then(() => {
|
113 |
+
alert('Patient ID copied to clipboard');
|
114 |
+
}).catch(err => {
|
115 |
+
alert('Failed to copy Patient ID');
|
116 |
+
});
|
117 |
+
}
|
118 |
+
</script>
|
119 |
+
</div>
|
120 |
""")
|
121 |
|
122 |
with gr.Tab("Tests"):
|