feat: implement 13 features — auto-reconnect, notifications, bulk actions, latency, traffic, theme, export/import, scheduled backups, peer lookup, SSH auto-reconnect, log filters, keyboard shortcut, and readyTimeout default
CI / Build & Test (push) Successful in 2m44s
CI / Build & Test (push) Successful in 2m44s
- Change readyTimeoutMs default from 0 to 30000 in both state files - Register Alt+Shift+H keyboard shortcut via manifest _execute_action command - Add severity filter buttons (All/Info/Warn/Error) and Download .txt to Logs page; background logs.js now tags entries with proper level field - Fire browser notifications on tunnelError events (notifyOnTunnelError setting) - Add exponential-backoff auto-reconnect for virtual hosts and service tunnels (tunnelAutoReconnect setting, 5s–120s backoff) - Add backupIntervalHours setting and scheduled auto-backup timer in message-router.js - Add TCP connect latency badges to Virtual Hosts and Service Tunnels tables via new pingTunnel native message - Add bytesIn/bytesOut/requests counters to https-proxy.js; expose in Overview status bar via getState - Add Export/Import connection configs (JSON, no CA key) in Settings - Add autoReconnect flag and exponential-backoff reconnect to SSH connection cards - Add light theme CSS variables and theme toggle in Settings (persisted to localStorage) - Add checkbox column and bulk Stop/Remove actions to Virtual Hosts, Service Tunnels, and Servers tables - Add Peer Lookup UI card on Overview page using existing lookup message handler
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
// ui/toast.js (showToast, copyToClipboard), ui/modal.js (openModal),
|
||||
// data/hostname-validator.js (isValidVhostHostname)
|
||||
|
||||
function _updateVhostBulkBar() {
|
||||
const checked = document.querySelectorAll('#connectionsTable input[type="checkbox"]:checked');
|
||||
const bar = $('vhostBulkBar');
|
||||
const countEl = $('vhostBulkCount');
|
||||
if (!bar) return;
|
||||
if (checked.length > 0) {
|
||||
bar.style.display = 'flex';
|
||||
if (countEl) countEl.textContent = checked.length + ' selected';
|
||||
} else {
|
||||
bar.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function updateConnectionsTable(state) {
|
||||
const tbody = $('connectionsTable');
|
||||
if (!tbody) return;
|
||||
@@ -9,13 +22,14 @@ function updateConnectionsTable(state) {
|
||||
|
||||
if (virtualHosts.length === 0) {
|
||||
tbody.innerHTML = `
|
||||
<tr><td colspan="5">
|
||||
<tr><td colspan="6">
|
||||
<div class="empty-state">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="2"/><circle cx="4" cy="6" r="2"/><circle cx="20" cy="6" r="2"/><circle cx="4" cy="18" r="2"/><circle cx="20" cy="18" r="2"/><line x1="6" y1="6" x2="10" y2="11"/><line x1="18" y1="6" x2="14" y2="11"/><line x1="6" y1="18" x2="10" y2="13"/><line x1="18" y1="18" x2="14" y2="13"/></svg>
|
||||
<div class="empty-state-title">No virtual hosts</div>
|
||||
<div class="empty-state-desc">Click "Add Host" to assign a hostname to an hs:// tunnel</div>
|
||||
</div>
|
||||
</td></tr>`;
|
||||
_updateVhostBulkBar();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,6 +42,7 @@ function updateConnectionsTable(state) {
|
||||
const needsReconnect = v.state === 'error' || v.state === 'closed';
|
||||
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>
|
||||
<div style="display:flex;align-items:center;gap:6px;">
|
||||
@@ -39,7 +54,10 @@ function updateConnectionsTable(state) {
|
||||
</div>
|
||||
</td>
|
||||
<td class="mono" style="font-size:11px;color:var(--text3);">${escapeHtml(backend)}</td>
|
||||
<td>${stateTag(v.state)}</td>
|
||||
<td>
|
||||
${stateTag(v.state)}
|
||||
${v.localPort != null ? `<span class="latency-badge" data-ping-host="127.0.0.1" data-ping-port="${v.localPort}" style="margin-left:4px;font-size:10px;color:var(--text4);">…ms</span>` : ''}
|
||||
</td>
|
||||
<td>
|
||||
<div style="display:flex;align-items:center;gap:6px;">
|
||||
<a href="${openUrl}" target="_blank" rel="noopener" class="btn btn-secondary btn-sm">
|
||||
@@ -59,6 +77,10 @@ function updateConnectionsTable(state) {
|
||||
</tr>`;
|
||||
}).join('');
|
||||
|
||||
tbody.querySelectorAll('.vhost-row-cb').forEach(cb => {
|
||||
cb.addEventListener('change', _updateVhostBulkBar);
|
||||
});
|
||||
|
||||
tbody.querySelectorAll('[data-copy]').forEach(btn => {
|
||||
btn.addEventListener('click', () => copyToClipboard(btn.dataset.copy, btn));
|
||||
});
|
||||
@@ -92,9 +114,30 @@ function updateConnectionsTable(state) {
|
||||
openModal('modal-removeVhost');
|
||||
});
|
||||
});
|
||||
|
||||
_updateVhostBulkBar();
|
||||
}
|
||||
|
||||
function setupVirtualHostEvents() {
|
||||
$('vhostSelectAll')?.addEventListener('change', (e) => {
|
||||
document.querySelectorAll('#connectionsTable .vhost-row-cb').forEach(cb => { cb.checked = e.target.checked; });
|
||||
_updateVhostBulkBar();
|
||||
});
|
||||
|
||||
$('btnVhostBulkRemove')?.addEventListener('click', () => {
|
||||
const checked = Array.from(document.querySelectorAll('#connectionsTable .vhost-row-cb:checked'));
|
||||
if (!checked.length) return;
|
||||
const hostnames = checked.map(cb => cb.dataset.hostname);
|
||||
if (!confirm('Remove ' + hostnames.length + ' virtual host(s)?')) return;
|
||||
let done = 0;
|
||||
for (const hostname of hostnames) {
|
||||
chrome.runtime.sendMessage(
|
||||
{ target: 'holesail-native', action: 'send', payload: { type: 'removeVirtualHost', payload: { hostname } } },
|
||||
() => { done++; if (done === hostnames.length) { showToast(hostnames.length + ' host(s) removed', 'success'); refresh(); } }
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
$('addVhostBtn')?.addEventListener('click', () => openModal('modal-addVhost'));
|
||||
|
||||
$('addVhostSubmit')?.addEventListener('click', () => {
|
||||
|
||||
Reference in New Issue
Block a user