refactor: update rule handling in Proxmox firewall component to use index-based access for improved clarity and performance
This commit is contained in:
@@ -607,7 +607,8 @@
|
||||
<x-ri-save-line class="size-4 inline mr-1" x-show="editingPositions" />
|
||||
<span x-text="editingPositions ? 'Save' : 'Edit Order'"></span>
|
||||
</button>
|
||||
<button
|
||||
<button
|
||||
type="button"
|
||||
wire:click="startCreateRule"
|
||||
class="px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors text-sm font-medium">
|
||||
<x-ri-add-line class="size-4 inline mr-1" />
|
||||
@@ -857,7 +858,9 @@
|
||||
<td class="py-3 px-4 text-sm">
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
@click="$wire.toggleRule(rule.pos)"
|
||||
type="button"
|
||||
wire:click="toggleRule(index)"
|
||||
:wire:key="'toggle-' + index"
|
||||
wire:loading.attr="disabled"
|
||||
class="transition-colors"
|
||||
:class="rule.enable == 0 ? 'text-warning hover:text-warning/80' : 'text-success hover:text-success/80'"
|
||||
@@ -866,13 +869,17 @@
|
||||
<x-ri-toggle-fill x-show="rule.enable != 0" class="size-4" />
|
||||
</button>
|
||||
<button
|
||||
@click="$wire.startEditRule(rule.pos)"
|
||||
type="button"
|
||||
wire:click="startEditRule(index)"
|
||||
:wire:key="'edit-' + index"
|
||||
class="text-primary hover:text-primary/80 transition-colors"
|
||||
title="Edit rule">
|
||||
<x-ri-edit-line class="size-4" />
|
||||
</button>
|
||||
<button
|
||||
@click="$wire.confirmDeleteRule(rule.pos)"
|
||||
type="button"
|
||||
wire:click="confirmDeleteRule(index)"
|
||||
:wire:key="'delete-' + index"
|
||||
class="text-error hover:text-error/80 transition-colors"
|
||||
title="Delete rule">
|
||||
<x-ri-delete-bin-line class="size-4" />
|
||||
|
||||
Reference in New Issue
Block a user