122 lines
5.5 KiB
PHP
122 lines
5.5 KiB
PHP
<?php
|
|
/** AUTO-GENERATED WRAPPER — YT Upload Test */
|
|
$GLOBALS["no_auth_check_wrapper"] = false; // Keep auth
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html data-theme="dark" lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>YT Upload Test — ADX Arsenal</title>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
|
<style>
|
|
*{margin:0;padding:0;box-sizing:border-box}
|
|
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0a0e1a;color:#e0e6f0;min-height:100vh;padding:20px}
|
|
.header{background:linear-gradient(135deg,#ef4444,#dc2626);border-radius:16px;padding:24px 32px;margin-bottom:24px;display:flex;align-items:center;gap:16px}
|
|
.header i{font-size:2rem;opacity:0.9}
|
|
.header h1{font-size:1.5rem;font-weight:600}
|
|
.header .badge{background:rgba(255,255,255,0.15);padding:4px 12px;border-radius:20px;font-size:0.75rem;margin-left:auto}
|
|
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px;margin-bottom:24px}
|
|
.card{background:#111827;border:1px solid #1e293b;border-radius:12px;padding:20px;transition:border-color 0.2s}
|
|
.card:hover{border-color:#3b82f6}
|
|
.card h3{font-size:0.9rem;color:#94a3b8;margin-bottom:12px;display:flex;align-items:center;gap:8px}
|
|
.card h3 i{color:#ef4444}
|
|
.kpi{font-size:2rem;font-weight:700;color:#f8fafc}
|
|
.kpi-label{font-size:0.8rem;color:#64748b;margin-top:4px}
|
|
.panel{background:#111827;border:1px solid #1e293b;border-radius:12px;padding:24px;margin-bottom:20px}
|
|
.panel h2{font-size:1.1rem;margin-bottom:16px;display:flex;align-items:center;gap:8px}
|
|
.panel h2 i{color:#ef4444}
|
|
pre.response{background:#0d1117;border:1px solid #1e293b;border-radius:8px;padding:16px;overflow-x:auto;font-size:0.8rem;max-height:400px;overflow-y:auto;color:#7dd3fc;line-height:1.6}
|
|
.btn{background:#ef4444;color:#fff;border:none;padding:8px 20px;border-radius:8px;cursor:pointer;font-size:0.85rem;transition:opacity 0.2s}
|
|
.btn:hover{opacity:0.85}
|
|
.btn-row{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
|
|
.status{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}
|
|
.status.on{background:#22c55e}
|
|
.status.off{background:#ef4444}
|
|
.status.warn{background:#f59e0b}
|
|
.info-table{width:100%;border-collapse:collapse}
|
|
.info-table td{padding:8px 12px;border-bottom:1px solid #1e293b;font-size:0.85rem}
|
|
.info-table td:first-child{color:#94a3b8;width:140px}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<i class="fas fa-youtube"></i>
|
|
<div><h1>YT Upload Test</h1><small style="color:rgba(255,255,255,0.7)">Test upload YouTube</small></div>
|
|
<span class="badge">Test</span>
|
|
</div>
|
|
|
|
<div class="grid">
|
|
<div class="card">
|
|
<h3><i class="fas fa-circle-info"></i> Informations</h3>
|
|
<table class="info-table">
|
|
<tr><td>Fichier</td><td><code>yt-upload-test.php</code></td></tr>
|
|
<tr><td>Type</td><td>Test</td></tr>
|
|
<tr><td>Taille</td><td id="file-size">—</td></tr>
|
|
<tr><td>Status</td><td><span class="status on"></span> <span id="status-text">Actif</span></td></tr>
|
|
</table>
|
|
</div>
|
|
<div class="card">
|
|
<h3><i class="fas fa-bolt"></i> Quick Test</h3>
|
|
<div class="kpi" id="kpi-main">—</div>
|
|
<div class="kpi-label" id="kpi-label">Chargement...</div>
|
|
<div style="margin-top:12px">
|
|
<button class="btn" onclick="testEndpoint()"><i class="fas fa-play"></i> Tester</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<h2><i class="fas fa-terminal"></i> Réponse Live</h2>
|
|
<div class="btn-row">
|
|
<button class="btn" onclick="testEndpoint()"><i class="fas fa-play"></i> Test Default</button>
|
|
</div>
|
|
<pre class="response" id="response">Cliquez sur "Tester" pour voir la réponse...</pre>
|
|
</div>
|
|
|
|
<script>
|
|
const FILE = "yt-upload-test.php";
|
|
const ENDPOINT = "/yt-upload-test-raw.php";
|
|
let lastResponse = null;
|
|
|
|
async function testEndpoint(params="") {
|
|
const el = document.getElementById("response");
|
|
const kpi = document.getElementById("kpi-main");
|
|
const label = document.getElementById("kpi-label");
|
|
el.textContent = "⏳ Chargement...";
|
|
|
|
try {
|
|
const url = ENDPOINT + (params ? (ENDPOINT.includes("?") ? "&" : "?") + params : "");
|
|
const r = await fetch(url);
|
|
const text = await r.text();
|
|
lastResponse = text;
|
|
|
|
try {
|
|
const json = JSON.parse(text);
|
|
el.textContent = JSON.stringify(json, null, 2);
|
|
|
|
// Auto-detect KPIs
|
|
if (json.total !== undefined) { kpi.textContent = json.total.toLocaleString(); label.textContent = "Total records"; }
|
|
else if (json.data && json.data.total !== undefined) { kpi.textContent = json.data.total.toLocaleString(); label.textContent = "Total records"; }
|
|
else if (json.status) { kpi.textContent = json.status; label.textContent = "Status"; }
|
|
else if (json.ok !== undefined) { kpi.textContent = json.ok ? "✅ OK" : "❌ Error"; label.textContent = "Health"; }
|
|
else { kpi.textContent = r.status; label.textContent = "HTTP " + r.status; }
|
|
} catch(e) {
|
|
el.textContent = text || "(empty response)";
|
|
kpi.textContent = r.status;
|
|
label.textContent = text.length + " bytes";
|
|
}
|
|
|
|
document.getElementById("file-size").textContent = text.length + " bytes";
|
|
document.getElementById("status-text").textContent = r.status === 200 ? "Actif" : "HTTP " + r.status;
|
|
} catch(err) {
|
|
el.textContent = "❌ Error: " + err.message;
|
|
kpi.textContent = "❌";
|
|
label.textContent = err.message;
|
|
}
|
|
}
|
|
|
|
// Auto-test on load
|
|
testEndpoint();
|
|
</script>
|
|
</body></html>
|