Add saved firewall configuration functionality
- Implemented the ability to save, view, apply, and delete firewall configurations for users. - Created a new model for FirewallConfiguration and corresponding database migration. - Enhanced the firewall view to include a tab for managing saved configurations.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('ext_proxmox_firewall_configurations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
$table->string('configuration_name');
|
||||
$table->json('firewall_rules');
|
||||
$table->string('incoming_policy', 10)->default('DROP');
|
||||
$table->string('outgoing_policy', 10)->default('ACCEPT');
|
||||
$table->timestamps();
|
||||
|
||||
// Index for faster lookups by user
|
||||
$table->index('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ext_proxmox_firewall_configurations');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user