From fc7e1b7586174df360c5411b5b6ed518e6e7403a Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Thu, 4 Dec 2025 18:02:36 -0500 Subject: [PATCH] refactor: consolidate Proxmox firewall view by removing legacy code and enhancing UI components for improved user experience --- .../Proxmox/views/firewall-new.blade.php | 1298 ------ .../Servers/Proxmox/views/firewall.blade.php | 4008 +++++------------ .../Proxmox/views/firewall.blade.php.backup | 2922 ++++++++++++ 3 files changed, 4114 insertions(+), 4114 deletions(-) delete mode 100644 extensions/Servers/Proxmox/views/firewall-new.blade.php create mode 100644 extensions/Servers/Proxmox/views/firewall.blade.php.backup diff --git a/extensions/Servers/Proxmox/views/firewall-new.blade.php b/extensions/Servers/Proxmox/views/firewall-new.blade.php deleted file mode 100644 index 7a0ff819d..000000000 --- a/extensions/Servers/Proxmox/views/firewall-new.blade.php +++ /dev/null @@ -1,1298 +0,0 @@ -
- {{-- Page Header --}} -
-

Firewall Management

-

Configure firewall rules, policies, aliases, and IPSets for your virtual machine

-
- - {{-- Error Modal --}} - @if($error && $showErrorModal) -
-
- -
-
- -
-
-

Error

-

{{ $error }}

-
-
-
- -
-
-
- @endif - - {{-- Main Firewall Toggle & Status --}} -
-
-
-
- -
-
-

Firewall Status

-

- @if($firewallEnabled) - Active and protecting your virtual machine - @else - Currently disabled - your VM is not protected - @endif -

-
-
- -
-
- - {{-- Firewall Policies & Filters --}} - @if($firewallEnabled) -
- {{-- Default Policies Card --}} -
-
-
-
- -
-
-

Default Policies

-

Control default traffic behavior

-
-
- -
- -
-
- - -

Default action for incoming traffic not matching any rule

-
- -
- - -

Default action for outgoing traffic not matching any rule

-
- -
-
- - -
-
- - -
-
- - -
-
- - {{-- Network Adapters Card --}} -
-
-
- -
-
-

Network Adapters

-

Per-adapter firewall control

-
-
- - @if(count($networkAdapters) > 0) -
- @foreach($networkAdapters as $adapter) -
-
-
-
{{ $adapter['name'] }}
-
- Model: {{ ucfirst($adapter['model'] ?? 'Unknown') }} - @if($adapter['mac']) - MAC: {{ $adapter['mac'] }} - @endif -
-
- -
-
- @endforeach -
- @else -
- -

No network adapters found

-
- @endif -
-
- - {{-- Policy Info Modal --}} - @if($showPolicyInfoModal) -
-
- -
-
-
- -
-
-

Understanding Firewall Policies

-

How default policies control your network traffic

-
-
- -
-
-

- - Policy In (Incoming Traffic) -

-

Controls what happens to traffic coming INTO your VM when it doesn't match any explicit firewall rule.

-
    -
  • ACCEPT: Allow all incoming traffic by default (permissive, requires explicit DENY rules)
  • -
  • REJECT: Block incoming traffic and send rejection notification to sender
  • -
  • DROP: Silently discard incoming traffic without notifying sender (recommended)
  • -
-
- -
-

- - Policy Out (Outgoing Traffic) -

-

Controls what happens to traffic going OUT of your VM when it doesn't match any explicit firewall rule.

-
    -
  • ACCEPT: Allow all outgoing traffic by default (recommended for most VMs)
  • -
  • REJECT: Block outgoing traffic and notify your VM
  • -
  • DROP: Silently discard outgoing traffic
  • -
-
- -
-

- - Creating a Whitelist Configuration -

-

To create a strict whitelist (only allow specific traffic):

-
    -
  1. Set Policy In to DROP
  2. -
  3. Set Policy Out to DROP (if restricting outbound)
  4. -
  5. Create explicit ACCEPT rules for allowed traffic
  6. -
  7. Everything not explicitly allowed will be blocked
  8. -
-
- -
-

Additional Filters

-

IP Filter: Validates that source/destination IP addresses in packets match the VM's assigned IPs. Helps prevent IP spoofing.

-

MAC Filter: Validates that MAC addresses match the VM's network adapters. Provides additional layer of security.

-
-
- -
- -
-
-
-
- @endif - - {{-- Tabs Navigation --}} -
-
- - - - -
- - {{-- Tab Contents --}} -
- {{-- RULES TAB --}} -
-
-

Firewall Rules

- -
- - @if(count($rules) > 0) -
- - - - - - - - - - - - - - - - @foreach($rules as $index => $rule) - - - - - - - - - - - - @endforeach - -
PosActionTypeSourceDestinationProtocolPortStatusActions
{{ $rule['pos'] ?? '-' }} - @php - $actionClass = match($rule['action'] ?? '') { - 'ACCEPT' => 'bg-success/20 text-success', - 'REJECT' => 'bg-warning/20 text-warning', - 'DROP' => 'bg-error/20 text-error', - default => 'bg-base/20 text-base/60' - }; - @endphp - - {{ $rule['action'] ?? '-' }} - - - - {{ strtoupper($rule['type'] ?? 'IN') }} - - {{ $rule['source'] ?? '-' }}{{ $rule['dest'] ?? '-' }}{{ strtoupper($rule['proto'] ?? ($rule['macro'] ?? 'ANY')) }}{{ $rule['dport'] ?? $rule['sport'] ?? '-' }} - @if(isset($rule['enable']) && $rule['enable'] == 0) - Disabled - @else - Enabled - @endif - -
- - - -
-
-
- @else -
- -

No Firewall Rules

-

Create your first rule to control network traffic

- -
- @endif -
- - {{-- ALIASES TAB --}} -
-
-
-

IP Aliases

-

Create named references to IP addresses or CIDR ranges

-
- -
- - @if(count($aliases) > 0) -
- @foreach($aliases as $alias) -
-
-
-
{{ $alias['name'] }}
-
{{ $alias['cidr'] }}
- @if(!empty($alias['comment'])) -
{{ $alias['comment'] }}
- @endif -
-
- - -
-
-
- @endforeach -
- @else -
- -

No IP Aliases

-

Create aliases to simplify rule management

- -
- @endif -
- - {{-- IPSETS TAB --}} -
-
-
-

IP Sets

-

Group multiple IPs/CIDRs for easier rule management

-
- -
- -
- {{-- IPSets List --}} -
-

Available IP Sets

- @if(count($ipsets) > 0) -
- @foreach($ipsets as $ipset) -
-
-
-
{{ $ipset['name'] }}
- @if(!empty($ipset['comment'])) -
{{ $ipset['comment'] }}
- @endif -
-
- -
-
-
- @endforeach -
- @else -
- -

No IP Sets created yet

-
- @endif -
- - {{-- IPSet Members --}} -
- @if($selectedIPSetName) -
-

Members of: {{ $selectedIPSetName }}

- -
- - @if(count($ipsetMembers) > 0) -
- @foreach($ipsetMembers as $member) -
-
-
-
{{ $member['cidr'] }}
- @if(!empty($member['comment'])) -
{{ $member['comment'] }}
- @endif - @if(isset($member['nomatch']) && $member['nomatch']) - No Match - @endif -
- -
-
- @endforeach -
- @else -
- -

No members in this IPSet

- -
- @endif - @else -
- -

Select an IP Set to view its members

-
- @endif -
-
-
- - {{-- LOGS TAB --}} -
-
-

Firewall Logs

- -
- - @if(!empty($logError)) -
-
- -

{{ $logError }}

-
-
- @endif - - @if(count($firewallLogs) > 0) -
- - - - - - - - - - - - - @foreach(array_slice($firewallLogs, 0, 50) as $log) - - - - - - - - - - @endforeach - -
TimeActionSourceDestinationProtocolPort
{{ $log['timestamp'] ?? '-' }} - - {{ $log['action'] ?? '-' }} - - -
- {{ $log['source'] ?? '-' }} - @php $sourceIP = $log['source'] ?? ''; @endphp - @if($sourceIP && $sourceIP !== '-' && $this->checkIsPublicIP($sourceIP)) -
- - - {{-- IP Location Modal --}} - -
- @endif -
-
-
- {{ $log['destination'] ?? '-' }} - @php $destIP = $log['destination'] ?? ''; @endphp - @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP)) -
- - - {{-- IP Location Modal --}} - -
- @endif -
-
-
- {{ $log['destination'] ?? '-' }} - @php $destIP = $log['destination'] ?? ''; @endphp - @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP)) -
- - - {{-- IP Location Modal --}} - -
- @endif -
-
{{ $log['protocol'] ?? '-' }}{{ $log['destination_port'] ?? '-' }}
-
- @if(count($firewallLogs) > 50) -
- Showing first 50 of {{ count($firewallLogs) }} log entries -
- @endif - @else -
- -

No Firewall Logs

-

Logs will appear here when the firewall blocks or allows traffic

-
- @endif -
-
-
- @else -
- -

Firewall is Disabled

-

Enable the firewall to start protecting your virtual machine

-
- @endif - - {{-- Rule Form Modal --}} - @if($showRuleForm) -
-
- -
-

{{ $editingRuleIndex !== null ? 'Edit' : 'Create' }} Firewall Rule

- -
- {{-- Action --}} -
- - -
- - {{-- Type --}} -
- - -
- - {{-- Macro --}} -
- - -

Select a macro or leave as "None" for custom rules

-
- - {{-- Interface --}} -
- - -
- - {{-- Source --}} -
- - -

Can use alias names or leave empty for any source

-
- - {{-- Destination --}} -
- - -
- - {{-- Protocol --}} -
- - -
- - {{-- Destination Port --}} -
- - -
- - {{-- Source Port --}} -
- - -
- - {{-- Log Level --}} -
- - -
- - {{-- Comment --}} -
- - -
- - {{-- Enable --}} -
- - -
-
- -
- - -
-
-
-
- @endif - - {{-- Delete Rule Modal --}} - @if($showDeleteRuleModal && $deletingRuleIndex !== null && isset($rules[$deletingRuleIndex])) - @php $ruleToDelete = $rules[$deletingRuleIndex]; @endphp -
-
- -
-
- -
-
-

Delete Firewall Rule

-

Are you sure you want to delete this rule? This action cannot be undone.

-
-
Action: {{ $ruleToDelete['action'] ?? '-' }}
-
Source: {{ $ruleToDelete['source'] ?? 'Any' }}
-
Destination: {{ $ruleToDelete['dest'] ?? 'Any' }}
-
-
-
-
- - -
-
-
- @endif - - {{-- Alias Form Modal --}} - @if($showAliasForm) -
-
- -

{{ $editingAliasName ? 'Edit' : 'Create' }} IP Alias

- -
-
- - - @error('aliasName') {{ $message }} @enderror -
- -
- - - @error('aliasCidr') {{ $message }} @enderror -
- -
- - -
-
- -
- - -
-
-
- @endif - - {{-- Delete Alias Modal --}} - @if($showDeleteAliasModal && $deletingAliasName) -
-
- -
-
- -
-
-

Delete IP Alias

-

Delete alias "{{ $deletingAliasName }}"?

-

This may affect firewall rules using this alias.

-
-
-
- - -
-
-
- @endif - - {{-- IPSet Form Modal --}} - @if($showIPSetForm) -
-
- -

Create IP Set

- -
-
- - - @error('ipsetName') {{ $message }} @enderror -
- -
- - -
- -
-

After creating the IPSet, you can add IP addresses and CIDR ranges to it.

-
-
- -
- - -
-
-
- @endif - - {{-- Delete IPSet Modal --}} - @if($showDeleteIPSetModal && $deletingIPSetName) -
-
- -
-
- -
-
-

Delete IP Set

-

Delete IPSet "{{ $deletingIPSetName }}"?

-

All members will be removed and rules using this IPSet may be affected.

-
-
-
- - -
-
-
- @endif - - {{-- IPSet Member Form Modal --}} - @if($showIPSetMemberForm && $selectedIPSetName) -
-
- -

Add IP/CIDR to {{ $selectedIPSetName }}

- -
-
- - - @error('memberCidr') {{ $message }} @enderror -
- -
- - -
- -
- - -
-
- -
- - -
-
-
- @endif - - {{-- Delete IPSet Member Modal --}} - @if($showDeleteIPSetMemberModal && $deletingMemberCidr) -
-
- -
-
- -
-
-

Remove Member

-

Remove "{{ $deletingMemberCidr }}" from {{ $selectedIPSetName }}?

-
-
-
- - -
-
-
- @endif -
- -@script - -@endscript - diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php b/extensions/Servers/Proxmox/views/firewall.blade.php index 7c8a7899f..7a0ff819d 100644 --- a/extensions/Servers/Proxmox/views/firewall.blade.php +++ b/extensions/Servers/Proxmox/views/firewall.blade.php @@ -1,2560 +1,1276 @@ - +
+ {{-- Page Header --}} +
+

Firewall Management

+

Configure firewall rules, policies, aliases, and IPSets for your virtual machine

+
-
-
-
-
-
- + {{-- Error Modal --}} + @if($error && $showErrorModal) +
+
+ +
+
+ +
+
+

Error

+

{{ $error }}

+
-
-

Firewall

+
+
-
- - - -
- -
-
-
-
- + {{-- Main Firewall Toggle & Status --}} +
+
+
+
+

Firewall Status

-

Enable or disable the firewall for this virtual machine

+

+ @if($firewallEnabled) + Active and protecting your virtual machine + @else + Currently disabled - your VM is not protected + @endif +

-
- Disabled - - Enabled -
+
- -
-
-
- -
-
-

Network Adapters

-

Enable or disable firewall for each network adapter

-
-
- - @if(count($networkAdapters) > 0) -
- @foreach($networkAdapters as $adapter) -
-
-
-
-

{{ $adapter['name'] }}

- - {{ ucfirst($adapter['model'] ?? 'Unknown') }} - -
-
- @if($adapter['mac']) -
MAC: {{ $adapter['mac'] }}
- @endif -
-

Enables or disables the firewall ability for this network adapter

-
-
- Network Adapter Firewall -
- Disabled - - Enabled -
-
+ {{-- Firewall Policies & Filters --}} + @if($firewallEnabled) +
+ {{-- Default Policies Card --}} +
+
+
+
+ +
+
+

Default Policies

+

Control default traffic behavior

- @endforeach -
- @else -
- -

No network adapters found

-
- @endif -
+ +
- @if($firewallEnabled) - -
-
-
-
- +
+
+ + +

Default action for incoming traffic not matching any rule

+
+ +
+ + +

Default action for outgoing traffic not matching any rule

+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + {{-- Network Adapters Card --}} +
+
+
+
-

Firewall Rules

-

Manage allow and block rules for network traffic

+

Network Adapters

+

Per-adapter firewall control

-
- - -
-
- - @if(count($rules) > 0) -
- - - - - - - - - - - - - - - @foreach($rules as $index => $rule) - - - - - - - - - - - @endforeach - -
OrderActionSourceDestinationProtocolPortStatusActions
{{ $rule['pos'] ?? '-' }} - @php - $actionClass = match($rule['action'] ?? '') { - 'ACCEPT' => 'bg-success/20 text-success', - 'REJECT' => 'bg-warning/20 text-warning', - 'DROP' => 'bg-error/20 text-error', - default => '' - }; - @endphp - - {{ $rule['action'] ?? '-' }} - - -
- {{ $rule['source'] ?? '-' }} -
- - - -
- + @if(count($networkAdapters) > 0) +
+ @foreach($networkAdapters as $adapter) +
+
+
+
{{ $adapter['name'] }}
+
+ Model: {{ ucfirst($adapter['model'] ?? 'Unknown') }} + @if($adapter['mac']) + MAC: {{ $adapter['mac'] }} + @endif
-
-
- {{ $rule['dest'] ?? '-' }} -
- - - -
- -
-
{{ strtoupper($rule['proto'] ?? 'any') }}{{ $rule['dport'] ?? $rule['sport'] ?? '-' }} - @if(isset($rule['enable']) && $rule['enable'] == 0) - Disabled - @else - Enabled - @endif - -
- - - -
-
-
- @else -
- -

No firewall rules configured

-
- @endif +
+ +
+
+ @endforeach +
+ @else +
+ +

No network adapters found

+
+ @endif +
- -
-
-
-
- -
-
-

Firewall Logs

-

- Recent firewall activity and blocked/allowed connections - - ({{ count($firewallLogs) }} entries loaded) - -

+ {{-- Policy Info Modal --}} + @if($showPolicyInfoModal) +
+
+ +
+
+
+ +
+
+

Understanding Firewall Policies

+

How default policies control your network traffic

+
+
+ +
+
+

+ + Policy In (Incoming Traffic) +

+

Controls what happens to traffic coming INTO your VM when it doesn't match any explicit firewall rule.

+
    +
  • ACCEPT: Allow all incoming traffic by default (permissive, requires explicit DENY rules)
  • +
  • REJECT: Block incoming traffic and send rejection notification to sender
  • +
  • DROP: Silently discard incoming traffic without notifying sender (recommended)
  • +
+
+ +
+

+ + Policy Out (Outgoing Traffic) +

+

Controls what happens to traffic going OUT of your VM when it doesn't match any explicit firewall rule.

+
    +
  • ACCEPT: Allow all outgoing traffic by default (recommended for most VMs)
  • +
  • REJECT: Block outgoing traffic and notify your VM
  • +
  • DROP: Silently discard outgoing traffic
  • +
+
+ +
+

+ + Creating a Whitelist Configuration +

+

To create a strict whitelist (only allow specific traffic):

+
    +
  1. Set Policy In to DROP
  2. +
  3. Set Policy Out to DROP (if restricting outbound)
  4. +
  5. Create explicit ACCEPT rules for allowed traffic
  6. +
  7. Everything not explicitly allowed will be blocked
  8. +
+
+ +
+

Additional Filters

+

IP Filter: Validates that source/destination IP addresses in packets match the VM's assigned IPs. Helps prevent IP spoofing.

+

MAC Filter: Validates that MAC addresses match the VM's network adapters. Provides additional layer of security.

+
+
+ +
+ +
-
+ @endif + + {{-- Tabs Navigation --}} +
+
+ + + +
- @if(!empty($logError)) -
-
- -
-

{{ $logError }}

-
+ {{-- Tab Contents --}} +
+ {{-- RULES TAB --}} +
+
+

Firewall Rules

+
+ + @if(count($rules) > 0) +
+ + + + + + + + + + + + + + + + @foreach($rules as $index => $rule) + + + + + + + + + + + + @endforeach + +
PosActionTypeSourceDestinationProtocolPortStatusActions
{{ $rule['pos'] ?? '-' }} + @php + $actionClass = match($rule['action'] ?? '') { + 'ACCEPT' => 'bg-success/20 text-success', + 'REJECT' => 'bg-warning/20 text-warning', + 'DROP' => 'bg-error/20 text-error', + default => 'bg-base/20 text-base/60' + }; + @endphp + + {{ $rule['action'] ?? '-' }} + + + + {{ strtoupper($rule['type'] ?? 'IN') }} + + {{ $rule['source'] ?? '-' }}{{ $rule['dest'] ?? '-' }}{{ strtoupper($rule['proto'] ?? ($rule['macro'] ?? 'ANY')) }}{{ $rule['dport'] ?? $rule['sport'] ?? '-' }} + @if(isset($rule['enable']) && $rule['enable'] == 0) + Disabled + @else + Enabled + @endif + +
+ + + +
+
+
+ @else +
+ +

No Firewall Rules

+

Create your first rule to control network traffic

+ +
+ @endif
- @endif - @if(count($firewallLogs) > 0) -
- -
- -
- Policy: - - - - - - -
- - -
- Protocol: - - - - - - - - - - -
- - -
-
- - -
-
-
- Showing - - of - -
-
- Page - - / - -
-
+ {{-- ALIASES TAB --}} +
+
+
+

IP Aliases

+

Create named references to IP addresses or CIDR ranges

+
-
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - Actions -
-
- - -
- - - - - -
- -
- -

No logs matched your search.

-
+ + + @foreach(array_slice($firewallLogs, 0, 50) as $log) + + {{ $log['timestamp'] ?? '-' }} + + + {{ $log['action'] ?? '-' }} + + + +
+ {{ $log['source'] ?? '-' }} + @php $sourceIP = $log['source'] ?? ''; @endphp + @if($sourceIP && $sourceIP !== '-' && $this->checkIsPublicIP($sourceIP)) +
+ + + {{-- IP Location Modal --}} + +
+ @endif +
+ + +
+ {{ $log['destination'] ?? '-' }} + @php $destIP = $log['destination'] ?? ''; @endphp + @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP)) +
+ + + {{-- IP Location Modal --}} + +
+ @endif +
+ + +
+ {{ $log['destination'] ?? '-' }} + @php $destIP = $log['destination'] ?? ''; @endphp + @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP)) +
+ + + {{-- IP Location Modal --}} + +
+ @endif +
+ + {{ $log['protocol'] ?? '-' }} + {{ $log['destination_port'] ?? '-' }} + + @endforeach + + +
+ @if(count($firewallLogs) > 50) +
+ Showing first 50 of {{ count($firewallLogs) }} log entries +
+ @endif + @else +
+ +

No Firewall Logs

+

Logs will appear here when the firewall blocks or allows traffic

+
+ @endif
- @elseif(empty($logError)) -
- -

No firewall logs available

-

Ensure firewall logging is enabled in Proxmox (Datacenter > Firewall > Options)

-
- @endif +
@else -
- -

Firewall is Disabled

-

Enable the firewall above to manage firewall rules.

+
+ +

Firewall is Disabled

+

Enable the firewall to start protecting your virtual machine

+
+ @endif + + {{-- Rule Form Modal --}} + @if($showRuleForm) +
+
+ +
+

{{ $editingRuleIndex !== null ? 'Edit' : 'Create' }} Firewall Rule

+ +
+ {{-- Action --}} +
+ + +
+ + {{-- Type --}} +
+ + +
+ + {{-- Macro --}} +
+ + +

Select a macro or leave as "None" for custom rules

+
+ + {{-- Interface --}} +
+ + +
+ + {{-- Source --}} +
+ + +

Can use alias names or leave empty for any source

+
+ + {{-- Destination --}} +
+ + +
+ + {{-- Protocol --}} +
+ + +
+ + {{-- Destination Port --}} +
+ + +
+ + {{-- Source Port --}} +
+ + +
+ + {{-- Log Level --}} +
+ + +
+ + {{-- Comment --}} +
+ + +
+ + {{-- Enable --}} +
+ + +
+
+ +
+ + +
+
+
+
+ @endif + + {{-- Delete Rule Modal --}} + @if($showDeleteRuleModal && $deletingRuleIndex !== null && isset($rules[$deletingRuleIndex])) + @php $ruleToDelete = $rules[$deletingRuleIndex]; @endphp +
+
+ +
+
+ +
+
+

Delete Firewall Rule

+

Are you sure you want to delete this rule? This action cannot be undone.

+
+
Action: {{ $ruleToDelete['action'] ?? '-' }}
+
Source: {{ $ruleToDelete['source'] ?? 'Any' }}
+
Destination: {{ $ruleToDelete['dest'] ?? 'Any' }}
+
+
+
+
+ + +
+
+
+ @endif + + {{-- Alias Form Modal --}} + @if($showAliasForm) +
+
+ +

{{ $editingAliasName ? 'Edit' : 'Create' }} IP Alias

+ +
+
+ + + @error('aliasName') {{ $message }} @enderror +
+ +
+ + + @error('aliasCidr') {{ $message }} @enderror +
+ +
+ + +
+
+ +
+ + +
+
+
+ @endif + + {{-- Delete Alias Modal --}} + @if($showDeleteAliasModal && $deletingAliasName) +
+
+ +
+
+ +
+
+

Delete IP Alias

+

Delete alias "{{ $deletingAliasName }}"?

+

This may affect firewall rules using this alias.

+
+
+
+ + +
+
+
+ @endif + + {{-- IPSet Form Modal --}} + @if($showIPSetForm) +
+
+ +

Create IP Set

+ +
+
+ + + @error('ipsetName') {{ $message }} @enderror +
+ +
+ + +
+ +
+

After creating the IPSet, you can add IP addresses and CIDR ranges to it.

+
+
+ +
+ + +
+
+
+ @endif + + {{-- Delete IPSet Modal --}} + @if($showDeleteIPSetModal && $deletingIPSetName) +
+
+ +
+
+ +
+
+

Delete IP Set

+

Delete IPSet "{{ $deletingIPSetName }}"?

+

All members will be removed and rules using this IPSet may be affected.

+
+
+
+ + +
+
+
+ @endif + + {{-- IPSet Member Form Modal --}} + @if($showIPSetMemberForm && $selectedIPSetName) +
+
+ +

Add IP/CIDR to {{ $selectedIPSetName }}

+ +
+
+ + + @error('memberCidr') {{ $message }} @enderror +
+ +
+ + +
+ +
+ + +
+
+ +
+ + +
+
+
+ @endif + + {{-- Delete IPSet Member Modal --}} + @if($showDeleteIPSetMemberModal && $deletingMemberCidr) +
+
+ +
+
+ +
+
+

Remove Member

+

Remove "{{ $deletingMemberCidr }}" from {{ $selectedIPSetName }}?

+
+
+
+ + +
+
@endif
@script @endscript -
-
-
- - - - - - -@if($error && $showErrorModal) - -
-
- -
-
- -
- -
-

Firewall Error

-
-

{{ $error }}

-
-
-
-
-
-@endif - - -@if($showRuleForm) - -
-
- -
-
- -
-

{{ $editingRulePos !== null ? 'Edit Rule' : 'Create New Rule' }}

-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - -
-
-
-@endif - - -@if($showDeleteModal && $deletingRulePos !== null) - @php - $ruleToDelete = collect($rules)->firstWhere('pos', $deletingRulePos); - @endphp - -
-
- -
-
- -
-
-
- -
-
-

Delete Firewall Rule

-

- Are you sure you want to delete this firewall rule? This action cannot be undone and may affect your network security. -

- @if($ruleToDelete) -
-
-
- Action: - - {{ $ruleToDelete['action'] ?? '-' }} - -
- @if(!empty($ruleToDelete['source'])) -
- Source: - {{ $ruleToDelete['source'] }} -
- @endif - @if(!empty($ruleToDelete['dest'])) -
- Destination: - {{ $ruleToDelete['dest'] }} -
- @endif - @if(!empty($ruleToDelete['proto'])) -
- Protocol: - {{ strtoupper($ruleToDelete['proto']) }} -
- @endif - @if(!empty($ruleToDelete['dport'])) -
- Port: - {{ $ruleToDelete['dport'] }} -
- @endif - @if(!empty($ruleToDelete['comment'])) -
- Comment: - {{ $ruleToDelete['comment'] }} -
- @endif -
-
- @endif -
-
-
-
- - -
-
-
-@endif diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php.backup b/extensions/Servers/Proxmox/views/firewall.blade.php.backup new file mode 100644 index 000000000..7c8a7899f --- /dev/null +++ b/extensions/Servers/Proxmox/views/firewall.blade.php.backup @@ -0,0 +1,2922 @@ + + +
+
+
+
+
+ +
+
+

Firewall

+
+
+
+
+ + + +
+ +
+
+
+
+ +
+
+

Firewall Status

+

Enable or disable the firewall for this virtual machine

+
+
+
+ Disabled + + Enabled +
+
+
+ + +
+
+
+ +
+
+

Network Adapters

+

Enable or disable firewall for each network adapter

+
+
+ + @if(count($networkAdapters) > 0) +
+ @foreach($networkAdapters as $adapter) +
+
+
+
+

{{ $adapter['name'] }}

+ + {{ ucfirst($adapter['model'] ?? 'Unknown') }} + +
+
+ @if($adapter['mac']) +
MAC: {{ $adapter['mac'] }}
+ @endif +
+

Enables or disables the firewall ability for this network adapter

+
+
+ Network Adapter Firewall +
+ Disabled + + Enabled +
+
+
+
+ @endforeach +
+ @else +
+ +

No network adapters found

+
+ @endif +
+ + @if($firewallEnabled) + +
+
+
+
+ +
+
+

Firewall Rules

+

Manage allow and block rules for network traffic

+
+
+
+ + +
+
+ + + @if(count($rules) > 0) +
+ + + + + + + + + + + + + + + @foreach($rules as $index => $rule) + + + + + + + + + + + @endforeach + +
OrderActionSourceDestinationProtocolPortStatusActions
{{ $rule['pos'] ?? '-' }} + @php + $actionClass = match($rule['action'] ?? '') { + 'ACCEPT' => 'bg-success/20 text-success', + 'REJECT' => 'bg-warning/20 text-warning', + 'DROP' => 'bg-error/20 text-error', + default => '' + }; + @endphp + + {{ $rule['action'] ?? '-' }} + + +
+ {{ $rule['source'] ?? '-' }} +
+ + + +
+ +
+
+
+ {{ $rule['dest'] ?? '-' }} +
+ + + +
+ +
+
{{ strtoupper($rule['proto'] ?? 'any') }}{{ $rule['dport'] ?? $rule['sport'] ?? '-' }} + @if(isset($rule['enable']) && $rule['enable'] == 0) + Disabled + @else + Enabled + @endif + +
+ + + +
+
+
+ @else +
+ +

No firewall rules configured

+
+ @endif +
+ + +
+
+
+
+ +
+
+

Firewall Logs

+

+ Recent firewall activity and blocked/allowed connections + + ({{ count($firewallLogs) }} entries loaded) + +

+
+
+ +
+ + @if(!empty($logError)) +
+
+ +
+

{{ $logError }}

+
+
+
+ @endif + + @if(count($firewallLogs) > 0) +
+ +
+ +
+ Policy: + + + + + + +
+ + +
+ Protocol: + + + + + + + + + + +
+ + +
+
+ + +
+
+
+ Showing + + of + +
+
+ Page + + / + +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + Actions +
+
+ + +
+ + + + + +
+ +
+ +

No logs matched your search.

+
+
+ @elseif(empty($logError)) +
+ +

No firewall logs available

+

Ensure firewall logging is enabled in Proxmox (Datacenter > Firewall > Options)

+
+ @endif +
+ @else +
+ +

Firewall is Disabled

+

Enable the firewall above to manage firewall rules.

+
+ @endif +
+ +@script + +@endscript + +
+
+
+ +
+ + + + +@if($error && $showErrorModal) + +
+
+ +
+
+ +
+ +
+

Firewall Error

+
+

{{ $error }}

+
+
+
+
+
+@endif + + +@if($showRuleForm) + +
+
+ +
+
+ +
+

{{ $editingRulePos !== null ? 'Edit Rule' : 'Create New Rule' }}

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+@endif + + +@if($showDeleteModal && $deletingRulePos !== null) + @php + $ruleToDelete = collect($rules)->firstWhere('pos', $deletingRulePos); + @endphp + +
+
+ +
+
+ +
+
+
+ +
+
+

Delete Firewall Rule

+

+ Are you sure you want to delete this firewall rule? This action cannot be undone and may affect your network security. +

+ @if($ruleToDelete) +
+
+
+ Action: + + {{ $ruleToDelete['action'] ?? '-' }} + +
+ @if(!empty($ruleToDelete['source'])) +
+ Source: + {{ $ruleToDelete['source'] }} +
+ @endif + @if(!empty($ruleToDelete['dest'])) +
+ Destination: + {{ $ruleToDelete['dest'] }} +
+ @endif + @if(!empty($ruleToDelete['proto'])) +
+ Protocol: + {{ strtoupper($ruleToDelete['proto']) }} +
+ @endif + @if(!empty($ruleToDelete['dport'])) +
+ Port: + {{ $ruleToDelete['dport'] }} +
+ @endif + @if(!empty($ruleToDelete['comment'])) +
+ Comment: + {{ $ruleToDelete['comment'] }} +
+ @endif +
+
+ @endif +
+
+
+
+ + +
+
+
+@endif