fix: USB badge detection for bind-mounted drives + graceful Tier2 backup on disconnected destinations
- IsUSBDevice/diskModel: strip findmnt bind-mount suffix [/subdir] before parsing device path (fixes USB badge not showing for attach-wizard drives) - crossdrive.go: skip disconnected src/dest drives with WARN log instead of returning error (prevents noisy error status in settings.json) - handlers.go: detect Tier2 destination disconnection, set yellow status dot instead of red, skip ValidateDestination for disconnected paths - backups.html: new template branch showing "Cél meghajtó leválasztva" badge with grayed-out info and hidden "Futtatás most" button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,25 +90,15 @@ func (r *CrossDriveRunner) RunAppBackup(ctx context.Context, stackName string) e
|
||||
r.mu.Unlock()
|
||||
}()
|
||||
|
||||
// Check if source or destination drive is disconnected
|
||||
// Check if source or destination drive is disconnected — skip silently (not an error)
|
||||
srcDrive := r.stackProvider.GetStackHDDPath(stackName)
|
||||
if srcDrive != "" && r.sett.IsDisconnected(srcDrive) {
|
||||
if r.debug {
|
||||
r.logger.Printf("[DEBUG] RunAppBackup: source drive disconnected for %s: %s", stackName, srcDrive)
|
||||
}
|
||||
r.mu.Lock()
|
||||
r.running[stackName] = false
|
||||
r.mu.Unlock()
|
||||
return fmt.Errorf("source drive disconnected: %s", srcDrive)
|
||||
r.logger.Printf("[WARN] [backup] Cross-drive backup skipped for %s: source drive disconnected (%s)", stackName, srcDrive)
|
||||
return nil
|
||||
}
|
||||
if r.sett.IsDisconnected(cfg.DestinationPath) {
|
||||
if r.debug {
|
||||
r.logger.Printf("[DEBUG] RunAppBackup: destination drive disconnected for %s: %s", stackName, cfg.DestinationPath)
|
||||
}
|
||||
r.mu.Lock()
|
||||
r.running[stackName] = false
|
||||
r.mu.Unlock()
|
||||
return fmt.Errorf("destination drive disconnected: %s", cfg.DestinationPath)
|
||||
r.logger.Printf("[WARN] [backup] Cross-drive backup skipped for %s: destination drive disconnected (%s)", stackName, cfg.DestinationPath)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Mark as running in settings
|
||||
|
||||
Reference in New Issue
Block a user