mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into mod/presupuesto_cliente
This commit is contained in:
111
ci4/app/Views/themes/vuexy/form/backups/backupList.php
Normal file
111
ci4/app/Views/themes/vuexy/form/backups/backupList.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Backups disponibles</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
<?php if (getenv('SK_ENVIRONMENT') === 'production'): ?>
|
||||
<a href="<?= route_to('backupsCreate') ?>" class="btn btn-primary mb-3">Crear backup</a>
|
||||
<?php else: ?>
|
||||
<a href="<?= route_to('backupsCreateDev') ?>" class="btn btn-secondary mb-3">Crear backup desarrollo</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<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">
|
||||
<!-- Descargar siempre disponible -->
|
||||
<a href="<?= route_to('backupsDownload', $b['filename']) ?>"
|
||||
class="btn btn-sm btn-info" title="Descargar backup">
|
||||
Descargar
|
||||
</a>
|
||||
|
||||
<!-- Restaurar y eliminar solo si local -->
|
||||
<?php if ($b['local']): ?>
|
||||
<?php if (getenv('SK_ENVIRONMENT') === 'production'): ?>
|
||||
<a href="<?= route_to('backupsRestoreLocal', $b['filename']) ?>"
|
||||
class="btn btn-sm btn-warning" title="Restaurar backup local">
|
||||
Restaurar Local
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (getenv('SK_ENVIRONMENT') === 'production' && !empty($b['id'])): ?>
|
||||
<a href="<?= route_to('backupsDeleteLocal', $b['id']) ?>"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('¿Seguro que deseas eliminar este backup?')"
|
||||
title="Eliminar archivo local (producción)">
|
||||
Eliminar [PROD]
|
||||
</a>
|
||||
<?php elseif (getenv('SK_ENVIRONMENT') === 'development' && !empty($b['filename'])): ?>
|
||||
<a href="<?= route_to('backupsDeleteLocalDev', $b['filename']) ?>"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('¿Eliminar archivo del sistema de archivos local?')"
|
||||
title="Eliminar archivo local (DEV)">
|
||||
Eliminar [DEV]
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($b['remoto']): ?>
|
||||
<!-- Restaurar remoto si solo existe remoto -->
|
||||
<a href="<?= route_to('backupsRestoreRemote', $b['filename']) ?>"
|
||||
class="btn btn-sm btn-warning" title="Restaurar desde servidor remoto">
|
||||
Restaurar Remoto
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span class="text-muted">No disponible</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
</div><!-- /.card -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
$(document).ready(function () {
|
||||
$('#tablaBackups').DataTable({
|
||||
order: [[1, 'desc']]
|
||||
});
|
||||
});
|
||||
<?= $this->endSection() ?>
|
||||
@ -3,7 +3,7 @@
|
||||
* SEPARADOR Y MENUS DE SISTEMA
|
||||
*/
|
||||
|
||||
if (auth()->user()->can('actividad.menu')) {
|
||||
if (auth()->user()->can('actividad.menu') || auth()->user()->can('backup.menu')) {
|
||||
?>
|
||||
<li class="menu-header small text-uppercase">
|
||||
<span class="menu-header-text">Sistema</span>
|
||||
@ -23,4 +23,20 @@ if (auth()->user()->can('actividad.menu')) {
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU BACKUP
|
||||
*/
|
||||
if (auth()->user()->can('backup.menu')) {
|
||||
?>
|
||||
<!-- Backups -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("backupsList") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-database-import"></i>
|
||||
<div data-i18n="<?= lang("App.menu_backups") ?>"><?= lang("App.menu_backups") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user