Spaces:
Sleeping
Sleeping
Update petgrid.py
Browse files- petgrid.py +16 -2
petgrid.py
CHANGED
|
@@ -1,6 +1,20 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def render(online):
|
| 4 |
with gr.Column():
|
| 5 |
-
gr.Markdown("###
|
| 6 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import ethics_audit
|
| 3 |
+
|
| 4 |
+
pet_reports = []
|
| 5 |
+
|
| 6 |
+
def submit_pet(pet_type, name, desc, location):
|
| 7 |
+
pet_reports.append({"Type": pet_type, "Name": name, "Description": desc, "Location": location})
|
| 8 |
+
ethics_audit.log_event(f"New pet report submitted: {name}")
|
| 9 |
+
return "Report submitted successfully."
|
| 10 |
|
| 11 |
def render(online):
|
| 12 |
with gr.Column():
|
| 13 |
+
gr.Markdown("### Report Lost/Found Pet")
|
| 14 |
+
pet_type = gr.Radio(["Lost", "Found"], label="Type")
|
| 15 |
+
name = gr.Textbox(label="Pet Name")
|
| 16 |
+
desc = gr.Textbox(label="Description")
|
| 17 |
+
location = gr.Textbox(label="Location Last Seen")
|
| 18 |
+
out = gr.Textbox(interactive=False)
|
| 19 |
+
btn = gr.Button("Submit Report")
|
| 20 |
+
btn.click(submit_pet, inputs=[pet_type, name, desc, location], outputs=out)
|