Files
Warracker/frontend/api-test.html
sassanix 22d7e6d751 Fixes and changes
Major update to the UI, lots of fixes, about page added, please refer to changelog for more details
2025-04-13 23:12:03 -03:00

95 lines
3.2 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>
<script src="theme-loader.js"></script> <!-- Apply theme early -->
<!-- Favicons -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png?v=2">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png?v=2">
<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>