Files
location_managemet/app/templates/base.html
ske087 30806560a6 Fix SonoffLAN signing key: hardcode pre-computed HMAC key
The previous _compute_sign_key() function indexed into a base64 string
derived from the full SonoffLAN REGIONS dict (~243 entries). Our partial
dict only produced a 7876-char a string but needed index 7872+, so the
function must use the full dict.

Solution: pre-compute the key once from the full dict and hardcode the
resulting 32-byte ASCII key. This is deterministic — the SonoffLAN
algorithm always produces the same output regardless of when it runs.

The sonoff_ewelink driver now loads cleanly alongside all other drivers.
2026-02-26 20:13:07 +02:00

88 lines
3.9 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% block title %}Location Management{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='vendor/bootstrap/css/bootstrap.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='vendor/bootstrap-icons/font/bootstrap-icons.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" />
</head>
<body>
<!-- ── Sidebar navigation ───────────────────────────────────────────────── -->
<div class="d-flex" id="wrapper">
<nav id="sidebar" class="d-flex flex-column flex-shrink-0 p-3 bg-dark">
<a href="{{ url_for('dashboard.index') }}" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
<i class="bi bi-cpu-fill me-2 fs-4 text-primary"></i>
<span class="fs-5 fw-semibold">Loc. Mgmt</span>
</a>
<hr class="text-secondary" />
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="{{ url_for('dashboard.index') }}"
class="nav-link text-white {% if request.endpoint == 'dashboard.index' %}active{% endif %}">
<i class="bi bi-grid-1x2-fill me-2"></i>Dashboard
</a>
</li>
<li>
<a href="{{ url_for('boards.list_boards') }}"
class="nav-link text-white {% if 'boards.' in request.endpoint or 'sonoff.' in request.endpoint %}active{% endif %}">
<i class="bi bi-motherboard me-2"></i>Boards
</a>
</li>
<li>
<a href="{{ url_for('workflows.list_workflows') }}"
class="nav-link text-white {% if 'workflows.' in request.endpoint %}active{% endif %}">
<i class="bi bi-diagram-3 me-2"></i>Workflows
</a>
</li>
{% if current_user.is_admin() %}
<li>
<a href="{{ url_for('admin.list_users') }}"
class="nav-link text-white {% if 'admin.' in request.endpoint %}active{% endif %}">
<i class="bi bi-people me-2"></i>Users
</a>
</li>
{% endif %}
</ul>
<hr class="text-secondary" />
<div class="dropdown">
<a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle"
data-bs-toggle="dropdown">
<i class="bi bi-person-circle me-2 fs-5"></i>
<strong>{{ current_user.username }}</strong>
{% if current_user.is_admin() %}
<span class="badge bg-primary ms-2">admin</span>
{% endif %}
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow">
<li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">
<i class="bi bi-box-arrow-right me-1"></i> Sign out
</a></li>
</ul>
</div>
</nav>
<!-- ── Main content ─────────────────────────────────────────────────────── -->
<div id="page-content" class="flex-grow-1 p-4">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</div>
</div>
<script src="{{ url_for('static', filename='vendor/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static', filename='vendor/socket.io/socket.io.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
{% block scripts %}{% endblock %}
</body>
</html>