Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- templates/base.html +35 -0
templates/base.html
CHANGED
|
@@ -30,12 +30,47 @@
|
|
| 30 |
</div>
|
| 31 |
</header>
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
<main class="container mt-6">
|
| 34 |
{% block content %}{% endblock %}
|
| 35 |
</main>
|
| 36 |
|
| 37 |
<!-- Place for page-specific scripts -->
|
| 38 |
{% block scripts %}{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
</body>
|
| 40 |
</html>
|
| 41 |
</div>
|
|
|
|
| 30 |
</div>
|
| 31 |
</header>
|
| 32 |
|
| 33 |
+
<!-- Demo mode banner -->
|
| 34 |
+
<div id="demoBanner" class="container mt-2">
|
| 35 |
+
<div class="bg-yellow-50 border border-yellow-200 rounded p-3 text-sm flex justify-between items-center" style="display:none;" role="status">
|
| 36 |
+
<div>
|
| 37 |
+
<strong>Demo Mode</strong> — Running with in-memory data. Changes won't persist after a restart.
|
| 38 |
+
</div>
|
| 39 |
+
<div>
|
| 40 |
+
<button id="dismissDemo" class="px-3 py-1 bg-yellow-200 rounded text-sm">Dismiss</button>
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
<main class="container mt-6">
|
| 46 |
{% block content %}{% endblock %}
|
| 47 |
</main>
|
| 48 |
|
| 49 |
<!-- Place for page-specific scripts -->
|
| 50 |
{% block scripts %}{% endblock %}
|
| 51 |
+
<script>
|
| 52 |
+
(async function(){
|
| 53 |
+
try {
|
| 54 |
+
const dismissed = localStorage.getItem('eh_demo_dismissed');
|
| 55 |
+
if (dismissed === '1') return;
|
| 56 |
+
const res = await fetch('/system/status');
|
| 57 |
+
if (!res.ok) return;
|
| 58 |
+
const json = await res.json();
|
| 59 |
+
if (json.storage === 'in_memory' || json.demo_mode) {
|
| 60 |
+
const banner = document.getElementById('demoBanner').querySelector('div');
|
| 61 |
+
if (banner) {
|
| 62 |
+
banner.style.display = 'flex';
|
| 63 |
+
document.getElementById('dismissDemo').addEventListener('click', () => {
|
| 64 |
+
banner.style.display = 'none';
|
| 65 |
+
localStorage.setItem('eh_demo_dismissed', '1');
|
| 66 |
+
});
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
} catch (e) {
|
| 70 |
+
// ignore
|
| 71 |
+
}
|
| 72 |
+
})();
|
| 73 |
+
</script>
|
| 74 |
</body>
|
| 75 |
</html>
|
| 76 |
</div>
|