New monitors

This commit is contained in:
2025-10-06 00:52:44 -04:00
parent 68f0912843
commit 6806bf5b69
9 changed files with 396 additions and 778 deletions

View File

@@ -53,10 +53,26 @@ if ($http_status == 200) {
// Set the content type of the response to JSON
header('Content-Type: application/json');
// Log debug information
error_log("UptimeKuma API Response Status: $http_status");
error_log("Parsed monitors count: " . count($data));
// Output the data in JSON format
echo json_encode($data, JSON_PRETTY_PRINT);
} else {
// Log the error
error_log("UptimeKuma API Error: HTTP Status Code: $http_status");
error_log("Response: " . substr($response, 0, 500));
// Set the content type of the response to JSON
header('Content-Type: application/json');
// Output an error message if the request was not successful
echo "Failed to fetch data. HTTP Status Code: $http_status";
echo json_encode([
'error' => true,
'message' => "Failed to fetch data. HTTP Status Code: $http_status",
'data' => []
], JSON_PRETTY_PRINT);
}
?>