Spaces:
Sleeping
Sleeping
Update checks/failed_check.py
Browse files- checks/failed_check.py +19 -16
checks/failed_check.py
CHANGED
|
@@ -33,21 +33,24 @@ def check_app_status():
|
|
| 33 |
def get_status():
|
| 34 |
return check_app_status()
|
| 35 |
|
| 36 |
-
|
| 37 |
# Create the Gradio interface
|
| 38 |
-
def create_failed_gradio_ui():
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
|
|
|
| 33 |
def get_status():
|
| 34 |
return check_app_status()
|
| 35 |
|
|
|
|
| 36 |
# Create the Gradio interface
|
| 37 |
+
def create_failed_gradio_ui(status_info):
|
| 38 |
+
with gr.Blocks() as interface:
|
| 39 |
+
gr.Markdown(f"## Status Code: {status_info['status_code']}")
|
| 40 |
+
gr.Markdown(f"## Message: {status_info['message']}")
|
| 41 |
+
gr.JSON(status_info["response_data"], label="Response Data")
|
| 42 |
+
#return interface
|
| 43 |
+
# Launch the UI
|
| 44 |
+
interface.launch(show_error=True)
|
| 45 |
+
|
| 46 |
+
# Function to check the public endpoint and return the status information
|
| 47 |
+
def check_public_endpoint(endpoint_uri):
|
| 48 |
+
# Simulate the response from the public endpoint
|
| 49 |
+
status_info = {
|
| 50 |
+
"status": False,
|
| 51 |
+
"status_code": 404,
|
| 52 |
+
"response_data": {"error": "Not Found"},
|
| 53 |
+
"message": "The requested resource was not found."
|
| 54 |
+
}
|
| 55 |
+
return status_info
|
| 56 |
|