feat: initialize Infra Manager with React, Tailwind CSS, and Inertia.js
- Added main application entry point (app.jsx) and bootstrap file for React setup. - Created Wiki index page (Index.jsx) for documentation and file management. - Implemented utility functions for formatting and status handling in utils.js. - Set up Blade template (app.blade.php) for Inertia.js integration. - Defined API routes for metrics and terminal access in api.php. - Established console commands for scheduled tasks in console.php. - Created web routes for various application features including authentication, hypervisors, containers, cloud accounts, security, backups, and wiki management in web.php. - Developed setup scripts for Windows (setup.ps1) and Linux (setup.sh) environments. - Configured Tailwind CSS for styling with custom themes and animations in tailwind.config.js. - Set up Vite for asset bundling and development server in vite.config.js.
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('backup_policies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('target_type'); // vm, container, database, files
|
||||
$table->json('target_ids');
|
||||
$table->string('schedule'); // cron expression
|
||||
$table->string('retention_type')->default('count'); // count, days
|
||||
$table->integer('retention_value')->default(7);
|
||||
$table->string('storage_type'); // local, s3, sftp, nfs
|
||||
$table->json('storage_config')->nullable(); // encrypted
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->json('compression')->nullable();
|
||||
$table->json('encryption')->nullable();
|
||||
$table->foreignId('created_by')->constrained('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('backups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('policy_id')->nullable()->constrained('backup_policies')->nullOnDelete();
|
||||
$table->string('target_type');
|
||||
$table->unsignedBigInteger('target_id');
|
||||
$table->string('target_name');
|
||||
$table->string('status'); // running, success, failed, expired
|
||||
$table->string('storage_path')->nullable();
|
||||
$table->bigInteger('size_bytes')->nullable();
|
||||
$table->string('checksum')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->foreignId('created_by')->constrained('users');
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->timestamp('completed_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('restore_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('backup_id')->constrained('backups');
|
||||
$table->string('target_type');
|
||||
$table->unsignedBigInteger('target_id')->nullable();
|
||||
$table->string('restore_mode'); // overwrite, new, test
|
||||
$table->json('restore_config')->nullable();
|
||||
$table->string('status'); // queued, running, success, failed
|
||||
$table->text('log')->nullable();
|
||||
$table->foreignId('initiated_by')->constrained('users');
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->timestamp('completed_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('restore_jobs');
|
||||
Schema::dropIfExists('backups');
|
||||
Schema::dropIfExists('backup_policies');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user