API Status Check";
echo "
Logged in as: " . htmlspecialchars($user['name']) . " (" . htmlspecialchars($user['email']) . ")
";
// Check if Python API is responding
$ch = curl_init(PYTHON_API_URL . '/health');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
echo "";
if ($httpCode === 200) {
echo "
✓ Python API is RUNNING
";
echo "
URL: " . PYTHON_API_URL . "
";
echo "
Response: " . htmlspecialchars($response) . "
";
} else {
echo "
✗ Python API is NOT RUNNING
";
echo "
URL: " . PYTHON_API_URL . "
";
echo "
HTTP Code: " . $httpCode . "
";
echo "
Error: " . htmlspecialchars($error) . "
";
echo "
";
echo "
";
echo "To start the API:
";
echo "1. Open Terminal
";
echo "2. Navigate to: " . __DIR__ . "
";
echo "3. Run: ./start_api.sh
";
echo "
";
}
echo "
";
// Check outputs directory
echo "Outputs Directory
";
$outputDir = __DIR__ . '/outputs/';
if (is_dir($outputDir)) {
$files = array_diff(scandir($outputDir), ['.', '..', '.DS_Store']);
echo "";
echo "Directory: " . $outputDir . "
";
echo "Files: " . count($files) . "
";
if (count($files) > 0) {
echo "
";
foreach ($files as $file) {
$size = filesize($outputDir . $file);
echo "- " . htmlspecialchars($file) . " (" . number_format($size) . " bytes)
";
}
echo "
";
} else {
echo "
No files in outputs directory";
}
echo "
";
} else {
echo "Outputs directory does not exist!
";
}
?>