This commit is contained in:
Tykayn 2025-09-27 01:10:47 +02:00 committed by tykayn
parent dea71fc6b3
commit 11cd3236c5
13 changed files with 1952 additions and 71 deletions

View file

@ -39,6 +39,59 @@ class LiveResource:
<h1>
<a href="/demo">OEDB</a> Live
</h1>
<nav class="demo-nav" style="
background-color: #f8f9fa;
padding: 12px 16px;
border-radius: 8px;
margin-bottom: 20px;
border-left: 4px solid #0078ff;
">
<div style="display: flex; align-items: center; gap: 20px; flex-wrap: wrap;">
<!-- Logo et titre -->
<div style="display: flex; align-items: center; gap: 8px;">
<img src="/static/oedb.png" style="width: 24px; height: 24px;" alt="OEDB" />
<strong style="color: #0078ff;">OpenEventDatabase</strong>
</div>
<!-- Liens de navigation -->
<div style="display: flex; gap: 15px; flex-wrap: wrap; font-size: 14px;">
<a href="/demo" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
🗺 Carte principale
</a>
<a href="/demo/add" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
Ajouter un événement
</a>
<a href="/demo/traffic" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
🚗 Signaler un problème
</a>
<a href="/demo/live" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
🔴 Live
</a>
<a href="/demo/view-events" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
📋 Voir les événements
</a>
<a href="/demo/property-stats" style="color: #0078ff; text-decoration: none; padding: 4px 8px; border-radius: 4px;"
onmouseover="this.style.backgroundColor='#e3f2fd'" onmouseout="this.style.backgroundColor='transparent'">
📊 Statistiques
</a>
</div>
<!-- Lien vers l'API -->
<div style="margin-left: auto;">
<a href="/" style="color: #6c757d; text-decoration: none; font-size: 13px;"
onmouseover="this.style.color='#0078ff'" onmouseout="this.style.color='#6c757d'">
📡 API
</a>
</div>
</div>
</nav>
<div class="controls">
<span>Période: 7 jours (rafraîchit chaque minute)</span>
<button id="refreshBtn">Rafraîchir</button>
@ -71,34 +124,7 @@ class LiveResource:
<p>Username: <strong id="username-display">Anonymous</strong></p>
<p>Points: <span id="points-display" style="font-weight: bold; color: #0078ff;">0</span></p>
</div>
<!-- Authentication section -->
<!--
# <div id="auth-section" class="auth-section">
# <h3>OpenStreetMap Authentication</h3>
#
<a href="https://www.openstreetmap.org/oauth2/authorize?client_id={client_id}&redirect_uri={client_redirect}&response_type=code&scope=read_prefs" class="osm-login-btn">
<span class="osm-logo"></span>
Login with OpenStreetMap
</a>
<script>
# // Replace server-side auth section with JavaScript-rendered version if available
document.addEventListener('DOMContentLoaded', function() {
fetchEvents();
if (window.osmAuth) {
const clientId = document.getElementById('osmClientId').value;
const redirectUri = document.getElementById('osmRedirectUri').value;
const authSection = document.getElementById('auth-section');
// Only replace if osmAuth is loaded and has renderAuthSection method
if (osmAuth.renderAuthSection) {
authSection.innerHTML = osmAuth.renderAuthSection(clientId, redirectUri);
}
}
});
</script>
</div> -->
<h3 id="endpoints_list_header">API Endpoints:</h3>
<ul id="endpoints_list">