- Add FIFO semaphore for per-hoster concurrency control - Add token-bucket speed limiter with abort signal support - Rewrite upload-manager with retry loop, speed monitoring, and rich progress events - Add per-hoster settings: retries, max speed, parallel count, restart below speed, time interval, max size - Add context menu with shutdown-after-finish (sleep/shutdown/restart), always-on-top - Add z-o-o-m-style queue table with 8 columns, status-colored rows, progress bars - Add debounced queue rendering with scroll position preservation - Add statusbar with global speed, total bytes, elapsed time - Fix speedMonitor interval leak on error and scoping bug - Fix throttle not respecting abort signal during cancellation - Fix combined signal listener cleanup - Bump version to 1.1.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
72 lines
2.8 KiB
JavaScript
72 lines
2.8 KiB
JavaScript
const { contextBridge, ipcRenderer } = require('electron');
|
|
|
|
contextBridge.exposeInMainWorld('api', {
|
|
// Config
|
|
getConfig: () => ipcRenderer.invoke('get-config'),
|
|
saveConfig: (config) => ipcRenderer.invoke('save-config', config),
|
|
getHistory: () => ipcRenderer.invoke('get-history'),
|
|
clearHistory: () => ipcRenderer.invoke('clear-history'),
|
|
|
|
// Hoster settings
|
|
getHosterSettings: () => ipcRenderer.invoke('get-hoster-settings'),
|
|
saveHosterSettings: (settings) => ipcRenderer.invoke('save-hoster-settings', settings),
|
|
|
|
// Global settings
|
|
getGlobalSettings: () => ipcRenderer.invoke('get-global-settings'),
|
|
saveGlobalSettings: (settings) => ipcRenderer.invoke('save-global-settings', settings),
|
|
|
|
// Always on top
|
|
setAlwaysOnTop: (value) => ipcRenderer.invoke('set-always-on-top', value),
|
|
getAlwaysOnTop: () => ipcRenderer.invoke('get-always-on-top'),
|
|
|
|
// Shutdown after finish
|
|
setShutdownAfterFinish: (mode) => ipcRenderer.invoke('set-shutdown-after-finish', mode),
|
|
getShutdownAfterFinish: () => ipcRenderer.invoke('get-shutdown-after-finish'),
|
|
cancelShutdown: () => ipcRenderer.invoke('cancel-shutdown'),
|
|
|
|
// File selection
|
|
selectFiles: () => ipcRenderer.invoke('select-files'),
|
|
|
|
// Upload control
|
|
startUpload: (payload) => ipcRenderer.invoke('start-upload', payload),
|
|
cancelUpload: () => ipcRenderer.invoke('cancel-upload'),
|
|
runHealthCheck: (payload) => ipcRenderer.invoke('run-health-check', payload),
|
|
|
|
// Clipboard
|
|
copyToClipboard: (text) => ipcRenderer.invoke('copy-to-clipboard', text),
|
|
|
|
// Updates
|
|
checkForUpdate: () => ipcRenderer.invoke('app:check-updates'),
|
|
installUpdate: () => ipcRenderer.invoke('app:install-update'),
|
|
abortUpdate: () => ipcRenderer.invoke('app:abort-update'),
|
|
getVersion: () => ipcRenderer.invoke('app:get-version'),
|
|
onUpdateAvailable: (callback) => {
|
|
ipcRenderer.on('app:update-available', (_event, data) => callback(data));
|
|
},
|
|
onUpdateProgress: (callback) => {
|
|
ipcRenderer.on('app:update-progress', (_event, data) => callback(data));
|
|
},
|
|
|
|
// Events (main -> renderer)
|
|
onUploadProgress: (callback) => {
|
|
ipcRenderer.on('upload-progress', (_event, data) => callback(data));
|
|
},
|
|
onUploadBatchDone: (callback) => {
|
|
ipcRenderer.on('upload-batch-done', (_event, data) => callback(data));
|
|
},
|
|
onUploadStats: (callback) => {
|
|
ipcRenderer.on('upload-stats', (_event, data) => callback(data));
|
|
},
|
|
onShutdownCountdown: (callback) => {
|
|
ipcRenderer.on('shutdown-countdown', (_event, data) => callback(data));
|
|
},
|
|
removeAllListeners: () => {
|
|
ipcRenderer.removeAllListeners('upload-progress');
|
|
ipcRenderer.removeAllListeners('upload-batch-done');
|
|
ipcRenderer.removeAllListeners('upload-stats');
|
|
ipcRenderer.removeAllListeners('app:update-available');
|
|
ipcRenderer.removeAllListeners('app:update-progress');
|
|
ipcRenderer.removeAllListeners('shutdown-countdown');
|
|
}
|
|
});
|