724 lines
22 KiB
HTML
724 lines
22 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>EV Dash</title>
|
|
<link rel="icon" type="image/x-icon" href="styles/pce/favicon.ico">
|
|
<style>
|
|
:root {
|
|
--primary-color: #e30a18;
|
|
--secondary-color: #a20d17;
|
|
--accent-color: #f4b400;
|
|
--surface-color: #ffffff;
|
|
--background-color: #58616b;
|
|
--text-color: #222222;
|
|
--muted-text-color: #3342538a;
|
|
--green-color: #2ecc71;
|
|
--red-color: #e30a18;
|
|
--sidebar-width: clamp(200px, 22vw, 320px);
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
font-family: "UniversLTStd", "Segoe UI", Roboto, sans-serif;
|
|
background: var(--background-color);
|
|
color: var(--text-color);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: auto;
|
|
}
|
|
|
|
.app-layout {
|
|
flex: 1;
|
|
display: grid;
|
|
grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
|
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
grid-template-areas:
|
|
"header header"
|
|
"sidebar main"
|
|
"footer footer";
|
|
column-gap: 2rem;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
header {
|
|
grid-area: header;
|
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
|
color: #ffffff;
|
|
padding: 2rem 1.5rem;
|
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
position: relative;
|
|
z-index: 2;
|
|
}
|
|
|
|
.header-bar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.brand {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
flex: 1 1 260px;
|
|
}
|
|
|
|
.brand-logo {
|
|
display: block;
|
|
height: 56px;
|
|
width: auto;
|
|
flex-shrink: 0;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.brand-text {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.brand h1 {
|
|
margin: 0 0 0.4rem;
|
|
font-weight: 600;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.brand p {
|
|
margin: 0;
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.session-panel {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 1rem 1.5rem;
|
|
}
|
|
|
|
.session-user {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 0.95rem;
|
|
font-weight: 600;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.session-user-icon {
|
|
width: 28px;
|
|
height: 28px;
|
|
display: inline-block;
|
|
}
|
|
|
|
.status-indicator {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
font-weight: 600;
|
|
margin: 0;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 14px;
|
|
height: 14px;
|
|
border-radius: 50%;
|
|
background-color: #d3dce6;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
.status-dot.connecting {
|
|
background-color: #f4b400;
|
|
}
|
|
|
|
.status-dot.connected {
|
|
background-color: var(--green-color);
|
|
}
|
|
|
|
.status-dot.authenticating {
|
|
background-color: #8e44ad;
|
|
}
|
|
|
|
.status-dot.error {
|
|
background-color: var(--red-color);
|
|
}
|
|
|
|
main {
|
|
grid-area: main;
|
|
padding: 2rem 2.5rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
overflow: visible;
|
|
}
|
|
|
|
.side-panel {
|
|
grid-area: sidebar;
|
|
height: auto;
|
|
background: var(--surface-color);
|
|
border-radius: 0;
|
|
padding: 1.5rem;
|
|
box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
|
|
border: 1px solid rgba(0, 0, 0, 0.04);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
align-self: stretch;
|
|
overflow: visible;
|
|
min-height: 0;
|
|
}
|
|
|
|
.side-panel-header h2 {
|
|
margin: 0;
|
|
font-size: 1.15rem;
|
|
}
|
|
|
|
.side-panel-header p {
|
|
margin: 0.35rem 0 0;
|
|
color: var(--muted-text-color);
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.side-nav {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.85rem;
|
|
}
|
|
|
|
.side-nav-button {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.2rem;
|
|
width: 100%;
|
|
border-radius: 14px;
|
|
padding: 0.85rem 1rem;
|
|
border: 1px solid transparent;
|
|
background: #f3f6fb;
|
|
text-align: left;
|
|
font-weight: 600;
|
|
font-size: 1rem;
|
|
color: var(--text-color);
|
|
cursor: pointer;
|
|
transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
|
|
}
|
|
|
|
.side-nav-button:hover {
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.side-nav-button.active {
|
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
|
color: #ffffff;
|
|
box-shadow: 0 18px 28px rgba(227, 10, 24, 0.25);
|
|
}
|
|
|
|
.side-nav-button.active .side-nav-subtitle {
|
|
color: rgba(255, 255, 255, 0.85);
|
|
}
|
|
|
|
.side-nav-subtitle {
|
|
font-size: 0.85rem;
|
|
font-weight: 400;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
.side-panel-footer {
|
|
margin-top: auto;
|
|
font-size: 0.85rem;
|
|
color: var(--muted-text-color);
|
|
}
|
|
|
|
.content-area {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
max-width: 1100px;
|
|
margin: 0 auto;
|
|
width: 100%;
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.content-panel {
|
|
display: none;
|
|
}
|
|
|
|
.content-panel.active {
|
|
display: grid;
|
|
gap: 1.5rem;
|
|
align-content: start;
|
|
}
|
|
|
|
.grid-two-column {
|
|
display: grid;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
@media (min-width: 900px) {
|
|
.grid-two-column {
|
|
grid-template-columns: 1fr 1fr;
|
|
}
|
|
}
|
|
|
|
.card {
|
|
background: var(--surface-color);
|
|
border-radius: 16px;
|
|
padding: 1.5rem;
|
|
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
|
|
border: 1px solid rgba(0, 0, 0, 0.03);
|
|
}
|
|
|
|
.card-header {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.eyebrow {
|
|
margin: 0;
|
|
font-size: 0.8rem;
|
|
letter-spacing: 0.08em;
|
|
text-transform: uppercase;
|
|
color: var(--muted-text-color);
|
|
}
|
|
|
|
.card h2 {
|
|
margin: 0;
|
|
font-size: 1.35rem;
|
|
}
|
|
|
|
.card h3 {
|
|
margin: 0 0 0.4rem;
|
|
font-size: 1.05rem;
|
|
}
|
|
|
|
.helper-text {
|
|
font-size: 0.9rem;
|
|
color: var(--muted-text-color);
|
|
margin: 0;
|
|
}
|
|
|
|
.table-wrapper {
|
|
overflow-x: auto;
|
|
}
|
|
|
|
table.chargers-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.chargers-table th,
|
|
.chargers-table td {
|
|
padding: 0.5rem 0.75rem;
|
|
border-bottom: 1px solid #e4e9f2;
|
|
text-align: left;
|
|
}
|
|
|
|
.chargers-table th {
|
|
font-size: 0.75rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: var(--muted-text-color);
|
|
}
|
|
|
|
.chargers-table tbody tr:nth-child(even) {
|
|
background: #f9fbfd;
|
|
}
|
|
|
|
.chargers-table .empty-row td {
|
|
text-align: center;
|
|
font-style: italic;
|
|
color: var(--muted-text-color);
|
|
}
|
|
|
|
.value-dot {
|
|
display: inline-flex;
|
|
width: 0.75rem;
|
|
height: 0.75rem;
|
|
border-radius: 50%;
|
|
margin-right: 0.35rem;
|
|
vertical-align: middle;
|
|
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.value-dot-true {
|
|
background: var(--green-color);
|
|
}
|
|
|
|
.value-dot-false {
|
|
background: var(--red-color);
|
|
}
|
|
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
border: 0;
|
|
}
|
|
|
|
pre {
|
|
margin: 0;
|
|
background: #f8fafc;
|
|
border-radius: 10px;
|
|
padding: 1rem;
|
|
overflow-x: auto;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
code {
|
|
font-family: "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
|
}
|
|
|
|
ul {
|
|
margin: 0.4rem 0 0;
|
|
padding-left: 1.25rem;
|
|
}
|
|
|
|
ul li + li {
|
|
margin-top: 0.35rem;
|
|
}
|
|
|
|
footer {
|
|
grid-area: footer;
|
|
text-align: center;
|
|
padding: 1.25rem 1rem;
|
|
background: #ffffff;
|
|
border-top: 1px solid #d3dce6;
|
|
font-size: 0.9rem;
|
|
color: var(--muted-text-color);
|
|
position: relative;
|
|
z-index: 2;
|
|
}
|
|
|
|
body.needs-auth {
|
|
background: var(--surface-color);
|
|
overflow: auto;
|
|
}
|
|
|
|
body.needs-auth .app-layout {
|
|
display: none;
|
|
}
|
|
|
|
.login-view {
|
|
width: 100%;
|
|
padding: 3rem 1.5rem;
|
|
display: none;
|
|
}
|
|
|
|
body.needs-auth .login-view {
|
|
display: flex;
|
|
flex: 1;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.login-panel {
|
|
background: var(--surface-color);
|
|
width: min(420px, 100%);
|
|
border-radius: 16px;
|
|
padding: 2.25rem;
|
|
border: 1px solid rgba(0, 0, 0, 0.06);
|
|
box-shadow: 0 18px 28px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.login-panel h2 {
|
|
margin: 0 0 0.5rem;
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.login-panel p {
|
|
margin: 0;
|
|
color: var(--muted-text-color);
|
|
}
|
|
|
|
form {
|
|
margin-top: 1.5rem;
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
|
|
label {
|
|
display: grid;
|
|
gap: 0.35rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
input[type="text"],
|
|
input[type="password"] {
|
|
border-radius: 10px;
|
|
border: 1px solid #d3dce6;
|
|
padding: 0.75rem 1rem;
|
|
font-size: 1rem;
|
|
background: #f9fbfd;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
input[type="text"]:focus,
|
|
input[type="password"]:focus {
|
|
outline: none;
|
|
border-color: var(--secondary-color);
|
|
box-shadow: 0 0 0 3px rgba(162, 13, 23, 0.2);
|
|
}
|
|
|
|
button {
|
|
border: none;
|
|
border-radius: 999px;
|
|
padding: 0.75rem 1.5rem;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
justify-self: start;
|
|
transition: transform 0.12s ease, box-shadow 0.12s ease;
|
|
}
|
|
|
|
button.primary {
|
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
|
color: #ffffff;
|
|
box-shadow: 0 10px 24px rgba(0, 80, 160, 0.26);
|
|
}
|
|
|
|
button.primary:disabled {
|
|
opacity: 0.65;
|
|
cursor: progress;
|
|
box-shadow: none;
|
|
}
|
|
|
|
button.primary:not(:disabled):hover {
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 16px 32px rgba(0, 80, 160, 0.28);
|
|
}
|
|
|
|
.error-message {
|
|
background: rgba(231, 76, 60, 0.08);
|
|
border: 1px solid rgba(231, 76, 60, 0.18);
|
|
color: #c0392b;
|
|
border-radius: 10px;
|
|
padding: 0.75rem 1rem;
|
|
}
|
|
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
button.ghost {
|
|
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
color: #ffffff;
|
|
background: transparent;
|
|
padding: 0.35rem 0.85rem;
|
|
border-radius: 999px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
button.ghost:hover {
|
|
border-color: #ffffff;
|
|
background: rgba(255, 255, 255, 0.12);
|
|
}
|
|
|
|
@media (max-width: 1100px) {
|
|
:root {
|
|
--sidebar-width: clamp(180px, 26vw, 280px);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 820px) {
|
|
:root {
|
|
--sidebar-width: clamp(160px, 34vw, 220px);
|
|
}
|
|
|
|
main {
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.app-layout {
|
|
column-gap: 1.5rem;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
:root {
|
|
--sidebar-width: clamp(140px, 40vw, 200px);
|
|
}
|
|
|
|
main {
|
|
padding: 1.25rem;
|
|
}
|
|
|
|
.app-layout {
|
|
column-gap: 1rem;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="needs-auth">
|
|
<div class="app-layout">
|
|
<header>
|
|
<div class="header-bar">
|
|
<div class="brand">
|
|
<img src="styles/pce/icon.svg" alt="EV Dash logo" class="brand-logo">
|
|
<div class="brand-text">
|
|
<h1>EV Dash</h1>
|
|
<p>Monitor & troubleshoot EV chargers.</p>
|
|
</div>
|
|
</div>
|
|
<div class="session-panel">
|
|
<p class="status-indicator">
|
|
<span id="statusDot" class="status-dot connecting" aria-hidden="true"></span>
|
|
<span id="connectionStatus">Awaiting login…</span>
|
|
</p>
|
|
<div class="session-user">
|
|
<img src="icons/user.svg" alt="" aria-hidden="true" class="session-user-icon">
|
|
<span id="sessionUsername">Awaiting login…</span>
|
|
</div>
|
|
<button type="button" id="logoutButton" class="ghost hidden">Logout</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<aside class="side-panel" aria-label="Dashboard sections">
|
|
<div class="side-panel-header">
|
|
<p class="eyebrow">Workspace</p>
|
|
<h2>Overview</h2>
|
|
<p>Switch between live status and built-in documentation.</p>
|
|
</div>
|
|
<nav class="side-nav" aria-label="Sections">
|
|
<button type="button" class="side-nav-button active" data-panel-target="chargers" aria-pressed="true">
|
|
<span>Chargers</span>
|
|
<span class="side-nav-subtitle">Live table & telemetry</span>
|
|
</button>
|
|
<button type="button" class="side-nav-button" data-panel-target="help" aria-pressed="false">
|
|
<span>Help</span>
|
|
<span class="side-nav-subtitle">API contract & logs</span>
|
|
</button>
|
|
</nav>
|
|
<div class="side-panel-footer">
|
|
Built for nymea experience plugins.
|
|
</div>
|
|
</aside>
|
|
|
|
<main>
|
|
<section class="content-area">
|
|
<section class="content-panel active" data-panel="chargers" aria-labelledby="chargersTitle" aria-hidden="false">
|
|
<article class="card">
|
|
<div class="card-header">
|
|
<div>
|
|
<p class="eyebrow">Live overview</p>
|
|
<h2 id="chargersTitle">Chargers</h2>
|
|
</div>
|
|
</div>
|
|
<div class="table-wrapper">
|
|
<table class="chargers-table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Name</th>
|
|
<th scope="col">Connected</th>
|
|
<th scope="col">Charging current</th>
|
|
<th scope="col">Charging allowed</th>
|
|
<th scope="col">Current power</th>
|
|
<th scope="col">Plugged in</th>
|
|
<th scope="col">Version</th>
|
|
<th scope="col">Session energy</th>
|
|
<th scope="col">Temperature</th>
|
|
<th scope="col">Charging phases</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="chargerTableBody">
|
|
<tr id="chargerEmptyRow" class="empty-row">
|
|
<td colspan="10">No chargers loaded yet.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</article>
|
|
</section>
|
|
|
|
<section class="content-panel" data-panel="help" aria-labelledby="helpTitle" aria-hidden="true">
|
|
<article class="card">
|
|
<div class="card-header">
|
|
<div>
|
|
<p class="eyebrow">Guides</p>
|
|
<h2 id="helpTitle">API Contract</h2>
|
|
</div>
|
|
<p class="helper-text">Use <code>app.sendAction(action, payload)</code> after authenticating.</p>
|
|
</div>
|
|
<div class="grid-two-column">
|
|
<div>
|
|
<h3>Request template</h3>
|
|
<pre id="requestTemplate"></pre>
|
|
</div>
|
|
<div>
|
|
<h3>Responses</h3>
|
|
<pre id="responseTemplate"></pre>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
|
|
<article class="card" aria-live="polite">
|
|
<div class="card-header">
|
|
<div>
|
|
<p class="eyebrow">Diagnostics</p>
|
|
<h2>Last WebSocket message</h2>
|
|
</div>
|
|
<p class="helper-text">Sign in to reuse the stored session and inspect backend payloads.</p>
|
|
</div>
|
|
<pre id="incomingMessage">No messages received yet.</pre>
|
|
</article>
|
|
|
|
<article class="card">
|
|
<div class="card-header">
|
|
<div>
|
|
<p class="eyebrow">Reference</p>
|
|
<h2>Charger table basics</h2>
|
|
</div>
|
|
</div>
|
|
<ul>
|
|
<li>The dashboard keeps one row per charger ID and updates it with backend notifications.</li>
|
|
<li>Columns follow the order defined by <code>EvDashEngine::packCharger</code> so new properties show up automatically.</li>
|
|
<li>Branding (colours, fonts) is managed via CSS variables at the top of this file for easy overrides.</li>
|
|
</ul>
|
|
</article>
|
|
</section>
|
|
</section>
|
|
</main>
|
|
|
|
<footer>
|
|
<span id="appVersion">EV Dash</span> · © 2025 chargebyte GmbH. All rights reserved.
|
|
</footer>
|
|
</div>
|
|
|
|
<section id="loginOverlay" class="login-view" aria-labelledby="loginTitle">
|
|
<div class="login-panel">
|
|
<h2 id="loginTitle">Sign in</h2>
|
|
<p>Authorization required.</p>
|
|
<div id="loginError" class="error-message hidden" role="alert"></div>
|
|
<form id="loginForm" autocomplete="on">
|
|
<label for="username">Username
|
|
<input type="text" id="username" name="username" autocomplete="username" required placeholder="user">
|
|
</label>
|
|
<label for="password">Password
|
|
<input type="password" id="password" name="password" autocomplete="current-password" required placeholder="••••••••">
|
|
</label>
|
|
<p class="helper-text">Contact the administrator to receive valid credentials.</p>
|
|
<button type="submit" id="loginButton" class="primary">Sign in</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html>
|