- Add GET /projects route in server.js with authentication check - Serve projects.html when authenticated, redirect to login otherwise - Add navigation header to both landing page and projects page - Include Sessions, Projects navigation links with active state styling - Add logout button to navigation header - Style navigation with dark theme matching existing design - Make navigation responsive for mobile devices Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
216 lines
7.6 KiB
HTML
216 lines
7.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Projects - Claude Code Web Interface</title>
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
<link rel="stylesheet" href="/claude-ide/projects.css">
|
|
<style>
|
|
/* Navigation Header Styles */
|
|
.nav-header {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
background: rgba(13, 13, 13, 0.95);
|
|
backdrop-filter: blur(10px);
|
|
border-bottom: 1px solid #333;
|
|
padding: 16px 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.nav-logo {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
background: linear-gradient(135deg, #4a9eff 0%, #a78bfa 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nav-link {
|
|
padding: 8px 16px;
|
|
background: transparent;
|
|
border: 1px solid #333;
|
|
border-radius: 8px;
|
|
color: #e0e0e0;
|
|
text-decoration: none;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
transition: all 0.2s ease;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
background: #252525;
|
|
border-color: #4a9eff;
|
|
color: #4a9eff;
|
|
}
|
|
|
|
.nav-link.active {
|
|
background: rgba(74, 158, 255, 0.15);
|
|
border-color: #4a9eff;
|
|
color: #4a9eff;
|
|
}
|
|
|
|
.nav-logout {
|
|
padding: 8px 16px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #888;
|
|
font-size: 14px;
|
|
cursor: pointer;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.nav-logout:hover {
|
|
color: #e0e0e0;
|
|
}
|
|
|
|
/* Adjust main content for fixed header */
|
|
.projects-header {
|
|
margin-top: 70px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.nav-header {
|
|
padding: 12px 16px;
|
|
}
|
|
|
|
.nav-logo {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.nav-link {
|
|
padding: 6px 12px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.projects-header {
|
|
margin-top: 60px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- Navigation Header -->
|
|
<nav class="nav-header">
|
|
<div class="nav-logo">Claude Code</div>
|
|
<div class="nav-links">
|
|
<a href="/claude/" class="nav-link">Sessions</a>
|
|
<a href="/projects" class="nav-link active">Projects</a>
|
|
<button class="nav-logout" onclick="logout()">Logout</button>
|
|
</div>
|
|
</nav>
|
|
|
|
<div id="app">
|
|
<!-- Header -->
|
|
<header class="projects-header">
|
|
<div class="header-left">
|
|
<h1>Projects</h1>
|
|
<a href="/claude/" class="back-link">Back to Sessions</a>
|
|
</div>
|
|
<div class="header-right">
|
|
<input type="text" id="search-input" class="search-input" placeholder="Search projects...">
|
|
<button id="new-project-btn" class="btn-primary">+ New Project</button>
|
|
<button id="recycle-bin-btn" class="btn-secondary">Recycle Bin</button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Projects Grid -->
|
|
<div id="projects-grid" class="projects-grid">
|
|
<!-- Project cards will be dynamically inserted here -->
|
|
</div>
|
|
|
|
<!-- Empty State -->
|
|
<div id="empty-state" class="empty-state" style="display: none;">
|
|
<h2>No projects yet</h2>
|
|
<p>Create your first project to get started organizing your work.</p>
|
|
<button id="empty-state-new-project-btn" class="btn-primary">+ New Project</button>
|
|
</div>
|
|
|
|
<!-- Create/Edit Project Modal -->
|
|
<div id="project-modal" class="modal" style="display: none;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h2 id="modal-title">Create Project</h2>
|
|
<button id="close-modal-btn" class="close-btn">×</button>
|
|
</div>
|
|
<form id="project-form">
|
|
<div class="form-group">
|
|
<label for="project-name">Name *</label>
|
|
<input type="text" id="project-name" name="name" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="project-path">Path *</label>
|
|
<input type="text" id="project-path" name="path" required placeholder="/path/to/project">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="project-description">Description</label>
|
|
<textarea id="project-description" name="description" rows="3" placeholder="Brief description of the project"></textarea>
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label for="project-icon">Icon</label>
|
|
<input type="text" id="project-icon" name="icon" placeholder="folder">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="project-color">Color</label>
|
|
<input type="color" id="project-color" name="color" value="#3498db">
|
|
</div>
|
|
</div>
|
|
<div class="modal-actions">
|
|
<button type="submit" class="btn-primary">Save</button>
|
|
<button type="button" id="cancel-modal-btn" class="btn-secondary">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recycle Bin Modal -->
|
|
<div id="recycle-bin-modal" class="modal" style="display: none;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h2>Recycle Bin</h2>
|
|
<button id="close-recycle-bin-btn" class="close-btn">×</button>
|
|
</div>
|
|
<div id="recycle-bin-content" class="recycle-bin-content">
|
|
<!-- Deleted items will be dynamically inserted here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Context Menu -->
|
|
<div id="context-menu" class="context-menu" style="display: none;">
|
|
<ul>
|
|
<li id="ctx-open"><span class="icon">→</span> Open</li>
|
|
<li id="ctx-edit"><span class="icon">✎</span> Edit</li>
|
|
<li id="ctx-delete"><span class="icon">🗑</span> Delete</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/claude-ide/projects.js"></script>
|
|
<script>
|
|
async function logout() {
|
|
try {
|
|
await fetch('/claude/api/logout', { method: 'POST' });
|
|
window.location.href = '/claude/';
|
|
} catch (error) {
|
|
console.error('Logout failed:', error);
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|