This commit is contained in:
imnavajas
2025-06-09 15:18:12 +02:00
parent e53626bbfe
commit 6967a61d93
6 changed files with 258 additions and 33 deletions

View File

@ -6,23 +6,67 @@
<!--Content Body-->
<div class="row mt-4">
<div class="col-md-12">
<h4 class="mb-4">Backups disponibles</h4>
<a href="<?= route_to('backupsCreate') ?>" class="btn btn-primary mb-3">Crear backup</a>
<div class="table-responsive">
<table id="tablaBackups" class="table table-striped table-hover w-100">
<thead>
<tr>
<th>Archivo</th>
<th>Fecha</th>
<th>Tamaño</th>
<th>Local</th>
<th>Remoto</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
<?php foreach ($backups as $b): ?>
<tr>
<td><?= esc($b['filename']) ?></td>
<td><?= esc($b['fecha']) ?></td>
<td><?= esc($b['tamano']) ?></td>
<td><span class="badge bg-<?= $b['local'] ? 'success' : 'secondary' ?>">
<?= $b['local'] ? 'Sí' : 'No' ?>
</span></td>
<td><span class="badge bg-<?= $b['remoto'] ? 'info' : 'secondary' ?>">
<?= $b['remoto'] ? 'Sí' : 'No' ?>
</span></td>
<td class="text-nowrap">
<?php if ($b['local']): ?>
<a href="<?= base_url('backups/restore/' . $b['filename']) ?>"
class="btn btn-sm btn-warning">Restaurar</a>
<a href="<?= base_url('backups/delete-local/' . $b['id']) ?>"
class="btn btn-sm btn-danger">Eliminar local</a>
<?php elseif ($b['remoto']): ?>
<a href="<?= base_url('backups/restore/' . $b['filename'] . '/remote') ?>"
class="btn btn-sm btn-warning">Restaurar Remoto</a>
<?php else: ?>
<span class="text-muted">No disponible</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<h2>Backups disponibles</h2>
<a href="<?= route_to('backupsCreate') ?>">Crear backup</a>
<ul>
<?php foreach ($files as $file): ?>
<li>
<?= $file ?>
<a href="<?= base_url('backups/restore/' . $file) ?>">[Restaurar]</a>
</li>
<?php endforeach; ?>
</ul>
<?= session('message') ?>
</div>
</div>
<?= $this->endSection() ?>
<?= $this->section('additionalInlineJs') ?>
<script>
$(document).ready(function () {
$('#tablaBackups').DataTable({
order: [[1, 'desc']],
language: {
url: '/assets/vendor/datatables/i18n/es-ES.json' // ajusta si usas idioma español
}
});
});
</script>
<?= $this->endSection() ?>