feat: add browser event dispatch for page refresh after drive detachment

This commit is contained in:
2025-12-05 05:02:21 -05:00
parent f5a1fa6af5
commit 43ebd70abe
2 changed files with 13 additions and 0 deletions

View File

@@ -803,6 +803,9 @@ class Storage extends Component
$this->notify("Drive {$driveKey} detached successfully.", 'success');
$this->closeDetachModal();
$this->loadStorageConfiguration(false);
// Dispatch browser event to refresh the page
$this->dispatch('refresh-page');
} catch (\Exception $e) {
$this->notify('Failed to detach drive: ' . $e->getMessage(), 'error');
}

View File

@@ -864,4 +864,14 @@
</div>
</div>
@endif
<script>
document.addEventListener('livewire:initialized', () => {
Livewire.on('refresh-page', () => {
setTimeout(() => {
window.location.reload();
}, 500);
});
});
</script>
</x-proxmox::layout>