refs #1287. Created menu templates and controller
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
parent
4a26d7a880
commit
3ad5b23e67
|
@ -33,6 +33,8 @@ security:
|
|||
- { path: ^/og-repository/webhook, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/og-lives/install/webhook, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/auth/refresh, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/menu-browser, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/menu/, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
||||
|
||||
when@test:
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class TestController extends AbstractController
|
||||
{
|
||||
#[Route('/menu-browser')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$host = $request->getHost();
|
||||
|
||||
return $this->render('test.html.twig', [
|
||||
'ip' => $host,
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Menú de Opciones</title>
|
||||
<style>
|
||||
.navbar {
|
||||
color: white;
|
||||
padding: 15px 30px;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.navbar img {
|
||||
width: auto;
|
||||
position: absolute; /* Logo en la izquierda */
|
||||
left: 30px; /* Ajuste de la distancia desde la izquierda */
|
||||
}
|
||||
|
||||
.navbar h1 {
|
||||
margin: 0;
|
||||
font-size: 1.8em;
|
||||
}
|
||||
|
||||
.navbar a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 80px auto 0; /* Deja espacio para la barra de navegación */
|
||||
width: 90%;
|
||||
max-width: 1000px;
|
||||
text-align: center; /* Centra los elementos en navegadores básicos */
|
||||
}
|
||||
|
||||
.menu-container {
|
||||
display: block;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
background-color: #f0f8ff; /* Fondo suave */
|
||||
padding: 15px;
|
||||
margin: 15px 0; /* Espaciado entre cajas */
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
width: 45%; /* Dos elementos por fila */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.menu-item a {
|
||||
font-size: 1.2em;
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.menu-item p {
|
||||
font-size: 0.9em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.menu-item {
|
||||
width: 100%; /* En pantallas pequeñas, las cajas ocupan todo el ancho */
|
||||
}
|
||||
}
|
||||
|
||||
.windows {
|
||||
background-color: #e0f7fa; /* Azul suave para Windows */
|
||||
}
|
||||
|
||||
.linux {
|
||||
background-color: #c8e6c9; /* Verde suave para Linux */
|
||||
}
|
||||
|
||||
.apagar {
|
||||
background-color: #ffccbc; /* Naranja suave para Apagar */
|
||||
}
|
||||
.partition-container {
|
||||
margin-top: 20px;
|
||||
padding: 20px;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.partition-header {
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.partition-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap; /* Permite adaptarse a pantallas pequeñas */
|
||||
align-items: center;
|
||||
text-align: left; /* Asegura que el contenido está alineado a la izquierda */
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.partition-item span {
|
||||
margin-right: 15px;
|
||||
font-size: 1em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.partition-link {
|
||||
font-size: 0.9em;
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.partition-link:hover {
|
||||
text-decoration: underline;
|
||||
color: #0056b3;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.partition-item {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.partition-item span {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.partition-link {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Barra de navegación superior -->
|
||||
<div class="navbar">
|
||||
<img src="{{ asset('images/img.png') }}" alt="Logo">
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="menu-container">
|
||||
<h1>Bienvenido {{ ip }}</h1>
|
||||
<div class="menu-item windows">
|
||||
<a href="command+confirm:restoreImage REPO windows 1 1">Instalar Windows</a>
|
||||
<p>El proceso de instalación tardará unos minutos.</p>
|
||||
</div>
|
||||
<div class="menu-item linux">
|
||||
<a href="command+output+confirm:restoreImage REPO linux 1 2">Instalar GNU/Linux</a>
|
||||
<p>El proceso de instalación tardará unos minutos.</p>
|
||||
</div>
|
||||
|
||||
<div class="menu-item apagar">
|
||||
<a href="command:poweroff">Apagar</a>
|
||||
<p>Apagar el ordenador.</p>
|
||||
</div>
|
||||
<div class="menu-item apagar">
|
||||
<a href="command:reboot">Reiniciar</a>
|
||||
<p>Reiniciar el ordenador.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="partition-container">
|
||||
<h2 class="partition-header">Particiones del sistema</h2>
|
||||
{% if partitions|length > 0 %}
|
||||
{% for partition in partitions %}
|
||||
<div class="partition-item">
|
||||
<span><strong>Disco:</strong> {{ partition.diskNumber }} </span>
|
||||
<span><strong>Partición:</strong> {{ partition.partitionNumber }}</span>
|
||||
<span>Tamaño: {{ (partition.size / 1024)|number_format(2) }} MB</span>
|
||||
<span>Tipo: {{ partition.filesystem }}</span>
|
||||
<span><strong>SO:</strong> {{ partition.operativeSystem ? partition.operativeSystem.name : '-' }}</span>
|
||||
{% if partition.operativeSystem %}
|
||||
<a href="command+output:bootOs {{ partition.diskNumber }} {{ partition.partitionNumber }}" class="partition-link">Arrancar {{ partition.operativeSystem.name }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No hay particiones disponibles.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue