Fügt Unterstützung für die neue nuscore API hinzu. Aktualisiert die Backend-Routen zur Verarbeitung von Anfragen an die nuscore API und integriert die neuen Dialogkomponenten im Frontend. Ermöglicht das Erstellen lokaler Kopien von nuscore-Daten und verbessert die Benutzeroberfläche durch neue Schaltflächen und Dialoge. Entfernt veraltete Konsolenausgaben und optimiert die Logik zur PIN-Verwaltung.
This commit is contained in:
78
test-proxy.html
Normal file
78
test-proxy.html
Normal file
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>nuscore Proxy Test</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||
.test-section { margin: 20px 0; padding: 20px; border: 1px solid #ccc; border-radius: 8px; }
|
||||
button { padding: 10px 20px; margin: 5px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; }
|
||||
button:hover { background: #0056b3; }
|
||||
iframe { width: 100%; height: 600px; border: 1px solid #ccc; }
|
||||
.status { padding: 10px; margin: 10px 0; border-radius: 4px; }
|
||||
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
|
||||
.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>nuscore Proxy Test</h1>
|
||||
|
||||
<div class="test-section">
|
||||
<h2>Health Check</h2>
|
||||
<button onclick="testHealth()">Health Check</button>
|
||||
<div id="health-status" class="status"></div>
|
||||
</div>
|
||||
|
||||
<div class="test-section">
|
||||
<h2>Proxy Test</h2>
|
||||
<input type="text" id="test-code" placeholder="Code eingeben" value="TEST123">
|
||||
<button onclick="testProxy()">Proxy Test</button>
|
||||
<div id="proxy-status" class="status"></div>
|
||||
</div>
|
||||
|
||||
<div class="test-section">
|
||||
<h2>Iframe Test</h2>
|
||||
<button onclick="loadIframe()">Iframe laden</button>
|
||||
<iframe id="test-iframe" style="display: none;"></iframe>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function testHealth() {
|
||||
const statusDiv = document.getElementById('health-status');
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/api/proxy/nuscore/health');
|
||||
const data = await response.json();
|
||||
statusDiv.innerHTML = `<div class="success">✅ Health Check OK: ${JSON.stringify(data)}</div>`;
|
||||
} catch (error) {
|
||||
statusDiv.innerHTML = `<div class="error">❌ Health Check Fehler: ${error.message}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
async function testProxy() {
|
||||
const code = document.getElementById('test-code').value;
|
||||
const statusDiv = document.getElementById('proxy-status');
|
||||
|
||||
try {
|
||||
const response = await fetch(`http://localhost:3000/api/proxy/nuscore?code=${encodeURIComponent(code)}`);
|
||||
const text = await response.text();
|
||||
|
||||
if (response.ok) {
|
||||
statusDiv.innerHTML = `<div class="success">✅ Proxy OK: ${text.length} Zeichen empfangen</div>`;
|
||||
} else {
|
||||
statusDiv.innerHTML = `<div class="error">❌ Proxy Fehler: ${text}</div>`;
|
||||
}
|
||||
} catch (error) {
|
||||
statusDiv.innerHTML = `<div class="error">❌ Proxy Fehler: ${error.message}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadIframe() {
|
||||
const code = document.getElementById('test-code').value;
|
||||
const iframe = document.getElementById('test-iframe');
|
||||
iframe.src = `http://localhost:3000/api/proxy/nuscore?code=${encodeURIComponent(code)}`;
|
||||
iframe.style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user