diff --git a/app/Enums/Product/ProductBillingCycle.php b/app/Enums/Product/ProductBillingCycle.php
new file mode 100644
index 0000000..02c6be9
--- /dev/null
+++ b/app/Enums/Product/ProductBillingCycle.php
@@ -0,0 +1,40 @@
+ 'One Time',
+ self::MONTHLY => 'Monthly',
+ self::QUARTERLY => 'Quarterly',
+ self::SEMI_ANNUALLY => 'Semi Annually',
+ self::ANNUALLY => 'Annually',
+ self::BIENNIALLY => 'Biennially',
+ self::TRIENNIALLY => 'Triennially',
+ };
+ }
+
+ public function months(): int
+ {
+ return match ($this) {
+ self::ONE_TIME => 0,
+ self::MONTHLY => 1,
+ self::QUARTERLY => 3,
+ self::SEMI_ANNUALLY => 6,
+ self::ANNUALLY => 12,
+ self::BIENNIALLY => 24,
+ self::TRIENNIALLY => 36,
+ };
+ }
+}
diff --git a/app/Http/Controllers/admin/package/IPMapping.php b/app/Http/Controllers/admin/package/IPMapping.php
index f397d25..2524f3f 100644
--- a/app/Http/Controllers/admin/package/IPMapping.php
+++ b/app/Http/Controllers/admin/package/IPMapping.php
@@ -166,11 +166,12 @@ class IPMapping extends Controller
);
return DataTables::eloquent($query)
- ->addColumn(
- 'action',
- fn($d) =>
- 'Edit'
- )
+ ->addColumn('action', function ($d) {
+ return view('administrator.pages.package.ipaddress.datatable.action', [
+ 'id' => $d->id,
+ 'ip' => $d->ip
+ ])->render();
+ })
->filterColumn('host.datacenter.v_center.host', function ($query, $keyword) {
$query->whereHas('host.datacenter.vCenter', function ($q) use ($keyword) {
$q->where('host', 'like', "%{$keyword}%");
diff --git a/database/migrations/2024_02_01_094827_module_ipadress.php b/database/migrations/2024_02_01_094827_module_ipadress.php
index 3298994..a968b90 100644
--- a/database/migrations/2024_02_01_094827_module_ipadress.php
+++ b/database/migrations/2024_02_01_094827_module_ipadress.php
@@ -16,8 +16,7 @@ return new class extends Migration
Schema::create('module_ip_address',function (Blueprint $table) {
$table->id()->autoIncrement();
$table->string('vm_name',255)->nullable();
- $table->bigInteger('module_host_id')->default(0)->index();
- $table->bigInteger('module_network_id')->default(0)->index();
+ $table->foreignId('module_network_id')->nullable()->constrained('module_network')->onDelete('set null')->index();
$table->string('ip',100)->nullable();
$table->string('gateway',100)->nullable();
$table->string('netmask',100)->nullable();
diff --git a/database/migrations/2026_01_27_151851_update_forigin_key_module_ip_table.php b/database/migrations/2026_01_27_151851_update_forigin_key_module_ip_table.php
index 101f3b7..db716cd 100644
--- a/database/migrations/2026_01_27_151851_update_forigin_key_module_ip_table.php
+++ b/database/migrations/2026_01_27_151851_update_forigin_key_module_ip_table.php
@@ -12,10 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('module_ip_address', function (Blueprint $table) {
- $table->unsignedBigInteger('module_host_id')->nullable()->default(null)->change();
$table->unsignedBigInteger('module_network_id')->nullable()->default(null)->change();
-
- $table->foreign('module_host_id')->references('id')->on('module_host')->onDelete('set null');
$table->foreign('module_network_id')->references('id')->on('module_network')->onDelete('set null');
});
}
@@ -26,10 +23,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('module_ip_address', function (Blueprint $table) {
- $table->dropForeign(['module_host_id']);
$table->dropForeign(['module_network_id']);
-
- $table->bigInteger('module_host_id')->default(0)->nullable(false)->change();
$table->bigInteger('module_network_id')->default(0)->nullable(false)->change();
});
}
diff --git a/database/migrations/2026_02_03_114500_create_os_product_table.php b/database/migrations/2026_02_03_114500_create_os_product_table.php
new file mode 100644
index 0000000..15a8bc3
--- /dev/null
+++ b/database/migrations/2026_02_03_114500_create_os_product_table.php
@@ -0,0 +1,31 @@
+id();
+ $table->foreignId('product_id')->constrained('products')->onDelete('cascade');
+ $table->foreignId('os_id')->constrained('os')->onDelete('cascade');
+ $table->timestamps();
+
+ $table->unique(['product_id', 'os_id']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('os_product');
+ }
+};
diff --git a/resources/sass/_variables.scss b/resources/sass/_variables.scss
index ec712ff..f61661f 100644
--- a/resources/sass/_variables.scss
+++ b/resources/sass/_variables.scss
@@ -35,10 +35,10 @@ $cyan: #0dcaf0 !default;
//
$primary: #F16723 !default;
$secondary: $gray-600 !default;
-$success: #05a34a !default;
+$success: #10B981 !default;
$info: #66d1d1 !default;
-$warning: #fbbc06 !default;
-$danger: #ff3366 !default;
+$warning: #F59E0B !default;
+$danger: #dc3545 !default;
$light: $gray-200 !default;
$dark: $gray-900 !default;
//
diff --git a/resources/views/administrator/pages/package/ipaddress/add.blade.php b/resources/views/administrator/pages/package/ipaddress/add.blade.php
index 0b59d53..cef4e02 100644
--- a/resources/views/administrator/pages/package/ipaddress/add.blade.php
+++ b/resources/views/administrator/pages/package/ipaddress/add.blade.php
@@ -1,94 +1,94 @@
-@extends("administrator.layout.master")
+@extends('administrator.layout.master')
+@push('plugin-styles')
+ @foreach (config('assets.datatable.css') as $datatable)
+
+ @endforeach
+@endpush
+@section('breadcrumb')
+ @php
+$breadcrumbItems = [
+ ['label' => 'Modules'],
+ ['label' => 'Package vCenter'],
+ ['label' => 'IP Address', 'url' => route('package.ipaddress.index')],
+ ['label' => 'Add IP Address', 'active' => true],
+];
+ @endphp
+