Files
Warracker/frontend/api-test.html
sassanix 3f6a0cbb3e API Security Improvements
Refer to changelogs
2025-03-21 08:25:52 -03:00

90 lines
2.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Connection Test</title>
<link rel="stylesheet" href="style.css">
<!-- Font Awesome for icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.alert {
padding: 15px;
margin-bottom: 20px;
border-radius: 4px;
}
.alert-success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.alert-danger {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
pre {
background-color: #f8f9fa;
padding: 10px;
border-radius: 4px;
overflow: auto;
max-height: 300px;
}
</style>
</head>
<body>
<!-- Header -->
<header>
<div class="container">
<div class="app-title">
<i class="fas fa-shield-alt"></i>
<h1>Warranty Tracker</h1>
</div>
<div class="nav-links">
<a href="index.html" class="nav-link">
<i class="fas fa-home"></i> Home
</a>
<a href="status.html" class="nav-link">
<i class="fas fa-chart-pie"></i> Status
</a>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="content">
<h2><i class="fas fa-terminal"></i> API Connection Test</h2>
<div class="card">
<div class="card-header">
<h3>Testing API Connection</h3>
</div>
<div class="card-body">
<div id="apiTestResult">
<p>Checking API connection...</p>
</div>
<div class="debug-info">
<h4>Manual API Test</h4>
<p>You can also test the API manually with tools like curl:</p>
<pre>curl -X GET -H "Authorization: Bearer YOUR_AUTH_TOKEN" http://localhost:8005/api/warranties</pre>
</div>
<div class="actions">
<button onclick="location.reload()" class="btn">
<i class="fas fa-sync-alt"></i> Run Test Again
</button>
<a href="index.html" class="btn">
<i class="fas fa-home"></i> Back to Home
</a>
</div>
</div>
</div>
</div>
</div>
<!-- Load test script -->
<script src="test-api.js"></script>
</body>
</html>