@lethevimlet/sshift 1.8.3 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example.config.json +3 -1
- package/package.json +1 -1
- package/src/server/endpoints/rest/auth.js +186 -17
- package/src/server/endpoints/rest/bookmarks.js +54 -23
- package/src/server/endpoints/rest/config.js +3 -2
- package/src/server/endpoints/rest/system.js +89 -69
- package/src/server/endpoints/ws/tabs.js +5 -2
- package/src/server/index.js +4 -3
- package/src/server/utils/bookmark-encryption.js +155 -0
- package/src/server/utils/config.js +59 -4
- package/src/server/utils/tab-manager.js +15 -1
- package/src/webapp/index.html +25 -1
- package/src/webapp/js/app.js +163 -36
package/src/webapp/js/app.js
CHANGED
|
@@ -79,6 +79,7 @@ class SSHIFTClient {
|
|
|
79
79
|
|
|
80
80
|
// Password protection state
|
|
81
81
|
this.passwordEnabled = false;
|
|
82
|
+
this.bookmarkEncryptionEnabled = false;
|
|
82
83
|
this.authToken = localStorage.getItem('sshift_auth_token') || null;
|
|
83
84
|
|
|
84
85
|
this._origFetch = window.fetch.bind(window);
|
|
@@ -158,6 +159,7 @@ class SSHIFTClient {
|
|
|
158
159
|
this.imageAddonEnabled = config.imageAddonEnabled !== undefined ? config.imageAddonEnabled : true;
|
|
159
160
|
this.scrollback = config.scrollback || 10000;
|
|
160
161
|
this.passwordEnabled = config.passwordEnabled || false;
|
|
162
|
+
this.bookmarkEncryptionEnabled = config.bookmarkEncryptionEnabled === true;
|
|
161
163
|
console.log('[SSHIFT] Loaded from server - Sticky:', this.sticky ? 'enabled' : 'disabled',
|
|
162
164
|
'Take Control Default:', this.takeControlDefault ? 'enabled' : 'disabled',
|
|
163
165
|
'Keepalive Interval:', this.sshKeepaliveInterval,
|
|
@@ -188,6 +190,8 @@ class SSHIFTClient {
|
|
|
188
190
|
const response = await this._origFetch('/api/auth/status');
|
|
189
191
|
const data = await response.json();
|
|
190
192
|
this.passwordEnabled = data.passwordEnabled;
|
|
193
|
+
this.bookmarkEncryptionEnabled = data.bookmarkEncryptionEnabled === true;
|
|
194
|
+
if (this.bookmarkEncryptionEnabled) this.clearSensitiveTabStorage();
|
|
191
195
|
|
|
192
196
|
if (!this.passwordEnabled) {
|
|
193
197
|
if (lockScreen) lockScreen.style.display = 'none';
|
|
@@ -257,6 +261,7 @@ class SSHIFTClient {
|
|
|
257
261
|
this.updateSocketAuth();
|
|
258
262
|
lockScreen.style.display = 'none';
|
|
259
263
|
this.passwordEnabled = true;
|
|
264
|
+
if (this.bookmarkEncryptionEnabled) this.clearSensitiveTabStorage();
|
|
260
265
|
lockScreenForm.removeEventListener('submit', submitHandler);
|
|
261
266
|
resolve();
|
|
262
267
|
} else {
|
|
@@ -291,7 +296,10 @@ class SSHIFTClient {
|
|
|
291
296
|
title: 'Disable Password Protection',
|
|
292
297
|
label: 'Enter current password',
|
|
293
298
|
confirmText: 'Disable',
|
|
294
|
-
requireConfirm: false
|
|
299
|
+
requireConfirm: false,
|
|
300
|
+
message: this.bookmarkEncryptionEnabled
|
|
301
|
+
? 'Bookmark connection data will be decrypted and stored in plaintext before password protection is disabled.'
|
|
302
|
+
: ''
|
|
295
303
|
}, async (password) => {
|
|
296
304
|
try {
|
|
297
305
|
const resp = await fetch('/api/auth/remove-password', {
|
|
@@ -316,16 +324,21 @@ class SSHIFTClient {
|
|
|
316
324
|
title: 'Enable Password Protection',
|
|
317
325
|
label: 'Set a password',
|
|
318
326
|
confirmText: 'Enable',
|
|
319
|
-
requireConfirm: true
|
|
320
|
-
|
|
327
|
+
requireConfirm: true,
|
|
328
|
+
showEncryptionOption: true
|
|
329
|
+
}, async (password, options) => {
|
|
321
330
|
try {
|
|
322
331
|
const resp = await fetch('/api/auth/set-password', {
|
|
323
332
|
method: 'POST',
|
|
324
333
|
headers: { 'Content-Type': 'application/json' },
|
|
325
|
-
body: JSON.stringify({
|
|
334
|
+
body: JSON.stringify({
|
|
335
|
+
newPassword: password,
|
|
336
|
+
encryptBookmarks: options.encryptBookmarks
|
|
337
|
+
})
|
|
326
338
|
});
|
|
327
339
|
|
|
328
340
|
if (resp.ok) {
|
|
341
|
+
if (options.encryptBookmarks) this.clearSensitiveTabStorage();
|
|
329
342
|
location.reload();
|
|
330
343
|
} else {
|
|
331
344
|
const data = await resp.json();
|
|
@@ -346,6 +359,9 @@ class SSHIFTClient {
|
|
|
346
359
|
const confirmInput = document.getElementById('passwordModalConfirmInput');
|
|
347
360
|
const confirmGroup = document.getElementById('confirmPasswordGroup');
|
|
348
361
|
const errorEl = document.getElementById('passwordModalError');
|
|
362
|
+
const messageEl = document.getElementById('passwordModalMessage');
|
|
363
|
+
const encryptionGroup = document.getElementById('passwordModalEncryptionGroup');
|
|
364
|
+
const encryptionToggle = document.getElementById('passwordModalEncryptionToggle');
|
|
349
365
|
const submitBtn = document.getElementById('passwordModalSubmit');
|
|
350
366
|
const cancelBtn = document.getElementById('passwordModalCancel');
|
|
351
367
|
const closeBtn = document.getElementById('closePasswordModal');
|
|
@@ -356,6 +372,14 @@ class SSHIFTClient {
|
|
|
356
372
|
input.value = '';
|
|
357
373
|
confirmInput.value = '';
|
|
358
374
|
errorEl.style.display = 'none';
|
|
375
|
+
if (messageEl) {
|
|
376
|
+
messageEl.textContent = options.message || '';
|
|
377
|
+
messageEl.style.display = options.message ? 'block' : 'none';
|
|
378
|
+
}
|
|
379
|
+
if (encryptionGroup) {
|
|
380
|
+
encryptionGroup.style.display = options.showEncryptionOption ? 'block' : 'none';
|
|
381
|
+
}
|
|
382
|
+
if (encryptionToggle) encryptionToggle.checked = false;
|
|
359
383
|
|
|
360
384
|
if (options.requireConfirm) {
|
|
361
385
|
confirmGroup.style.display = 'block';
|
|
@@ -385,7 +409,9 @@ class SSHIFTClient {
|
|
|
385
409
|
return;
|
|
386
410
|
}
|
|
387
411
|
cleanup();
|
|
388
|
-
await onSubmit(password
|
|
412
|
+
await onSubmit(password, {
|
|
413
|
+
encryptBookmarks: !!(encryptionToggle && encryptionToggle.checked)
|
|
414
|
+
});
|
|
389
415
|
};
|
|
390
416
|
|
|
391
417
|
const handleCancel = () => { cleanup(); if (onCancel) onCancel(); };
|
|
@@ -414,6 +440,11 @@ class SSHIFTClient {
|
|
|
414
440
|
label.textContent = 'Enable Password';
|
|
415
441
|
}
|
|
416
442
|
}
|
|
443
|
+
const encryptionToggle = document.getElementById('bookmarkEncryptionToggle');
|
|
444
|
+
if (encryptionToggle) {
|
|
445
|
+
encryptionToggle.checked = this.bookmarkEncryptionEnabled;
|
|
446
|
+
encryptionToggle.disabled = !this.passwordEnabled;
|
|
447
|
+
}
|
|
417
448
|
}
|
|
418
449
|
|
|
419
450
|
// Update sticky checkbox to reflect loaded value
|
|
@@ -490,7 +521,9 @@ class SSHIFTClient {
|
|
|
490
521
|
sessionId,
|
|
491
522
|
name: session.name,
|
|
492
523
|
type: session.type,
|
|
493
|
-
|
|
524
|
+
// When bookmark encryption is enabled, do not create a second
|
|
525
|
+
// plaintext-at-rest copy in this browser's sticky-tab cache.
|
|
526
|
+
connectionData: this.bookmarkEncryptionEnabled ? {} : session.connectionData,
|
|
494
527
|
active: sessionId === activeInThisPanel, // Active in this specific panel
|
|
495
528
|
panelId: effectivePanelId
|
|
496
529
|
});
|
|
@@ -506,7 +539,8 @@ class SSHIFTClient {
|
|
|
506
539
|
: (this.currentLayout?.id || 'single');
|
|
507
540
|
const tabsData = {
|
|
508
541
|
tabs,
|
|
509
|
-
layout: savedLayout
|
|
542
|
+
layout: savedLayout,
|
|
543
|
+
activeSessionId: this.activeSessionId
|
|
510
544
|
};
|
|
511
545
|
|
|
512
546
|
// Debounce + dedup: collapse rapid-fire saveTabs calls into one
|
|
@@ -544,6 +578,27 @@ class SSHIFTClient {
|
|
|
544
578
|
}
|
|
545
579
|
}
|
|
546
580
|
|
|
581
|
+
clearSensitiveTabStorage() {
|
|
582
|
+
try {
|
|
583
|
+
if (this._saveTabsTimer) {
|
|
584
|
+
clearTimeout(this._saveTabsTimer);
|
|
585
|
+
this._saveTabsTimer = null;
|
|
586
|
+
}
|
|
587
|
+
this._saveTabsSignature = null;
|
|
588
|
+
const saved = localStorage.getItem('openTabs');
|
|
589
|
+
if (!saved) return;
|
|
590
|
+
const data = JSON.parse(saved);
|
|
591
|
+
const tabs = Array.isArray(data) ? data : data.tabs;
|
|
592
|
+
if (!Array.isArray(tabs)) return;
|
|
593
|
+
tabs.forEach(tab => {
|
|
594
|
+
if (tab && tab.connectionData) tab.connectionData = {};
|
|
595
|
+
});
|
|
596
|
+
localStorage.setItem('openTabs', JSON.stringify(data));
|
|
597
|
+
} catch (err) {
|
|
598
|
+
console.warn('[SSHIFT] Failed to scrub sensitive sticky-tab data:', err);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
547
602
|
clearTabs() {
|
|
548
603
|
localStorage.removeItem('openTabs');
|
|
549
604
|
}
|
|
@@ -631,7 +686,7 @@ class SSHIFTClient {
|
|
|
631
686
|
}
|
|
632
687
|
|
|
633
688
|
// Distribute tabs across panels when layout changes
|
|
634
|
-
distributeTabsToPanels(syncedTabs = null) {
|
|
689
|
+
distributeTabsToPanels(syncedTabs = null, preferredActiveSessionId = null) {
|
|
635
690
|
// Get all sessions
|
|
636
691
|
const allSessions = [...this.sessions.keys(), ...this.sftpSessions.keys()];
|
|
637
692
|
if (allSessions.length === 0) return;
|
|
@@ -665,12 +720,26 @@ class SSHIFTClient {
|
|
|
665
720
|
});
|
|
666
721
|
});
|
|
667
722
|
|
|
668
|
-
// Restore active sessions per panel
|
|
723
|
+
// Restore active sessions per local panel. Synced desktop panel IDs do
|
|
724
|
+
// not exist on mobile, so map them to the same fallback used above.
|
|
669
725
|
const activatedPanels = new Set();
|
|
726
|
+
if (preferredActiveSessionId) {
|
|
727
|
+
const preferredTab = syncedTabs.find(tabData => tabData.sessionId === preferredActiveSessionId);
|
|
728
|
+
if (preferredTab) {
|
|
729
|
+
const targetPanel = preferredTab.panelId && panels.includes(preferredTab.panelId)
|
|
730
|
+
? preferredTab.panelId
|
|
731
|
+
: clockwisePanels[0];
|
|
732
|
+
this.switchTab(preferredTab.sessionId, targetPanel);
|
|
733
|
+
activatedPanels.add(targetPanel);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
670
736
|
syncedTabs.forEach(tabData => {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
737
|
+
const targetPanel = tabData.panelId && panels.includes(tabData.panelId)
|
|
738
|
+
? tabData.panelId
|
|
739
|
+
: clockwisePanels[0];
|
|
740
|
+
if (tabData.active && !activatedPanels.has(targetPanel)) {
|
|
741
|
+
this.switchTab(tabData.sessionId, targetPanel);
|
|
742
|
+
activatedPanels.add(targetPanel);
|
|
674
743
|
}
|
|
675
744
|
});
|
|
676
745
|
} else {
|
|
@@ -3340,25 +3409,19 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
|
|
|
3340
3409
|
const savedLayoutId = this.loadCurrentLayout();
|
|
3341
3410
|
const layout = this.layouts.find(l => l.id === savedLayoutId) || this.layouts[0];
|
|
3342
3411
|
|
|
3343
|
-
// Check if we should defer layout application (sticky mode with saved tabs)
|
|
3344
|
-
const savedData = this.loadTabs();
|
|
3345
|
-
const savedTabs = Array.isArray(savedData) ? savedData : (savedData?.tabs || []);
|
|
3346
|
-
const shouldDeferLayout = this.sticky && savedTabs.length > 0;
|
|
3347
|
-
|
|
3348
3412
|
if (layout) {
|
|
3349
3413
|
this.currentLayout = layout;
|
|
3350
3414
|
this.updateLayoutActiveState(layout.id);
|
|
3351
|
-
|
|
3352
|
-
//
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3415
|
+
|
|
3416
|
+
// Layout is a per-device preference and must be rendered before tabs
|
|
3417
|
+
// arrive from the server. Tab restoration no longer applies a deferred
|
|
3418
|
+
// layout, so deferring here leaves the DOM in its default single panel.
|
|
3419
|
+
this.applyLayout(layout);
|
|
3420
|
+
// Resize terminals after initial layout (with delay for DOM to settle)
|
|
3421
|
+
setTimeout(() => this.handleResize(), 100);
|
|
3358
3422
|
}
|
|
3359
3423
|
|
|
3360
|
-
console.log('[SSHIFT] Layout system initialized with layout:', layout?.name
|
|
3361
|
-
shouldDeferLayout ? '(deferred to restoreTabs)' : '');
|
|
3424
|
+
console.log('[SSHIFT] Layout system initialized with layout:', layout?.name);
|
|
3362
3425
|
}
|
|
3363
3426
|
|
|
3364
3427
|
async loadBookmarkOrder() {
|
|
@@ -3497,7 +3560,7 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
|
|
|
3497
3560
|
// The local layout (per-device, applied by initLayoutSystem)
|
|
3498
3561
|
// already created the panels — just distribute the synced tabs
|
|
3499
3562
|
// into them.
|
|
3500
|
-
this.syncTabsFromServer(pendingData.tabs, isInitialSync, pendingData.activeTabsByPanel);
|
|
3563
|
+
this.syncTabsFromServer(pendingData.tabs, isInitialSync, pendingData.activeTabsByPanel, pendingData.activeSessionId);
|
|
3501
3564
|
} else {
|
|
3502
3565
|
// Server has no tabs (e.g. right after restart). Treat it as a
|
|
3503
3566
|
// fresh slate: clear stale localStorage and DO NOT resurrect
|
|
@@ -4745,7 +4808,7 @@ const wheelHandler = (e) => {
|
|
|
4745
4808
|
const isInitialSync = !this._initialSyncDone;
|
|
4746
4809
|
// The local per-device layout (initLayoutSystem) has already
|
|
4747
4810
|
// created the panels — distribute the synced tabs into them.
|
|
4748
|
-
this.syncTabsFromServer(data.tabs, isInitialSync, data.activeTabsByPanel);
|
|
4811
|
+
this.syncTabsFromServer(data.tabs, isInitialSync, data.activeTabsByPanel, data.activeSessionId);
|
|
4749
4812
|
} else if (!this._initialSyncDone) {
|
|
4750
4813
|
// Server has no tabs and this is the first sync. This is the
|
|
4751
4814
|
// post-restart / fresh-install / single-client-with-no-sessions
|
|
@@ -4821,6 +4884,20 @@ const wheelHandler = (e) => {
|
|
|
4821
4884
|
}
|
|
4822
4885
|
});
|
|
4823
4886
|
|
|
4887
|
+
this.socket.on('bookmark-encryption-changed', (data) => {
|
|
4888
|
+
this.bookmarkEncryptionEnabled = data.enabled === true;
|
|
4889
|
+
if (this.bookmarkEncryptionEnabled) this.clearSensitiveTabStorage();
|
|
4890
|
+
this.updatePasswordToggleUI();
|
|
4891
|
+
});
|
|
4892
|
+
|
|
4893
|
+
this.socket.on('auth-state-changed', () => {
|
|
4894
|
+
// A password was enabled, changed, or removed. Reloading clears all
|
|
4895
|
+
// decrypted bookmarks, connection credentials, and terminal history
|
|
4896
|
+
// from this page's memory before applying the new auth state.
|
|
4897
|
+
localStorage.removeItem('sshift_auth_token');
|
|
4898
|
+
location.reload();
|
|
4899
|
+
});
|
|
4900
|
+
|
|
4824
4901
|
// layout-changed / theme-changed / accent-changed handlers removed:
|
|
4825
4902
|
// layout, theme and accent are per-device preferences (localStorage)
|
|
4826
4903
|
// and are no longer broadcast between clients through the server.
|
|
@@ -4846,7 +4923,10 @@ const wheelHandler = (e) => {
|
|
|
4846
4923
|
// Tabs whose panelId doesn't exist in this device's layout fall
|
|
4847
4924
|
// back to the first panel (distributeTabsToPanels).
|
|
4848
4925
|
if (data.tabs && Array.isArray(data.tabs)) {
|
|
4849
|
-
this.
|
|
4926
|
+
if (this.isMobile) {
|
|
4927
|
+
this.reorderTabsInDOM(data.tabs.map(tab => tab.sessionId));
|
|
4928
|
+
}
|
|
4929
|
+
this.distributeTabsToPanels(data.tabs, data.activeSessionId);
|
|
4850
4930
|
}
|
|
4851
4931
|
} finally {
|
|
4852
4932
|
// Clear flag after processing
|
|
@@ -7245,10 +7325,47 @@ if (keepaliveCountMaxInput && this.sshKeepaliveCountMax) {
|
|
|
7245
7325
|
this.togglePasswordProtection();
|
|
7246
7326
|
});
|
|
7247
7327
|
}
|
|
7328
|
+
const encryptionToggle = document.getElementById('bookmarkEncryptionToggle');
|
|
7329
|
+
if (encryptionToggle) {
|
|
7330
|
+
encryptionToggle.addEventListener('change', () => {
|
|
7331
|
+
const enabled = encryptionToggle.checked;
|
|
7332
|
+
encryptionToggle.checked = this.bookmarkEncryptionEnabled;
|
|
7333
|
+
this._showPasswordModal({
|
|
7334
|
+
title: enabled ? 'Encrypt Bookmark Connections' : 'Disable Bookmark Encryption',
|
|
7335
|
+
label: 'Enter current password',
|
|
7336
|
+
confirmText: enabled ? 'Encrypt' : 'Decrypt',
|
|
7337
|
+
requireConfirm: false,
|
|
7338
|
+
message: enabled
|
|
7339
|
+
? 'Hostnames, usernames, passwords, keys, passphrases, ports, and URLs will be encrypted. If you lose this password, the connection data cannot be recovered.'
|
|
7340
|
+
: 'Connection data will be decrypted and stored in plaintext in the configuration file.'
|
|
7341
|
+
}, async (password) => {
|
|
7342
|
+
try {
|
|
7343
|
+
const response = await fetch('/api/auth/bookmark-encryption', {
|
|
7344
|
+
method: 'POST',
|
|
7345
|
+
headers: { 'Content-Type': 'application/json' },
|
|
7346
|
+
body: JSON.stringify({ currentPassword: password, enabled })
|
|
7347
|
+
});
|
|
7348
|
+
const data = await response.json();
|
|
7349
|
+
if (!response.ok) throw new Error(data.error || 'Failed to update bookmark encryption');
|
|
7350
|
+
this.bookmarkEncryptionEnabled = data.bookmarkEncryptionEnabled;
|
|
7351
|
+
if (this.bookmarkEncryptionEnabled) this.clearSensitiveTabStorage();
|
|
7352
|
+
this.updatePasswordToggleUI();
|
|
7353
|
+
await this.loadBookmarks();
|
|
7354
|
+
this.showToast(enabled ? 'Bookmark connections encrypted' : 'Bookmark encryption disabled', 'success');
|
|
7355
|
+
} catch (err) {
|
|
7356
|
+
this.updatePasswordToggleUI();
|
|
7357
|
+
this.showToast(err.message, 'error');
|
|
7358
|
+
}
|
|
7359
|
+
});
|
|
7360
|
+
});
|
|
7361
|
+
}
|
|
7248
7362
|
const logoutBtn = document.getElementById('logoutBtn');
|
|
7249
7363
|
if (logoutBtn) {
|
|
7250
7364
|
if (this.passwordEnabled) logoutBtn.style.display = '';
|
|
7251
|
-
logoutBtn.addEventListener('click', () => {
|
|
7365
|
+
logoutBtn.addEventListener('click', async () => {
|
|
7366
|
+
try {
|
|
7367
|
+
await fetch('/api/auth/logout', { method: 'POST' });
|
|
7368
|
+
} catch (_) {}
|
|
7252
7369
|
localStorage.removeItem('sshift_auth_token');
|
|
7253
7370
|
location.reload();
|
|
7254
7371
|
});
|
|
@@ -11269,7 +11386,7 @@ handleTabOpened(data) {
|
|
|
11269
11386
|
}
|
|
11270
11387
|
|
|
11271
11388
|
// Sync tabs from server (called on connect when sticky is enabled)
|
|
11272
|
-
async syncTabsFromServer(tabs, isInitialSync = false, activeTabsByPanel = null) {
|
|
11389
|
+
async syncTabsFromServer(tabs, isInitialSync = false, activeTabsByPanel = null, activeSessionId = null) {
|
|
11273
11390
|
// Wait for any in-progress restoration to complete before syncing
|
|
11274
11391
|
// This prevents the race condition where restoreTabs starts first,
|
|
11275
11392
|
// sets isRestoring=true, and then this function returns early, missing
|
|
@@ -11376,10 +11493,13 @@ async syncTabsFromServer(tabs, isInitialSync = false, activeTabsByPanel = null)
|
|
|
11376
11493
|
}
|
|
11377
11494
|
}
|
|
11378
11495
|
} else if (activeTabsByPanel) {
|
|
11379
|
-
// Mobile
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11496
|
+
// Mobile has one local panel. Prefer the source device's focused tab;
|
|
11497
|
+
// otherwise fall back to an active tab from any source panel.
|
|
11498
|
+
const mobileActive = (activeSessionId && (this.sessions.has(activeSessionId) || this.sftpSessions.has(activeSessionId)))
|
|
11499
|
+
? activeSessionId
|
|
11500
|
+
: Object.values(activeTabsByPanel).find(id => this.sessions.has(id) || this.sftpSessions.has(id));
|
|
11501
|
+
if (mobileActive) {
|
|
11502
|
+
this.switchTab(mobileActive, 'panel-0');
|
|
11383
11503
|
}
|
|
11384
11504
|
} else if (tabs.length > 0) {
|
|
11385
11505
|
// No active tab info from server — default to first tab
|
|
@@ -11459,6 +11579,10 @@ async syncTabsFromServer(tabs, isInitialSync = false, activeTabsByPanel = null)
|
|
|
11459
11579
|
async loadBookmarks() {
|
|
11460
11580
|
try {
|
|
11461
11581
|
const response = await fetch('/api/bookmarks');
|
|
11582
|
+
if (!response.ok) {
|
|
11583
|
+
const data = await response.json().catch(() => ({}));
|
|
11584
|
+
throw new Error(data.error || 'Failed to load bookmarks');
|
|
11585
|
+
}
|
|
11462
11586
|
let bookmarks = await response.json();
|
|
11463
11587
|
|
|
11464
11588
|
// Apply saved order if exists
|
|
@@ -13790,6 +13914,9 @@ async syncTabsFromServer(tabs, isInitialSync = false, activeTabsByPanel = null)
|
|
|
13790
13914
|
this.showToast('You are running the latest version', 'success');
|
|
13791
13915
|
}
|
|
13792
13916
|
}
|
|
13917
|
+
} else {
|
|
13918
|
+
const error = await response.json().catch(() => ({}));
|
|
13919
|
+
throw new Error(error.error || `Update check failed with status ${response.status}`);
|
|
13793
13920
|
}
|
|
13794
13921
|
} catch (error) {
|
|
13795
13922
|
console.error('Failed to check for updates:', error);
|
|
@@ -14043,4 +14170,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
14043
14170
|
if (typeof lucide !== 'undefined') {
|
|
14044
14171
|
lucide.createIcons();
|
|
14045
14172
|
}
|
|
14046
|
-
});
|
|
14173
|
+
});
|