UI: light/dark switch, and THOR spelled out in the header #10

Merged
jared merged 2 commits from theme into main 2026-11-26 17:32:09 -05:00
3 changed files with 18 additions and 4 deletions

No files matched your search

+2
View File
@@ -145,6 +145,8 @@ def test_needs_attention_page(store):
assert 'Loki: <strong>blind</strong>' in html and 'HTTP 500' in html assert 'Loki: <strong>blind</strong>' in html and 'HTTP 500' in html
assert 'On the timeline only' in html and 'monitor-01 slow' in html # unexplained symptom assert 'On the timeline only' in html and 'monitor-01 slow' in html # unexplained symptom
assert 'Last 7 days' in html and 'storage-01 oom' in html assert 'Last 7 days' in html and 'storage-01 oom' in html
assert 'id="lt-theme-btn"' in html and 'lt.theme.toggle()' in html # light/dark switch
assert '<b>T</b>otal <b>H</b>ardware<br><b>O</b>perations <b>R</b>esolver' in html
def test_incident_and_known_pages(store): def test_incident_and_known_pages(store):
+4
View File
@@ -11,6 +11,10 @@
.t-note { color: var(--text-secondary); font-size: .88em; max-width: 70ch; } .t-note { color: var(--text-secondary); font-size: .88em; max-width: 70ch; }
.t-err { color: var(--accent-red); } .t-err { color: var(--accent-red); }
/* Brand: the acronym spelled out under the title, as Gandalf does */
.t-brand-expansion { letter-spacing: .08em; line-height: 1.35; }
.t-brand-expansion b { color: var(--accent-cyan); font-weight: 700; }
/* Needs attention (same shape as Gandalf's) */ /* Needs attention (same shape as Gandalf's) */
.attention-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .attention-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.attention-group { border: 1px solid var(--border-dim); background: var(--bg-card); padding: 12px 14px; } .attention-group { border: 1px solid var(--border-dim); background: var(--bg-card); padding: 12px 14px; }
+12 -4
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="theme-color" content="#030508"> <meta name="theme-color" content="#030508">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<meta name="description" content="THOR: out-of-band host and cluster health for the LotusGuild cluster"> <meta name="description" content="THOR: Total Hardware Operations Resolver. Out-of-band host and cluster health for the LotusGuild cluster">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='%23030508'/%3E%3Cpath d='M3 3h10v4H9v6H7V7H3z' fill='%23FF6B00'/%3E%3C/svg%3E"> <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='%23030508'/%3E%3Cpath d='M3 3h10v4H9v6H7V7H3z' fill='%23FF6B00'/%3E%3C/svg%3E">
<title>{% block title %}Needs attention{% endblock %} | THOR</title> <title>{% block title %}Needs attention{% endblock %} | THOR</title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -37,8 +37,9 @@
<span class="lt-menu-btn-bar"></span><span class="lt-menu-btn-bar"></span><span class="lt-menu-btn-bar"></span> <span class="lt-menu-btn-bar"></span><span class="lt-menu-btn-bar"></span><span class="lt-menu-btn-bar"></span>
</button> </button>
<div class="lt-brand"> <div class="lt-brand">
<a href="{{ url_for('ui.index') }}" class="lt-brand-title" title="Total Hardware Operations Resolver">THOR</a> <a href="{{ url_for('ui.index') }}" class="lt-brand-title lt-glitch" data-text="THOR"
<span class="lt-brand-subtitle">Host and cluster health, seen from outside</span> aria-label="THOR home">THOR</a>
<span class="lt-brand-subtitle t-brand-expansion" title="THOR: Total Hardware Operations Resolver"><b>T</b>otal <b>H</b>ardware<br><b>O</b>perations <b>R</b>esolver</span>
</div> </div>
<nav class="lt-nav" aria-label="Main navigation"> <nav class="lt-nav" aria-label="Main navigation">
<a href="{{ url_for('ui.index') }}" class="lt-nav-link{% if active_nav == 'index' %} active{% endif %}" <a href="{{ url_for('ui.index') }}" class="lt-nav-link{% if active_nav == 'index' %} active{% endif %}"
@@ -48,6 +49,8 @@
</nav> </nav>
</div> </div>
<div class="lt-header-right"> <div class="lt-header-right">
<button type="button" class="lt-theme-btn" id="lt-theme-btn"
aria-label="Switch between light and dark mode" title="Light or dark mode">&#x2600;</button>
{% if user.name %}<span class="lt-header-user">{{ user.name }}</span>{% endif %} {% if user.name %}<span class="lt-header-user">{{ user.name }}</span>{% endif %}
{% if 'admin' in user.groups %}<span class="lt-badge-admin">admin</span>{% endif %} {% if 'admin' in user.groups %}<span class="lt-badge-admin">admin</span>{% endif %}
</div> </div>
@@ -64,7 +67,12 @@
</footer> </footer>
<script nonce="{{ nonce }}"> <script nonce="{{ nonce }}">
document.addEventListener('DOMContentLoaded', function () { lt.init({ skipBoot: true }); }); document.addEventListener('DOMContentLoaded', function () {
lt.init({ skipBoot: true });
// Light or dark: follows the browser until chosen here, then remembered (same as Gandalf).
var themeBtn = document.getElementById('lt-theme-btn');
if (themeBtn) themeBtn.addEventListener('click', function () { lt.theme.toggle(); });
});
</script> </script>
{% block scripts %}{% endblock %} {% block scripts %}{% endblock %}
</body> </body>