feat: implement rule toggling functionality in Proxmox Firewall component, allowing users to enable or disable firewall rules directly from the interface for improved management
This commit is contained in:
@@ -374,15 +374,29 @@
|
||||
</td>
|
||||
<td class="py-3 px-4 text-sm">
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
wire:click="toggleRule({{ $rule['pos'] ?? 0 }})"
|
||||
wire:loading.attr="disabled"
|
||||
class="transition-colors
|
||||
{{ (isset($rule['enable']) && $rule['enable'] == 0) ? 'text-warning hover:text-warning/80' : 'text-success hover:text-success/80' }}"
|
||||
title="{{ (isset($rule['enable']) && $rule['enable'] == 0) ? 'Enable rule' : 'Disable rule' }}">
|
||||
@if(isset($rule['enable']) && $rule['enable'] == 0)
|
||||
<x-ri-toggle-line class="size-4" />
|
||||
@else
|
||||
<x-ri-toggle-fill class="size-4" />
|
||||
@endif
|
||||
</button>
|
||||
<button
|
||||
wire:click="startEditRule({{ $rule['pos'] ?? 0 }})"
|
||||
class="text-primary hover:text-primary/80 transition-colors">
|
||||
class="text-primary hover:text-primary/80 transition-colors"
|
||||
title="Edit rule">
|
||||
<x-ri-edit-line class="size-4" />
|
||||
</button>
|
||||
<button
|
||||
wire:click="deleteRule({{ $rule['pos'] ?? 0 }})"
|
||||
wire:confirm="Are you sure you want to delete this rule?"
|
||||
class="text-error hover:text-error/80 transition-colors">
|
||||
class="text-error hover:text-error/80 transition-colors"
|
||||
title="Delete rule">
|
||||
<x-ri-delete-bin-line class="size-4" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user