feat(pwa): experimental — add my.dash.board virtual host for secure PWA install
CI / Build & Test (push) Successful in 2m51s
CI / Build & Test (push) Successful in 2m51s
Serve the dashboard over a local HTTPS virtual host (my.dash.board) so Chrome treats it as a secure origin and shows the PWA install prompt. - Add native-host/dashboard-server.js: bare-http1 static file server backed by bare-bundle assets in distribution mode, disk fallback in dev - Add setLocalVirtualHost() to virtual-hosts.js; type:local entries are protected from removal and filtered out of saveState persistence - Export setLocalVirtualHost from holesail-manager/index.js - Start dashboard server in startup.js after proxies are ready and register my.dash.board as a local virtual host - Stop dashboard server in message-router.js cleanup() - Update manifest.webmanifest: start_url, id, scope → https://my.dash.board/ - Embed all extension/dashboard/ files as bare-bundle assets in build-distributable.js patchBundle() — no installer copy step needed - Hide checkbox, hs:// URL, Reconnect, and Remove controls for built-in my.dash.board row in the virtual hosts table UI
This commit is contained in:
@@ -54,18 +54,23 @@ function updateConnectionsTable(state) {
|
||||
const openUrl = `https://${hostname}`;
|
||||
const safeHostname = hostname.replace(/"/g, '"');
|
||||
const needsReconnect = v.state === 'error' || v.state === 'closed';
|
||||
const isBuiltIn = v.type === 'local';
|
||||
return `
|
||||
<tr>
|
||||
<td style="width:32px;"><input type="checkbox" class="vhost-row-cb" data-hostname="${safeHostname}"></td>
|
||||
<td><span class="mono-chip">${escapeHtml(hostname)}</span></td>
|
||||
<td style="width:32px;">${isBuiltIn ? '' : `<input type="checkbox" class="vhost-row-cb" data-hostname="${safeHostname}">`}</td>
|
||||
<td>
|
||||
<span class="mono-chip">${escapeHtml(hostname)}</span>
|
||||
${isBuiltIn ? '<span style="font-size:10px;color:var(--text4);margin-left:4px;">built-in</span>' : ''}
|
||||
</td>
|
||||
<td>
|
||||
${isBuiltIn ? '<span style="color:var(--text4);font-size:11px;">—</span>' : `
|
||||
<div style="display:flex;align-items:center;gap:6px;">
|
||||
<span class="mono" title="${escapeHtml(hsUrl)}" style="color:var(--text3);font-size:11px;">${truncate(hsUrl, 28)}</span>
|
||||
<button class="btn-icon copy-btn" data-copy="${escapeHtml(hsUrl)}" title="Copy hs:// URL" style="flex-shrink:0;">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
||||
<span class="copy-tooltip">Copied!</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>`}
|
||||
</td>
|
||||
<td class="mono" style="font-size:11px;color:var(--text3);">${escapeHtml(backend)}</td>
|
||||
<td>
|
||||
@@ -78,14 +83,14 @@ function updateConnectionsTable(state) {
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15,3 21,3 21,9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
||||
Open
|
||||
</a>
|
||||
${needsReconnect ? `<button class="btn btn-secondary btn-sm" data-reconnect-vhost="${safeHostname}" data-hs-url="${escapeHtml(hsUrl)}" title="Reconnect tunnel">
|
||||
${!isBuiltIn && needsReconnect ? `<button class="btn btn-secondary btn-sm" data-reconnect-vhost="${safeHostname}" data-hs-url="${escapeHtml(hsUrl)}" title="Reconnect tunnel">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23,4 23,10 17,10"/><path d="M20.49 15a9 9 0 1 1-.07-8.13"/></svg>
|
||||
Reconnect
|
||||
</button>` : ''}
|
||||
<button class="btn btn-danger btn-sm" data-remove-vhost="${safeHostname}">
|
||||
${isBuiltIn ? '' : `<button class="btn btn-danger btn-sm" data-remove-vhost="${safeHostname}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3,6 5,6 21,6"/><path d="M19,6l-1,14a2,2,0,0,1-2,2H8a2,2,0,0,1-2-2L5,6"/></svg>
|
||||
Remove
|
||||
</button>
|
||||
</button>`}
|
||||
</div>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
Reference in New Issue
Block a user