Compare commits

...

3 Commits

4 changed files with 19 additions and 16 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "site-gateway",
"version": "0.11.65",
"version": "0.11.68",
"private": true,
"description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.",
"type": "module",
+2 -1
View File
@@ -281,7 +281,8 @@ function renderPerformance() {
$("#performance-sparkline").innerHTML = points.length ? `${gridLines}<path d="${areaPath}" fill="var(--green)" opacity="0.12" stroke="none" /><path d="${smoothLine}" fill="none" stroke="var(--green)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />` : "";
if (!points.length) $("#performance-sparkline-labels").innerHTML = '<span class="axis-label" style="left:0;width:100%;top:45%;text-align:center">No request data for this window yet.</span>';
const routes = data.routes || [];
$("#performance-rows").innerHTML = routes.length ? routes.map(route => `<tr class="${selected && route.host === selected ? "row-highlight" : ""}"><td title="${escapeHtml(route.host)}">${escapeHtml(route.host)}</td><td>${route.hourRequests}</td><td>${route.dayRequests}</td><td>${route.dayErrors ? `<span class="http-status bad">${route.dayErrors}</span>` : "0"}</td><td>${route.dayAvgMs == null ? "—" : `${route.dayAvgMs} ms`}</td></tr>`).join("") : '<tr><td colspan="5" class="quiet-state">No requests have been logged yet.</td></tr>';
const countCell = (count, errors) => `${count}${errors ? ` <span class="count-divider">·</span> <span class="http-status bad">${errors}</span>` : ""}`;
$("#performance-rows").innerHTML = routes.length ? routes.map(route => `<tr class="${selected && route.host === selected ? "row-highlight" : ""}"><td title="${escapeHtml(route.host)}">${escapeHtml(route.host)}</td><td>${countCell(route.hourRequests, route.hourErrors)}</td><td>${countCell(route.dayRequests, route.dayErrors)}</td><td>${route.dayAvgMs == null ? "—" : `${route.dayAvgMs} ms`}</td></tr>`).join("") : '<tr><td colspan="4" class="quiet-state">No requests have been logged yet.</td></tr>';
if (selected) $(`#performance-rows tr.row-highlight`)?.scrollIntoView({ block: "nearest" });
}
+9 -7
View File
@@ -134,17 +134,19 @@
<section class="dashboard-panel readiness-panel"><div class="panel-heading"><div><p class="eyebrow">Guided diagnostics</p><h2>Domain readiness</h2><p class="muted">DNS, listener, TLS, and upstream checks for every configured domain.</p></div></div><div id="readiness-list" class="dashboard-list diagnostic-list"><p class="quiet-state">Checking configured domains…</p></div></section>
</section>
<section id="logs-view" class="feature-view hidden">
<div class="log-toolbar"><div class="log-filters"><label>Domain<select id="log-host"><option value="">All domains</option></select></label><label>Response status<select id="log-status"><option value="">All responses</option><option value="2">Successful · 2xx</option><option value="3">Redirects · 3xx</option><option value="4">Client errors · 4xx</option><option value="5">Server errors · 5xx</option></select></label></div></div>
<p id="log-summary" class="muted feature-note">No requests in the current view. <span id="log-last-checked">Not checked yet.</span></p>
<p class="muted feature-note">Recent requests handled by Caddy. Sensitive request headers are never displayed.</p>
<div class="log-section-heading diagnostic-section-heading"><p class="eyebrow">Access logs</p><h2>Access requests</h2><p class="muted">Requests handled by configured domains. Sensitive headers are never displayed.</p></div><div class="table-wrap log-table-wrap diagnostic-list"><table class="log-table"><thead><tr><th>Time</th><th>Domain</th><th>Request</th><th>Status</th><th>Duration</th></tr></thead><tbody id="log-rows"></tbody></table></div>
<section class="dashboard-panel">
<div class="panel-heading"><div><p class="eyebrow">Access logs</p><h2>Access requests</h2><p class="muted">Requests handled by configured domains. Sensitive headers are never displayed.</p></div></div>
<div class="log-filters"><label>Domain<select id="log-host"><option value="">All domains</option></select></label><label>Response status<select id="log-status"><option value="">All responses</option><option value="2">Successful · 2xx</option><option value="3">Redirects · 3xx</option><option value="4">Client errors · 4xx</option><option value="5">Server errors · 5xx</option></select></label></div>
<p id="log-summary" class="muted feature-note">No requests in the current view. <span id="log-last-checked">Not checked yet.</span></p>
<div class="table-wrap log-table-wrap"><table class="log-table"><thead><tr><th>Time</th><th>Domain</th><th>Request</th><th>Status</th><th>Duration</th></tr></thead><tbody id="log-rows"></tbody></table></div>
</section>
<section class="dashboard-panel log-activity"><div class="panel-heading"><div><p class="eyebrow">Gateway events</p><h2>Activity and errors</h2><p class="muted">Configuration, certificate, and health events recorded by Site Gateway.</p></div></div><div class="event-filters"><label>Severity<select id="event-severity"><option value="">All severities</option><option value="ok">Normal</option><option value="warning">Warnings</option><option value="error">Errors</option></select></label><label>Category<select id="event-category"><option value="">All categories</option><option value="configuration">Configuration</option><option value="certificate">Certificates / TLS</option><option value="health">Upstream health</option><option value="authentication">Authentication</option><option value="backup">Backups</option><option value="system">System</option></select></label></div><div id="gateway-log-list" class="dashboard-list event-list diagnostic-list"></div></section>
</section>
<section id="performance-view" class="feature-view hidden">
<div class="log-toolbar"><div class="log-filters"><label>Domain<select id="performance-host"><option value="">All domains</option></select></label><label>Range<select id="performance-range"><option value="1">Last hour</option><option value="3">Last 3 hours</option><option value="6" selected>Last 6 hours</option><option value="12">Last 12 hours</option><option value="24">Last 24 hours</option><option value="72">Last 3 days</option><option value="168">Last 7 days</option></select></label></div></div>
<p id="performance-summary" class="muted feature-note">No requests recorded yet. <span id="performance-last-checked">Not checked yet.</span></p>
<section class="dashboard-panel">
<div class="panel-heading"><div><p class="eyebrow">Trend</p><h2 id="performance-trend-title">Requests · last 6 hours</h2></div></div>
<div class="log-filters"><label>Domain<select id="performance-host"><option value="">All domains</option></select></label><label>Range<select id="performance-range"><option value="1">Last hour</option><option value="3">Last 3 hours</option><option value="6" selected>Last 6 hours</option><option value="12">Last 12 hours</option><option value="24">Last 24 hours</option><option value="72">Last 3 days</option><option value="168">Last 7 days</option></select></label></div>
<p id="performance-summary" class="muted feature-note">No requests recorded yet. <span id="performance-last-checked">Not checked yet.</span></p>
<div class="performance-sparkline-wrap">
<svg id="performance-sparkline" class="performance-sparkline" viewBox="0 0 600 140" preserveAspectRatio="none" aria-label="Request volume trend"></svg>
<div id="performance-sparkline-labels" class="performance-sparkline-labels"></div>
@@ -153,7 +155,7 @@
<section class="dashboard-panel">
<div class="panel-heading"><div><p class="eyebrow">Per-route</p><h2>Throughput by domain</h2></div></div>
<p class="muted feature-note">Requests, error rate, and average response time for each configured domain.</p>
<div class="table-wrap performance-table-wrap"><table class="performance-table"><thead><tr><th>Domain</th><th>Last hour</th><th>Last 24h</th><th>Errors (24h)</th><th>Avg. response</th></tr></thead><tbody id="performance-rows"></tbody></table></div>
<div class="table-wrap performance-table-wrap"><table class="performance-table"><thead><tr><th>Domain</th><th>Last hour</th><th>Last 24h</th><th>Avg. response</th></tr></thead><tbody id="performance-rows"></tbody></table></div>
</section>
</section>
<section id="users-view" class="feature-view hidden">
+7 -7
View File
@@ -57,7 +57,7 @@ main{padding-top:24px}.utility-bar{display:flex;align-items:center;justify-conte
dialog{max-height:calc(100vh - 28px);overflow:auto}
.setup-dialog{width:min(520px,calc(100% - 28px))}.setup-dialog::backdrop{background:rgba(2,7,14,.9)}.setup-card{max-width:none}.setup-card .brand-mark{margin-bottom:24px}.setup-card h1{margin:0 0 10px;font-size:clamp(1.8rem,5vw,2.35rem);letter-spacing:-.04em}.setup-card>.muted{margin-bottom:22px}.setup-card .button{margin-top:20px}
.feature-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.certificates-view .feature-summary,#certificates-view .feature-summary{grid-template-columns:repeat(5,minmax(0,1fr))}.certificate-row{margin:0;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent}.certificate-row:first-child{border-top:0}.certificate-row summary{display:grid;grid-template-columns:auto minmax(180px,1.2fr) minmax(220px,1fr);align-items:center;gap:16px;padding:18px 20px}.certificate-row summary>span{display:grid;gap:4px}.certificate-row small{color:var(--muted)}.certificate-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 22px;margin:0;padding:18px 54px 22px;background:rgba(8,16,29,.22);border-top:1px solid var(--line)}.certificate-details dt{color:var(--muted);font-size:.7rem}.certificate-details dd{margin:5px 0 0;overflow-wrap:anywhere;font-size:.8rem}.readiness-panel{margin-top:18px}.issue-link{width:100%;border:0;background:transparent;color:var(--text);text-align:left;cursor:pointer}.issue-link:hover{background:var(--panel2)}@media(max-width:900px){#certificates-view .feature-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.feature-toolbar{align-items:stretch;flex-direction:column}.feature-toolbar .row-actions{justify-content:stretch}.feature-toolbar .button{flex:1}.certificate-row summary{grid-template-columns:auto 1fr}.certificate-row summary>span:last-child{grid-column:2}.certificate-details{grid-template-columns:1fr;padding-left:52px}}
.settings-panel{max-width:none}.log-filters{display:flex;align-items:end;gap:12px}.log-filters label{min-width:210px;margin:0}#log-host,#log-status{width:100%;height:44px;min-height:44px;box-sizing:border-box;padding:0 12px;line-height:42px}.certificate-row summary{cursor:pointer}.certificate-row summary:hover{background:rgba(98,230,167,.06)}.certificate-row summary:focus{outline:none}.certificate-row summary:focus-visible{outline:2px solid var(--green);outline-offset:-2px}.certificate-details .danger-text{color:var(--danger)}#log-last-checked{color:var(--muted)}@media(max-width:760px){.log-filters{align-items:stretch;flex-direction:column}.log-filters label{min-width:0}}
.settings-panel{max-width:none}.log-filters{display:flex;align-items:end;gap:12px}.log-filters label{min-width:210px;margin:0}.dashboard-panel>.log-filters{margin-bottom:16px}#log-host,#log-status{width:100%;height:44px;min-height:44px;box-sizing:border-box;padding:0 12px;line-height:42px}.certificate-row summary{cursor:pointer}.certificate-row summary:hover{background:rgba(98,230,167,.06)}.certificate-row summary:focus{outline:none}.certificate-row summary:focus-visible{outline:2px solid var(--green);outline-offset:-2px}.certificate-details .danger-text{color:var(--danger)}#log-last-checked{color:var(--muted)}@media(max-width:760px){.log-filters{align-items:stretch;flex-direction:column}.log-filters label{min-width:0}}
.access-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:18px}.access-card h2{margin-top:20px}.access-card-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:20px}.access-card-stats span{display:grid;gap:4px}.access-card-stats strong{font-size:1.15rem}.access-card-stats small{color:var(--muted);font-size:.68rem}#access-list{border:0;background:transparent;overflow:visible;padding:0}.group-card{min-height:0}
.credential-editor{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}.credential-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.credential-editor-heading strong{font-size:.9rem}.credential-editor>.muted{font-size:.75rem;margin:7px 0}.credential-row{display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:8px;margin-top:9px}.credential-row input{margin-top:0}.credential-row .button{padding:10px 11px;font-size:.72rem}@media(max-width:600px){.credential-row{grid-template-columns:1fr 1fr}.credential-row .button{grid-column:2;justify-self:end}}
#app input,#app select,#app textarea{box-sizing:border-box}#app select{height:44px;min-height:44px;padding-top:0;padding-bottom:0;line-height:42px}
@@ -272,9 +272,9 @@ select{appearance:none!important;-webkit-appearance:none!important;background-re
.performance-table{width:100%;border-collapse:collapse;font-size:.82rem;table-layout:fixed}
.performance-table th,.performance-table td{padding:13px 15px;text-align:left;border-top:1px solid var(--line);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.performance-table thead th{border-top:0;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;white-space:normal}
.performance-table th:nth-child(1),.performance-table td:nth-child(1){width:32%}
.performance-table th:nth-child(2),.performance-table td:nth-child(2){width:14%}
.performance-table th:nth-child(3),.performance-table td:nth-child(3){width:14%}
.performance-table th:nth-child(4),.performance-table td:nth-child(4){width:19%;text-align:center}
.performance-table th:nth-child(5),.performance-table td:nth-child(5){width:21%}
@media(max-width:760px){.performance-table th:nth-child(2),.performance-table td:nth-child(2),.performance-table th:nth-child(3),.performance-table td:nth-child(3){display:none}.performance-table th:nth-child(1),.performance-table td:nth-child(1){width:46%}.performance-table th:nth-child(4),.performance-table td:nth-child(4){width:27%}.performance-table th:nth-child(5),.performance-table td:nth-child(5){width:27%}}
.performance-table th:nth-child(1),.performance-table td:nth-child(1){width:34%}
.performance-table th:nth-child(2),.performance-table td:nth-child(2){width:20%;text-align:center}
.performance-table th:nth-child(3),.performance-table td:nth-child(3){width:23%;text-align:center}
.performance-table th:nth-child(4),.performance-table td:nth-child(4){width:23%;text-align:center}
.performance-table .count-divider{color:var(--muted);margin:0 2px}
@media(max-width:760px){.performance-table th:nth-child(2),.performance-table td:nth-child(2){display:none}.performance-table th:nth-child(1),.performance-table td:nth-child(1){width:40%}.performance-table th:nth-child(3),.performance-table td:nth-child(3){width:30%}.performance-table th:nth-child(4),.performance-table td:nth-child(4){width:30%}}