Save local changes before merge
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Paymenter\Extensions\Others\UptimeLab\Models\UptimeServer;
|
||||
|
||||
class UptimeServerSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$servers = [
|
||||
[
|
||||
'name' => 'Web Server 01',
|
||||
'ip_address' => '192.168.1.10',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Jakarta, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.8,
|
||||
'last_online' => now(),
|
||||
'last_offline' => now()->subHours(6),
|
||||
'last_check' => now(),
|
||||
'response_time' => 15,
|
||||
],
|
||||
[
|
||||
'name' => 'Main Database Server',
|
||||
'ip_address' => '192.168.1.20',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Surabaya, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'offline',
|
||||
'uptime_percentage' => 100.0,
|
||||
'last_online' => now()->subHours(5),
|
||||
'last_offline' => now(),
|
||||
'last_check' => now(),
|
||||
'response_time' => null,
|
||||
],
|
||||
[
|
||||
'name' => 'API Gateway',
|
||||
'ip_address' => 'api.example.com',
|
||||
'server_type' => 'subdomain',
|
||||
'location' => 'Bandung, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.9,
|
||||
'last_online' => now()->subHours(6),
|
||||
'last_offline' => now()->subHours(5),
|
||||
'last_check' => now(),
|
||||
'response_time' => 25,
|
||||
],
|
||||
[
|
||||
'name' => 'Load Balancer',
|
||||
'ip_address' => '192.168.1.40',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Jakarta, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.99,
|
||||
'last_online' => now(),
|
||||
'last_offline' => now()->subHours(6),
|
||||
'last_check' => now(),
|
||||
'response_time' => 8,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($servers as $serverData) {
|
||||
UptimeServer::create($serverData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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_uptime_servers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('ip_address');
|
||||
$table->string('server_type')->default('ip'); // ip or subdomain
|
||||
$table->string('location');
|
||||
$table->string('type')->default('Production'); // Production, Staging, Development
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->string('status')->default('offline'); // online, offline
|
||||
$table->decimal('uptime_percentage', 5, 2)->default(0.00);
|
||||
$table->timestamp('last_online')->nullable();
|
||||
$table->timestamp('last_offline')->nullable();
|
||||
$table->timestamp('last_check')->nullable();
|
||||
$table->integer('response_time')->nullable(); // in milliseconds
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ext_uptime_servers');
|
||||
}
|
||||
};
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Paymenter\\Extensions\\Others\\UptimeLab\\": ""
|
||||
"Paymenter\\Extensions\\Others\\UptimeLab\\": "extensions/Others/UptimeLab/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Paymenter\Extensions\Others\UptimeLab\Database\Seeders;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Paymenter\Extensions\Others\UptimeLab\Models\UptimeServer;
|
||||
|
||||
class UptimeServerSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$servers = [
|
||||
[
|
||||
'name' => 'Web Server 01',
|
||||
'ip_address' => '192.168.1.10',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Jakarta, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.8,
|
||||
'last_online' => now(),
|
||||
'last_offline' => now()->subHours(6),
|
||||
'last_check' => now(),
|
||||
'response_time' => 15,
|
||||
],
|
||||
[
|
||||
'name' => 'Main Database Server',
|
||||
'ip_address' => '192.168.1.20',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Surabaya, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'offline',
|
||||
'uptime_percentage' => 100.0,
|
||||
'last_online' => now()->subHours(5),
|
||||
'last_offline' => now(),
|
||||
'last_check' => now(),
|
||||
'response_time' => null,
|
||||
],
|
||||
[
|
||||
'name' => 'API Gateway',
|
||||
'ip_address' => 'api.example.com',
|
||||
'server_type' => 'subdomain',
|
||||
'location' => 'Bandung, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.9,
|
||||
'last_online' => now()->subHours(6),
|
||||
'last_offline' => now()->subHours(5),
|
||||
'last_check' => now(),
|
||||
'response_time' => 25,
|
||||
],
|
||||
[
|
||||
'name' => 'Load Balancer',
|
||||
'ip_address' => '192.168.1.40',
|
||||
'server_type' => 'ip',
|
||||
'location' => 'Jakarta, Indonesia',
|
||||
'is_active' => true,
|
||||
'status' => 'online',
|
||||
'uptime_percentage' => 99.99,
|
||||
'last_online' => now(),
|
||||
'last_offline' => now()->subHours(6),
|
||||
'last_check' => now(),
|
||||
'response_time' => 8,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($servers as $serverData) {
|
||||
UptimeServer::create($serverData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user