Messaging: - Optimistic UI: message appears instantly in sender's view on send - Skip WS relay-back of own messages to avoid duplicates - Fix sent_at field name mismatch (sentAt → sent_at fallback) Admin portal: - /admin route: list all users, storage used vs quota, file count - Inline-edit per-user storage quota (MB) and admin flag - Stats header: total users, total storage, total files - is_admin + storage_quota_mb columns added to users table - Login response now includes isAdmin; sidebar shows Admin link for admins - requireAdmin middleware on all /admin/* routes Electron desktop app (desktop/): - BrowserWindow with native title bar, system tray, hide-to-tray on close - First-run setup dialog to configure self-hosted server URL - Persists server URL via electron-store - Tray menu: Open, Change server URL, Quit - IPC: showNotification for future native push notifications - electron-builder config for macOS (DMG), Windows (NSIS), Linux (AppImage) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
443 B
JavaScript
14 lines
443 B
JavaScript
'use strict';
|
|
|
|
const { contextBridge, ipcRenderer } = require('electron');
|
|
|
|
contextBridge.exposeInMainWorld('cloudlink', {
|
|
getServerUrl: () => ipcRenderer.invoke('get-server-url'),
|
|
setServerUrl: (url) => ipcRenderer.invoke('set-server-url', url),
|
|
showNotification: (title, body) =>
|
|
ipcRenderer.invoke('show-notification', { title, body }),
|
|
// Platform detection for the web app
|
|
platform: process.platform,
|
|
isDesktop: true,
|
|
});
|