@extends('admin.firewallplus.layout', ['fwpTab' => 'presets']) @section('fwp_title') Firewall-Plus: Presets @endsection @section('fwp_subtitle') Manage client-visible firewall presets @endsection @section('fwp') @if (session('success'))
{{ session('success') }}
@endif @if (session('warnings'))
Saved with warnings:
@endif @if ($errors->any())
Could not save preset:
@endif @php $activePane = old('preset_id') ? 'edit' : (old('create_name') || old('create_rules_json') ? 'add' : 'edit'); @endphp @include('admin.firewallplus.partials.json-editor-styles')
@if ($presets->isEmpty())

No global presets found.

@else

Drag the handle to reorder presets. Order is reflected in the client preset popup.

@foreach ($presets as $preset) @php $rules = is_array($preset->rules_json) ? $preset->rules_json : []; $rulesJson = json_encode($rules, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); $isEditingOld = ((int) old('preset_id')) === (int) $preset->id; $open = $isEditingOld || ($loop->first && !old('preset_id')); $collapseId = 'fwp-preset-' . $preset->id; @endphp
@csrf @method('PUT')
@php $visibilityValue = $isEditingOld ? old('is_system', (string) ((int) $preset->is_system)) : (string) ((int) $preset->is_system); @endphp
@include('admin.firewallplus.partials.json-editor', [ 'name' => 'rules_json', 'value' => $isEditingOld ? old('rules_json', $rulesJson) : $rulesJson, 'required' => true, 'id' => 'fwp-preset-rules-' . $preset->id, ])
@csrf @method('DELETE')
@endforeach
@endif
@csrf
@include('admin.firewallplus.partials.json-editor', [ 'name' => 'create_rules_json', 'value' => old('create_rules_json', $create_rules_json), 'required' => true, 'id' => 'fwp-preset-create-rules', ])

Must be a JSON array of rule templates. Each item needs at minimum: rule_type, and usually scope, protocol, value_json. For scope: "port", include a numeric port.

@endsection @section('footer-scripts') @parent @include('admin.firewallplus.partials.json-editor-scripts') @endsection