first commit
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Docs Home</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background: #0d1117;
|
||||
color: #c9d1d9;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.card-container {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #161b22;
|
||||
border: 1px solid #30363d;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
width: 220px;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
background: #21262d;
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.card p {
|
||||
font-size: 14px;
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
.logout {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
color: #f85149;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="logout" onclick="logout()">Logout</div>
|
||||
|
||||
<div class="container">
|
||||
<h1>Documentation Portal</h1>
|
||||
|
||||
<div class="card-container">
|
||||
<div class="card" onclick="goDocs()">
|
||||
<h2>📘 API Documentation</h2>
|
||||
<p>View markdown API docs</p>
|
||||
</div>
|
||||
|
||||
<div class="card" onclick="goCollection()">
|
||||
<h2>📦 API Collections</h2>
|
||||
<p>Interactive API testing</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 🔐 check if user is logged in
|
||||
async function checkAuth() {
|
||||
const res = await fetch('/api/docs/markdown-files', {
|
||||
credentials: "include"
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
window.location.href = "/Documentation/index.html";
|
||||
}
|
||||
}
|
||||
|
||||
function goDocs() {
|
||||
window.location.href = "/Documentation/markdown.html";
|
||||
}
|
||||
|
||||
function goCollection() {
|
||||
window.location.href = "/Documentation/api-collection.html";
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await fetch('/api/docs/logout', {
|
||||
method: "POST",
|
||||
credentials: "include"
|
||||
});
|
||||
|
||||
window.location.href = "/Documentation/index.html";
|
||||
}
|
||||
|
||||
checkAuth();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user