- Display VTT/SRT content in formatted pre blocks on page - Improved download button styling with better visibility - Added content truncation for large files (10k char limit) - Downloads now open in new tab for better UX - Fixed session_start() duplicate warnings - Added console logging for debugging - Created check_api.php for API status monitoring - Enhanced error messages with specific HTTP status codes - API now returns full content for all formats - Both original and translated files display inline 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
2.2 KiB
PHP
64 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* Quick API status checker
|
|
*/
|
|
require_once 'config.php';
|
|
|
|
echo "<h2>API Status Check</h2>";
|
|
|
|
// 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 "<div style='font-family: monospace; padding: 20px; background: #f5f5f5; border-radius: 8px;'>";
|
|
|
|
if ($httpCode === 200) {
|
|
echo "<div style='color: green; font-size: 18px; font-weight: bold;'>✓ Python API is RUNNING</div>";
|
|
echo "<div>URL: " . PYTHON_API_URL . "</div>";
|
|
echo "<div>Response: " . htmlspecialchars($response) . "</div>";
|
|
} else {
|
|
echo "<div style='color: red; font-size: 18px; font-weight: bold;'>✗ Python API is NOT RUNNING</div>";
|
|
echo "<div>URL: " . PYTHON_API_URL . "</div>";
|
|
echo "<div>HTTP Code: " . $httpCode . "</div>";
|
|
echo "<div>Error: " . htmlspecialchars($error) . "</div>";
|
|
echo "<br>";
|
|
echo "<div style='background: #fff3cd; padding: 10px; border-left: 4px solid #ffc107;'>";
|
|
echo "<strong>To start the API:</strong><br>";
|
|
echo "1. Open Terminal<br>";
|
|
echo "2. Navigate to: " . __DIR__ . "<br>";
|
|
echo "3. Run: <code>./start_api.sh</code><br>";
|
|
echo "</div>";
|
|
}
|
|
|
|
echo "</div>";
|
|
|
|
// Check outputs directory
|
|
echo "<h2>Outputs Directory</h2>";
|
|
$outputDir = __DIR__ . '/outputs/';
|
|
if (is_dir($outputDir)) {
|
|
$files = array_diff(scandir($outputDir), ['.', '..', '.DS_Store']);
|
|
echo "<div style='font-family: monospace; padding: 20px; background: #f5f5f5; border-radius: 8px;'>";
|
|
echo "Directory: " . $outputDir . "<br>";
|
|
echo "Files: " . count($files) . "<br><br>";
|
|
|
|
if (count($files) > 0) {
|
|
echo "<ul>";
|
|
foreach ($files as $file) {
|
|
$size = filesize($outputDir . $file);
|
|
echo "<li>" . htmlspecialchars($file) . " (" . number_format($size) . " bytes)</li>";
|
|
}
|
|
echo "</ul>";
|
|
} else {
|
|
echo "<em>No files in outputs directory</em>";
|
|
}
|
|
echo "</div>";
|
|
} else {
|
|
echo "<div style='color: red;'>Outputs directory does not exist!</div>";
|
|
}
|
|
?>
|