diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 56f8d67..23d480e 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -164,11 +164,13 @@ public function makePublic(Request $request) public function destroy(Request $request) { $server = Server::where("uuid", $request->id)->first(); - try { - $container = new Container($server->container); - $data = $container->inspect()->State; - if($data->Running || $data->Paused || $data->Restarting) $container->kill(); - } catch(Exception) { return redirect()->back()->withErrors(["error" => "Problème pour éteindre le serveur. Réessayer!"]); } + if($server->container) { + try { + $container = new Container($server->container); + $data = $container->inspect()->State; + if($data->Running || $data->Paused || $data->Restarting) $container->kill(); + } catch(Exception) { return redirect()->back()->withErrors(["error" => "Problème pour éteindre le serveur. Réessayer!"]); } + } $server->exposedPorts()->update([ "usable" => true ]); $server->exposedPorts()->detach(); $server->delete(); diff --git a/public/icons/menu.svg b/public/icons/menu.svg new file mode 100644 index 0000000..1ecc091 --- /dev/null +++ b/public/icons/menu.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/resources/js/Components/NavLink.vue b/resources/js/Components/NavLink.vue index 2b938b0..257c640 100644 --- a/resources/js/Components/NavLink.vue +++ b/resources/js/Components/NavLink.vue @@ -14,8 +14,11 @@ const props = defineProps({ const classes = computed(() => props.active - ? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 text-sm font-medium leading-5 text-textColor-900 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out' - : 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-textColor-500 hover:text-textColor-700 hover:border-gray-300 focus:outline-none focus:text-textColor-700 focus:border-gray-300 transition duration-150 ease-in-out', + ? 'flex items-center px-1 pt-1 border-b-2 border-blue-400 text-md font-bold leading-5' + + ' text-textColor-50 focus:outline-none focus:border-blue-700 transition duration-150 ease-in-out' + : 'flex items-center px-1 pt-1 border-b-2 border-transparent text-md font-medium ' + + 'leading-5 text-textColor-200 hover:text-textColor-100 hover:border-blue-500 focus:outline-none ' + + 'focus:text-textColor-700 focus:border-gray-300 transition duration-150 ease-in-out', ); diff --git a/resources/js/Components/ResponsiveNavLink.vue b/resources/js/Components/ResponsiveNavLink.vue index 43f3020..f135228 100644 --- a/resources/js/Components/ResponsiveNavLink.vue +++ b/resources/js/Components/ResponsiveNavLink.vue @@ -14,8 +14,12 @@ const props = defineProps({ const classes = computed(() => props.active - ? 'block w-full ps-3 pe-4 py-2 border-l-4 border-indigo-400 text-start text-base font-medium text-indigo-700 bg-indigo-50 focus:outline-none focus:text-indigo-800 focus:bg-indigo-100 focus:border-indigo-700 transition duration-150 ease-in-out' - : 'block w-full ps-3 pe-4 py-2 border-l-4 border-transparent text-start text-base font-medium text-textColor-600 hover:text-textColor-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-textColor-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out', + ? 'block w-full ps-3 pe-4 py-2 border-l-4 border-blue-400 text-start '+ + 'text-base font-medium text-blue-700 bg-blue-50 focus:outline-none focus:text-blue-800 '+ + 'focus:bg-blue-100 focus:border-blue-700 transition duration-150 ease-in-out' + : 'block w-full ps-3 pe-4 py-2 border-l-4 border-transparent text-start text-base font-medium text-textColor-600 '+ + 'hover:text-textColor-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-textColor-800 focus:bg-gray-50'+ + ' focus:border-gray-300 transition duration-150 ease-in-out', ); diff --git a/resources/js/Layouts/Layout.vue b/resources/js/Layouts/Layout.vue index 0e5b4b2..a753a8a 100644 --- a/resources/js/Layouts/Layout.vue +++ b/resources/js/Layouts/Layout.vue @@ -1,12 +1,16 @@ - - - - - Home - Spawn server - Management + + + + + + Home + Spawn server + Management - - + + Log in - - + + Log out + + + + + + Home + Spawn server + Management + Log in + Log out + + - + diff --git a/resources/js/Pages/Home.vue b/resources/js/Pages/Home.vue index fd278e6..f92c422 100644 --- a/resources/js/Pages/Home.vue +++ b/resources/js/Pages/Home.vue @@ -21,13 +21,13 @@ const props = defineProps({ - Bienvenue sur Hosting + Bienvenue sur Hosting Un service gratuit permettant d'héberger facilement vos serveurs dans des conteneurs Docker sécurisés et performants. Nos Services - - + + diff --git a/resources/js/Pages/Server/Show.vue b/resources/js/Pages/Server/Show.vue index ee99340..80730ec 100644 --- a/resources/js/Pages/Server/Show.vue +++ b/resources/js/Pages/Server/Show.vue @@ -17,170 +17,179 @@ const form = useForm(); const editForm = useForm({ name: props.server.name }); const start = (uuid) => { - form.post(route("servers.start", uuid)); -} + form.post(route("servers.start", uuid)); +} const stop = (uuid) => { - form.post(route("servers.stop", uuid)); -} + form.post(route("servers.stop", uuid)); +} const del = (uuid) => { - if(prompt("Entrer le nom du server en confirmation.") == props.server.name) form.delete(route("servers.destroy", uuid)); + if (prompt("Entrer le nom du server en confirmation.") == props.server.name) form.delete(route("servers.destroy", uuid)); } const pub = (uuid) => { - if(props.server.public) form.post(route("servers.public", uuid)); - else if (prompt("Entrer le nom du server en confirmation.") == props.server.name) form.post(route("servers.public", uuid)); + if (props.server.public) form.post(route("servers.public", uuid)); + else if (prompt("Entrer le nom du server en confirmation.") == props.server.name) form.post(route("servers.public", uuid)); } const edit = () => { - console.log(editForm.name); - editForm.post(route("servers.update", props.server.uuid)); + console.log(editForm.name); + editForm.post(route("servers.update", props.server.uuid)); } const copie = () => { - navigator.clipboard.writeText('hosting.anulax.ch:' + props.server.ports[0]).then(() => alert("lien de connection copié!")) + navigator.clipboard.writeText('hosting.anulax.ch:' + props.server.ports[0]).then(() => alert("lien de connection copié!")) } - - - - - - Dashboard du Serveur - - - Gérez et visualisez les informations clés de votre serveur en un coup d'œil. - - - - - - - - - Informations Générales - - - - Nom - {{ props.server.name }} - - - Type de jeu - {{ props.server.service.name }} - - - Public - {{ props.server.public ? "Oui" : "Non" }} - - - - - Lien de connection + + + + + + Dashboard du Serveur + + + Gérez et visualisez les informations clés de votre serveur en un coup d'œil. + + + + + + + + + + Informations Générales + + + + Nom + {{ props.server.name }} + + + Type de jeu + {{ props.server.service.name }} + + + Public + {{ props.server.public ? "Oui" : "Non" }} + + + + + Lien de connection + Lien du server + + + + {{ props.server.ports.length && props.server.status.id < 3 ? "hosting.anulax.ch:" + + props.server.ports[0] : "Indisponible" }} + + + + + + + + - - - {{ props.server.ports.length && props.server.status.id < 3 ? "hosting.anulax.ch:" + props.server.ports[0] : "Indisponible" }} - - - - + + + + + Activité + + + + Statut + {{ props.server.status.title }} + + + Dernier lancement + {{ props.server.start ? props.server.start : "Aucun" + }} + + + Dernier arrêt + {{ props.server.end ? props.server.end : "Aucun" }} + + + + + + + + + + - - - - - - - - - Activité - - - - Statut - {{ props.server.status.title }} - - - Dernier lancement - {{ props.server.start ? props.server.start : "Aucun" }} - - - Dernier arrêt - {{ props.server.end ? props.server.end : "Aucun" }} - - - - - - - - - - - - - - - - - Hardware(fake) - - - - CPUs - 1 - - - Memory - 4GB - - - Stockage - 10GB - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Hardware(fake) + + + + CPUs + 1 + + + Memory + 4GB + + + Stockage + 10GB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file
Un service gratuit permettant d'héberger facilement vos serveurs dans des conteneurs Docker sécurisés et performants.
Nos Services
- Gérez et visualisez les informations clés de votre serveur en un coup d'œil. -
+ Gérez et visualisez les informations clés de votre serveur en un coup d'œil. +
+ {{ props.server.ports.length && props.server.status.id < 3 ? "hosting.anulax.ch:" + + props.server.ports[0] : "Indisponible" }}
- {{ props.server.ports.length && props.server.status.id < 3 ? "hosting.anulax.ch:" + props.server.ports[0] : "Indisponible" }} -