feat: prevent moving drive to the same bus type and update UI to reflect current bus status

This commit is contained in:
2025-12-05 05:56:13 -05:00
parent 48f752c0f6
commit f40b53e301
2 changed files with 10 additions and 2 deletions

View File

@@ -831,6 +831,12 @@ class Storage extends Component
$drive = $this->drives[$this->movingDriveKey];
$targetBus = $this->moveDriveTargetBus;
// Prevent moving to the same bus type
if ($drive['bus'] === $targetBus) {
$this->notify('Drive is already on the ' . $this->busTypes[$targetBus]['label'] . ' bus.', 'error');
return;
}
// Get next available index on target bus
$targetIndex = $this->getNextAvailableIndex($targetBus);
if ($targetIndex === null) {