35 lines
1.5 KiB
PHP
35 lines
1.5 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
|
|
// Check V15 screenshots exist
|
|
$out["v15_screenshots"] = array_map("basename", glob("/var/www/html/api/ambre-pw-tests/output/v15-*.png"));
|
|
$out["v14_screenshots"] = count(glob("/var/www/html/api/ambre-pw-tests/output/v14-*.png"));
|
|
|
|
// Latest log
|
|
$logs = glob("/tmp/ambre-pw-run-*.log");
|
|
usort($logs, function($a,$b){return filemtime($b)-filemtime($a);});
|
|
$out["latest_log"] = $logs ? basename($logs[0]) : null;
|
|
$out["latest_log_size"] = $logs ? filesize($logs[0]) : 0;
|
|
$out["latest_log_tail"] = $logs ? @shell_exec("tail -50 " . escapeshellarg($logs[0])) : "";
|
|
|
|
// Check deps installed
|
|
$out["deps"] = [
|
|
"tesseract" => trim(@shell_exec("which tesseract 2>/dev/null") ?: "MISSING"),
|
|
"rembg" => trim(@shell_exec("which rembg 2>/dev/null") ?: "MISSING"),
|
|
"youtube_transcript_api" => trim(@shell_exec("python3 -c "import youtube_transcript_api; print(youtube_transcript_api.__version__)" 2>&1") ?: "MISSING"),
|
|
];
|
|
|
|
// Fix catch handlers verified in wevia.html
|
|
$wevia = file_get_contents("/var/www/html/wevia.html");
|
|
$out["wevia_size"] = strlen($wevia);
|
|
$out["wevia_catch_fixes"] = substr_count($wevia, "Service temporairement indisponible");
|
|
$out["wevia_routers"] = [
|
|
"V2" => substr_count($wevia, "AMBRE-V2-GEN-ROUTER"),
|
|
"V5" => substr_count($wevia, "AMBRE-V5-MEMORY"),
|
|
"V6" => substr_count($wevia, "AMBRE-V6-TOOLS"),
|
|
"V7" => substr_count($wevia, "AMBRE-V7-PREMIUM-TOOLS"),
|
|
];
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|