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:
@@ -785,6 +785,8 @@ type AppBackupRow struct {
|
||||
|
||||
// Drive disconnected — app's home drive is currently disconnected
|
||||
DriveDisconnected bool
|
||||
// Tier2 destination drive is currently disconnected (backup paused, not failed)
|
||||
Tier2DestDisconnected bool
|
||||
|
||||
// Warnings accumulated for this app
|
||||
Warnings []string
|
||||
@@ -926,8 +928,22 @@ func (s *Server) buildAppBackupRows(
|
||||
// Tier2 configured but never run — stay yellow
|
||||
}
|
||||
|
||||
// Destination health check — can downgrade green to yellow/red
|
||||
if cfg.DestinationPath != "" && s.crossDriveRunner != nil {
|
||||
// Check if Tier2 destination drive is disconnected
|
||||
if cfg.DestinationPath != "" {
|
||||
for dp := range disconnectedPaths {
|
||||
if cfg.DestinationPath == dp || strings.HasPrefix(cfg.DestinationPath, dp+"/") {
|
||||
row.Tier2DestDisconnected = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if row.Tier2DestDisconnected {
|
||||
// Disconnected destination — treat as paused, not failed
|
||||
row.Status = "yellow"
|
||||
row.StatusText = "2. mentés szünetel — cél meghajtó leválasztva"
|
||||
} else if cfg.DestinationPath != "" && s.crossDriveRunner != nil {
|
||||
// Destination health check — can downgrade green to yellow/red
|
||||
if err := s.crossDriveRunner.ValidateDestination(cfg.DestinationPath); err != nil {
|
||||
if strings.Contains(err.Error(), "does not exist") || strings.Contains(err.Error(), "not writable") {
|
||||
row.Status = "red"
|
||||
|
||||
Reference in New Issue
Block a user