2025-05-24 15:36:14 +02:00

92 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>SeReact Test</title>
<style>
.page { display: none; padding: 20px; border: 1px solid #ccc; margin: 10px; }
.page.active { display: block; }
button { margin: 5px; padding: 10px; }
</style>
</head>
<body>
<h1>SeReact Navigation Test</h1>
<div>
<button onclick="showPage('home')">Home</button>
<button onclick="showPage('teams')">Teams</button>
<button onclick="showPage('users')">Users</button>
<button onclick="showPage('config')">Config</button>
<button onclick="testPageNavigation()">Test Navigation</button>
</div>
<div id="homePage" class="page">
<h2>Home Page</h2>
<p>This is the home page content.</p>
</div>
<div id="teamsPage" class="page">
<h2>Teams Page</h2>
<div id="teamsContainer">Teams will load here...</div>
</div>
<div id="usersPage" class="page">
<h2>Users Page</h2>
<div id="usersContainer">Users will load here...</div>
</div>
<div id="configPage" class="page">
<h2>Config Page</h2>
<p>Configuration settings go here.</p>
</div>
<div id="alertContainer"></div>
<script>
// Simple config mock
const config = {
isConfigured: () => true,
getApiBaseUrl: () => 'http://localhost:8000',
getApiKey: () => 'test-key'
};
// Simple API client mock
const apiClient = {
getTeams: () => Promise.resolve({teams: [{id: '1', name: 'Test Team', description: 'A test team', created_at: new Date().toISOString()}]}),
getUsers: () => Promise.resolve({users: [{id: '1', name: 'Test User', email: 'test@example.com', team_id: '1', is_admin: false, created_at: new Date().toISOString()}]})
};
// Mock functions
function showAlert(message, type) {
console.log(`Alert (${type}): ${message}`);
}
function handleApiError(error, context) {
console.error(`API Error ${context}:`, error);
}
function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
function formatDate(dateString) {
return new Date(dateString).toLocaleString();
}
</script>
<script src="js/ui.js"></script>
<script src="js/teams.js"></script>
<script src="js/users.js"></script>
<script>
// Initialize on load
document.addEventListener('DOMContentLoaded', () => {
console.log('Test page loaded');
showPage('home');
});
</script>
</body>
</html>