diff --git a/app/Http/Controllers/VlanController.php b/app/Http/Controllers/VlanController.php index 75388d866..ae60afb96 100644 --- a/app/Http/Controllers/VlanController.php +++ b/app/Http/Controllers/VlanController.php @@ -102,6 +102,10 @@ public function feInit(): void 'title' => 'Peering Manager', 'type' => self::$FE_COL_TYPES[ 'YES_NO' ], ], + 'export_to_ixf' => [ + 'title' => 'Export to IX-F', + 'type' => self::$FE_COL_TYPES[ 'YES_NO' ], + ], 'notes' => [ 'title' => 'Notes', 'type' => self::$FE_COL_TYPES[ 'PARSDOWN' ] @@ -214,6 +218,7 @@ protected function editPrepareForm( $id = null ): array 'private' => request()->old( 'private', $this->object->private ), 'peering_matrix' => request()->old( 'peering_matrix', $this->object->peering_matrix ), 'peering_manager' => request()->old( 'peering_manager', $this->object->peering_manager ), + 'export_to_ixf' => request()->old( 'export_to_ixf', $this->object->export_to_ixf ), 'notes' => request()->old( 'notes', $this->object->notes ), ]); diff --git a/app/Models/Vlan.php b/app/Models/Vlan.php index d4d66fcab..580cb1924 100644 --- a/app/Models/Vlan.php +++ b/app/Models/Vlan.php @@ -43,6 +43,7 @@ * @property int $infrastructureid * @property int $peering_matrix * @property int $peering_manager + * @property int $export_to_ixf * @property string|null $config_name * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at @@ -103,6 +104,7 @@ class Vlan extends Model 'infrastructureid', 'peering_matrix', 'peering_manager', + 'export_to_ixf', 'config_name', ]; diff --git a/app/Utils/Export/JsonSchema.php b/app/Utils/Export/JsonSchema.php index 84a717d6c..a5fd3ae3f 100644 --- a/app/Utils/Export/JsonSchema.php +++ b/app/Utils/Export/JsonSchema.php @@ -197,6 +197,7 @@ private function getIXPInfo( string $version ): array $result = NetworkInfo::leftJoin( 'vlan', 'vlan.id', 'networkinfo.vlanid' ) ->where( 'vlan.infrastructureid', $infra->id ) + ->where( 'vlan.export_to_ixf', 1 ) ->get()->toArray(); $vlanentry = []; diff --git a/database/migrations/2024_03_18_191322_add_export_to_ixf_vlan.php b/database/migrations/2024_03_18_191322_add_export_to_ixf_vlan.php new file mode 100644 index 000000000..db74fb07e --- /dev/null +++ b/database/migrations/2024_03_18_191322_add_export_to_ixf_vlan.php @@ -0,0 +1,32 @@ +tinyInteger( 'export_to_ixf' )->after( 'peering_manager' )->nullable( false )->default(1); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('vlan', function (Blueprint $table) { + $table->dropColumn('export_to_ixf'); + }); + } +} diff --git a/resources/views/vlan/edit-form.foil.php b/resources/views/vlan/edit-form.foil.php index db1df229d..025e562e5 100644 --- a/resources/views/vlan/edit-form.foil.php +++ b/resources/views/vlan/edit-form.foil.php @@ -62,6 +62,13 @@ Note that this does not mean that it will be populated. For that, you need to configure sflow support for this." ); ?> + = Former::checkbox( 'export_to_ixf' ) + ->label( ' ' ) + ->text( 'Include VLAN in data export to IX-F' ) + ->value( 1 ) + ->inline() + ->blockHelp( "Include this VLAN in the export process to the global IX-F database." ); + ?>