-
Port
-
-
+
+ Service
+
+
diff --git a/resources/js/Pages/Server/Index.vue b/resources/js/Pages/Server/Index.vue
new file mode 100644
index 0000000..8c8e42d
--- /dev/null
+++ b/resources/js/Pages/Server/Index.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Liste des Serveurs
+ Gérez vos serveurs Minecraft, Ark, Rust et plus encore.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/Pages/Server/Paritals/ServerElement.vue b/resources/js/Pages/Server/Paritals/ServerElement.vue
new file mode 100644
index 0000000..de0afe5
--- /dev/null
+++ b/resources/js/Pages/Server/Paritals/ServerElement.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+ Serveur {{ props.server.name }}
+
+
{{ props.server.status.title }}
+
{{ props.server.status.title }}
+
+
+
+
Type {{ props.server.service.name }}
+
Dernier démarrage {{ props.server.start ? props.server.start : "aucun" }}
+
+ Lien :
+
+ {{ props.server.ports.length ? "hosting.anulax.ch:" + props.server.ports[0] : "Indisponible" }}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/Pages/Server/Show.vue b/resources/js/Pages/Server/Show.vue
new file mode 100644
index 0000000..f8feeed
--- /dev/null
+++ b/resources/js/Pages/Server/Show.vue
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+ Dashboard - Détails du Serveur
+
+
+ Gérez et visualisez les informations clés de votre serveur en un coup d'œil.
+
+
+
+
+
+
+
+
+
+ Informations Générales
+
+
+
+ Nom
+ Mon Serveur Minecraft
+
+
+ Type de jeu
+ Minecraft
+
+
+
+
+
+
+
+
+
+ Activité
+
+
+
+ Statut
+ Running
+
+
+ Dernier lancement :
+ 2024-02-15 10:00
+
+
+ Dernier arrêt :
+ 2024-02-15 09:00
+
+
+
+
+
+
+
+
+
+ Hardware
+
+
+
+ CPU :
+ Intel Xeon E5
+
+
+ RAM :
+ 16GB
+
+
+ Stockage :
+ 10GB SSD
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php
index df9b050..c5a0a8e 100644
--- a/resources/views/app.blade.php
+++ b/resources/views/app.blade.php
@@ -15,7 +15,7 @@
@vite(['resources/js/app.js', "resources/js/Pages/{$page['component']}.vue"])
@inertiaHead
-
+
@inertia
diff --git a/routes/console.php b/routes/console.php
index 3c9adf1..90574ab 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -1,8 +1,26 @@
comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
+
+Artisan::command('exec {id}', function ($id) {
+ try{
+ $container = new Container($id);
+ $exec = $container->exec(["apt install -y iproute2"]);
+ Log::info(json_encode($exec->inspect(), JSON_PRETTY_PRINT));
+ $exec->start();
+ Log::info($container->logs());
+ $exec = $container->exec(["echo hello"]);
+ $data = $exec->inspect();
+ Log::info(json_encode($data, JSON_PRETTY_PRINT));
+ $exec->start();
+
+ } catch (Exception $e) { Log::error(((object)$e)->getResponse()->getBody()); }
+
+})->purpose('Display an inspiring quote');
diff --git a/routes/web.php b/routes/web.php
index 0ef1a33..7989fb0 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -2,6 +2,8 @@
use App\Docker\Docker;
use App\Docker\Container;
use App\Http\Controllers\ProfileController;
+use App\Http\Controllers\ServerController;
+use App\Models\Service;
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
@@ -15,7 +17,9 @@
Route::get('/', function () {
- return Inertia::render('Home');
+ return Inertia::render('Home', [
+ "services" => Service::all()
+ ]);
})->name("home");
Route::get("/info", function() {
@@ -23,36 +27,16 @@
return Inertia::render('Info', [ "config" => $config ]);
})->name("docker.info");
-Route::get("/spawn", function (Request $request) {
- return Inertia::render('Spawn');
-})->name("docker.create");
-
-Route::post("/spawn", function (Request $request) {
- $request->validate([
- "name" => "required|string",
- "port" => "required|string"
- ]);
- $container = Container::create($request->name, [
- "Hostname" => "mincraft-". $request->name,
- "Domainname" => $request->name,
- "User" => "root",
- "Image" => "minecraft:latest",
- "OpenStdin" => true,
- "Tty" => true,
- "ExposedPorts" => [ "25565/tcp" => (object)[] ],
- "HostConfig" => [
- "PortBindings" => [ "25565/tcp" => [[ "HostPort" => $request->port ]] ],
- ]
- ]);
- $container->start();
- return redirect("/");
-});
-
Route::get('/dashboard', function () {
return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
-Route::middleware('auth')->group(function () {
+Route::middleware(['auth'])->group(function () {
+ Route::get("/servers/create", [ServerController::class, 'create'])->name("servers.create");
+ Route::post("/servers", [ServerController::class, 'store'])->name("servers.store");
+ Route::get("/servers", [ServerController::class, 'index'])->name("servers.index");
+ Route::get("/servers/{id}", [ServerController::class, 'show'])->name("servers.show");
+
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
diff --git a/storage/framework/sessions/jI3U5ZEiiHFkCvRoPtnLUtIXez0iMLTTjvzivOpi b/storage/framework/sessions/jI3U5ZEiiHFkCvRoPtnLUtIXez0iMLTTjvzivOpi
deleted file mode 100644
index bb56a06..0000000
--- a/storage/framework/sessions/jI3U5ZEiiHFkCvRoPtnLUtIXez0iMLTTjvzivOpi
+++ /dev/null
@@ -1 +0,0 @@
-a:3:{s:6:"_token";s:40:"nwGLpFjKisR3R1Mu3mdHCaXL39V8ByW0CVFN2n2E";s:9:"_previous";a:1:{s:3:"url";s:27:"http://localhost:8000/spawn";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
\ No newline at end of file
diff --git a/svg b/svg
new file mode 100755
index 0000000..531a76b
--- /dev/null
+++ b/svg
@@ -0,0 +1,11 @@
+mkdir -p icons && cd icons
+
+# Télécharger les icônes (vérifie que ces URL correspondent bien aux fichiers SVG)
+wget -O server-icon.svg "https://www.svgrepo.com/download/452095/server.svg"
+wget -O security-icon.svg "https://www.svgrepo.com/download/488474/security-shield.svg"
+wget -O process-icon.svg "https://www.svgrepo.com/download/444524/process.svg"
+wget -O create-icon.svg "https://www.svgrepo.com/download/513806/add.svg"
+wget -O play-icon.svg "https://www.svgrepo.com/download/488502/play-button.svg"
+wget -O auto-icon.svg "https://www.svgrepo.com/download/456246/automation.svg"
+wget -O rocket-icon.svg "https://www.svgrepo.com/download/488478/rocket.svg"
+wget -O arrow-icon.svg "https://www.svgrepo.com/download/502744/arrow-right.svg"
\ No newline at end of file
diff --git a/text.json b/text.json
new file mode 100644
index 0000000..9eb40d1
--- /dev/null
+++ b/text.json
@@ -0,0 +1,27 @@
+{
+ "Hostname": "mincraft-server",
+ "User": "root",
+ "Image": "minecraftbedrock:latest",
+ "OpenStdin": true,
+ "AttachStdout": false,
+ "AttachStderr": false,
+ "Tty": true,
+ "ExposedPorts": {
+ "19132/udp": {},
+ "19133/udp": {}
+ },
+ "HostConfig": {
+ "PortBindings": {
+ "19132/udp": [
+ {
+ "HostPort": 25004
+ }
+ ],
+ "19133/udp": [
+ {
+ "HostPort": 25005
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file