- Add unit tests (hostname-validator, TLDs, payload-schemas) and integration tests for message handler registry - Refactor native host message router into handler registry (handlers/state, tunnels, ssh, rdp, backup, ca, connections) - Add ESLint config and npm test + lint steps in CI - Dashboard: visibility-based refresh pause, configurable refresh interval (2s/5s/10s/paused) - Accessibility: ARIA on nav and modals, focus trap and restore, prefers-reduced-motion - Empty states: primary action buttons for virtual hosts, servers, service tunnels - Native host rate limiting for backup and CA operations; update SECURITY.md - CONTRIBUTING: "Adding a new dashboard page", dev workflow; add npm run dev script
This commit is contained in:
@@ -35,11 +35,13 @@ function updateSettingsUI() {
|
||||
const backupRetentionEl = $('backupRetention');
|
||||
const backupIntervalEl = $('backupIntervalHours');
|
||||
const latencyPingIntervalEl = $('latencyPingIntervalMs');
|
||||
const dashboardRefreshEl = $('dashboardRefreshIntervalMs');
|
||||
if (proxyPortEl) proxyPortEl.value = settings.proxyPort ?? SETTINGS_DEFAULTS.proxyPort;
|
||||
if (readyTimeoutMsEl) readyTimeoutMsEl.value = settings.readyTimeoutMs ?? SETTINGS_DEFAULTS.readyTimeoutMs;
|
||||
if (backupRetentionEl) backupRetentionEl.value = settings.backupRetention ?? SETTINGS_DEFAULTS.backupRetention;
|
||||
if (backupIntervalEl) backupIntervalEl.value = settings.backupIntervalHours ?? SETTINGS_DEFAULTS.backupIntervalHours;
|
||||
if (latencyPingIntervalEl) latencyPingIntervalEl.value = (settings.latencyPingIntervalMs ?? SETTINGS_DEFAULTS.latencyPingIntervalMs) / 1000;
|
||||
if (dashboardRefreshEl) dashboardRefreshEl.value = String(settings.dashboardRefreshIntervalMs ?? SETTINGS_DEFAULTS.dashboardRefreshIntervalMs ?? 2000);
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
@@ -57,6 +59,8 @@ function saveSettings() {
|
||||
settings.latencyPingIntervalMs = isNaN(pingSecs) || pingSecs <= 0
|
||||
? SETTINGS_DEFAULTS.latencyPingIntervalMs
|
||||
: Math.round(pingSecs * 1000);
|
||||
const refreshVal = parseInt($('dashboardRefreshIntervalMs')?.value, 10);
|
||||
settings.dashboardRefreshIntervalMs = ([0, 2000, 5000, 10000].includes(refreshVal) ? refreshVal : SETTINGS_DEFAULTS.dashboardRefreshIntervalMs);
|
||||
chrome.runtime.sendMessage(
|
||||
{ target: 'holesail-native', action: 'send', payload: { type: 'updateSettings', payload: { ...settings } } },
|
||||
(response) => {
|
||||
@@ -66,6 +70,7 @@ function saveSettings() {
|
||||
_clearSettingsDirty();
|
||||
// Restart the ping interval so the new interval / enabled state takes effect immediately
|
||||
if (typeof window._restartPingInterval === 'function') window._restartPingInterval();
|
||||
if (typeof window._restartRefreshInterval === 'function') window._restartRefreshInterval();
|
||||
if (response.requiresRestart) {
|
||||
showToast('Settings saved — restart the native host for proxy port changes to take effect', 'warning');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user