Compare commits
2 Commits
39b7fb59aa
...
11c714124b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11c714124b | ||
|
|
b6e961dc84 |
@ -32,20 +32,16 @@
|
|||||||
<!-- Status Panel -->
|
<!-- Status Panel -->
|
||||||
<div class="status-panel">
|
<div class="status-panel">
|
||||||
<div class="status-item">
|
<div class="status-item">
|
||||||
<span class="status-label">Sync Status:</span>
|
<span class="status-label">Status</span>
|
||||||
<span id="syncStatus" class="status-value">Initializing...</span>
|
<span id="syncStatus" class="status-value">Initializing...</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-item">
|
<div class="status-item">
|
||||||
<span class="status-label">Last Sync:</span>
|
<span class="status-label">Files</span>
|
||||||
<span id="lastSync" class="status-value">Never</span>
|
|
||||||
</div>
|
|
||||||
<div class="status-item">
|
|
||||||
<span class="status-label">Local Files:</span>
|
|
||||||
<span id="filesSynced" class="status-value">0</span>
|
<span id="filesSynced" class="status-value">0</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-item">
|
<div class="status-item">
|
||||||
<span class="status-label">Sync Mode:</span>
|
<span class="status-label">Mode</span>
|
||||||
<span id="syncMode" class="status-value">Auto-sync</span>
|
<span id="syncMode" class="status-value">Auto</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="syncDetails" class="sync-details"></div>
|
<div id="syncDetails" class="sync-details"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,7 +16,6 @@ class RekordboxSyncRenderer {
|
|||||||
// Status elements
|
// Status elements
|
||||||
this.syncStatusElement = document.getElementById('syncStatus');
|
this.syncStatusElement = document.getElementById('syncStatus');
|
||||||
this.filesSyncedElement = document.getElementById('filesSynced');
|
this.filesSyncedElement = document.getElementById('filesSynced');
|
||||||
this.lastSyncElement = document.getElementById('lastSync');
|
|
||||||
this.syncDetailsElement = document.getElementById('syncDetails');
|
this.syncDetailsElement = document.getElementById('syncDetails');
|
||||||
this.syncModeElement = document.getElementById('syncMode');
|
this.syncModeElement = document.getElementById('syncMode');
|
||||||
|
|
||||||
@ -214,35 +213,27 @@ class RekordboxSyncRenderer {
|
|||||||
updateSyncStatus(status) {
|
updateSyncStatus(status) {
|
||||||
if (!status) return;
|
if (!status) return;
|
||||||
|
|
||||||
// Update main status with more detailed information
|
// Update main status with concise information
|
||||||
if (this.syncStatusElement) {
|
if (this.syncStatusElement) {
|
||||||
if (status.isRunning) {
|
if (status.isRunning) {
|
||||||
let statusText = 'Running';
|
let statusText = 'Running';
|
||||||
|
|
||||||
// Add current phase information
|
// Add current phase information (shortened)
|
||||||
if (status.currentPhase) {
|
if (status.currentPhase) {
|
||||||
statusText += ` - ${status.currentPhase}`;
|
const phase = status.currentPhase === 'watching' ? 'Watching' :
|
||||||
}
|
status.currentPhase === 'downloading' ? 'Downloading' :
|
||||||
|
status.currentPhase === 'uploading' ? 'Uploading' :
|
||||||
// Add file counts (cleaner display)
|
status.currentPhase === 'completed' ? 'Complete' :
|
||||||
if (status.stats && status.stats.totalFilesSynced > 0) {
|
status.currentPhase;
|
||||||
statusText += ` - ${status.stats.totalFilesSynced} local files`;
|
statusText = phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.syncStatusElement.textContent = statusText;
|
this.syncStatusElement.textContent = statusText;
|
||||||
this.syncStatusElement.className = 'status-value running';
|
this.syncStatusElement.className = 'status-value running';
|
||||||
} else {
|
|
||||||
if (status.completedCount > 0 && status.pendingCount === 0 && status.inProgressCount === 0) {
|
|
||||||
this.syncStatusElement.textContent = 'Completed';
|
|
||||||
this.syncStatusElement.className = 'status-value completed';
|
|
||||||
} else {
|
} else {
|
||||||
this.syncStatusElement.textContent = 'Stopped';
|
this.syncStatusElement.textContent = 'Stopped';
|
||||||
this.syncStatusElement.className = 'status-value stopped';
|
this.syncStatusElement.className = 'status-value stopped';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this.startBtn) this.startBtn.disabled = false;
|
|
||||||
if (this.stopBtn) this.stopBtn.disabled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also update the force sync button state
|
// Also update the force sync button state
|
||||||
@ -250,7 +241,6 @@ class RekordboxSyncRenderer {
|
|||||||
if (forceSyncBtn) {
|
if (forceSyncBtn) {
|
||||||
forceSyncBtn.disabled = status.isRunning;
|
forceSyncBtn.disabled = status.isRunning;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Update files synced count with more detail
|
// Update files synced count with more detail
|
||||||
if (this.filesSyncedElement) {
|
if (this.filesSyncedElement) {
|
||||||
@ -276,15 +266,7 @@ class RekordboxSyncRenderer {
|
|||||||
console.warn('⚠️ filesSyncedElement not found!');
|
console.warn('⚠️ filesSyncedElement not found!');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update last sync time
|
|
||||||
if (this.lastSyncElement) {
|
|
||||||
if (status.lastSync) {
|
|
||||||
const date = new Date(status.lastSync);
|
|
||||||
this.lastSyncElement.textContent = date.toLocaleString();
|
|
||||||
} else {
|
|
||||||
this.lastSyncElement.textContent = 'Never';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update detailed status
|
// Update detailed status
|
||||||
this.updateDetailedStatus(status);
|
this.updateDetailedStatus(status);
|
||||||
@ -502,6 +484,34 @@ class RekordboxSyncRenderer {
|
|||||||
showNotification(type, title, message) {
|
showNotification(type, title, message) {
|
||||||
// You could implement desktop notifications here
|
// You could implement desktop notifications here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open settings modal
|
||||||
|
*/
|
||||||
|
openSettings() {
|
||||||
|
const modal = document.getElementById('settingsModal');
|
||||||
|
if (modal) {
|
||||||
|
modal.classList.add('show');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimize window
|
||||||
|
*/
|
||||||
|
minimizeWindow() {
|
||||||
|
if (window.electronAPI && window.electronAPI.invoke) {
|
||||||
|
window.electronAPI.invoke('window:minimize');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close window
|
||||||
|
*/
|
||||||
|
closeWindow() {
|
||||||
|
if (window.electronAPI && window.electronAPI.invoke) {
|
||||||
|
window.electronAPI.invoke('window:close');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the renderer when DOM is loaded
|
// Initialize the renderer when DOM is loaded
|
||||||
|
|||||||
@ -272,6 +272,19 @@ class RekordboxSyncApp {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Window controls
|
||||||
|
ipcMain.handle('window:minimize', () => {
|
||||||
|
if (this.mainWindow) {
|
||||||
|
this.mainWindow.minimize();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('window:close', () => {
|
||||||
|
if (this.mainWindow) {
|
||||||
|
this.mainWindow.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// File operations
|
// File operations
|
||||||
ipcMain.handle('dialog:select-folder', async () => {
|
ipcMain.handle('dialog:select-folder', async () => {
|
||||||
// This would need to be implemented with electron dialog
|
// This would need to be implemented with electron dialog
|
||||||
@ -391,6 +404,7 @@ class RekordboxSyncApp {
|
|||||||
lastUpdate: new Date().toISOString()
|
lastUpdate: new Date().toISOString()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('📤 Sending to renderer:', uiState);
|
||||||
safeSend('sync-status-changed', uiState);
|
safeSend('sync-status-changed', uiState);
|
||||||
this.updateTrayTooltip(uiState);
|
this.updateTrayTooltip(uiState);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,7 +11,8 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||||||
'sync:force-full',
|
'sync:force-full',
|
||||||
'sync:trigger-immediate',
|
'sync:trigger-immediate',
|
||||||
'sync:get-status',
|
'sync:get-status',
|
||||||
|
'window:minimize',
|
||||||
|
'window:close',
|
||||||
'config:get',
|
'config:get',
|
||||||
'config:update-s3',
|
'config:update-s3',
|
||||||
'config:update-sync',
|
'config:update-sync',
|
||||||
|
|||||||
@ -694,6 +694,7 @@ export class AwsS3Service extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
private emitStatusUpdate(): void {
|
private emitStatusUpdate(): void {
|
||||||
const status = this.getStatus();
|
const status = this.getStatus();
|
||||||
|
console.log('🔍 AWS S3 Service emitting status:', status);
|
||||||
this.emit('statusChanged', status);
|
this.emit('statusChanged', status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user