Sauvegarde SQL

This commit is contained in:
leosw
2025-08-30 13:43:03 +02:00
parent 5c228c9533
commit be0bd0195a
5 changed files with 78 additions and 2 deletions

View File

@@ -39,6 +39,10 @@ small {
font-weight: 500;
}
pre {
overflow: auto;
}
.button {
padding: 5px 10px;
margin: 5px 10px;

View File

@@ -12,6 +12,7 @@
<br>
<? if($user->rankIsHigher("administrator")) { ?>
<a href="<?=$config['rel_root_folder']?>admin/git-pull" class="button"><i class="fas fa-sync-alt"></i> Mettre à jour</a> <small>Met à jour le logiciel depuis le dépôt GIT.</small><br><br>
<a href="<?=$config['rel_root_folder']?>admin/sql-backup" class="button"><i class="fas fa-file-export"></i> Sauvegarde SQL</a><small>Génère un dump SQL téléchargeable.</small><br><br>
<? } ?>
<? if($user->rankIsHigher("moderator")) { ?>
<a href="<?=$config['rel_root_folder']?>admin/logs" class="button"><i class="fas fa-history"></i> Voir les logs</a> <small>Permet d'accéder aux 200 dernières lignes des logs bruts des actions sur la base de données.</small><br><br>

View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1><?=$head['title']?></h1>
<br>
<pre><?
foreach($output as $line) {
echo $line."<br>";
}
?></pre>
<br>
<? if (file_exists($backup_file ?? '')) { ?>
<a href='<?=$config['rel_root_folder']?>tmp/<?=$filename?>' target='_blank'><i class="fas fa-file-export"></i> Télécharger le DUMP généré</a>
<? } else { ?>
Le DUMP n'a pas été généré
<? } ?>
<br>
<br>
<h4>Archives des anciennes sauvegardes</h4>
<ul style="padding: 1em 0 1em 40px;">
<? foreach($sql_files as $file) { ?>
<li style="padding: 0 0 0.2em 0;"><?=basename($file)?> - <a href='<?=$config['rel_root_folder']?>tmp/<?=basename($file)?>' target='_blank'><i class="fas fa-download"></i> Télécharger</a> - <a href='<?=$config['rel_root_folder']?>admin/sql-backup/delete/<?=basename($file)?>'><i class="fas fa-trash"></i> Effacer</a></li>
<? } ?>
</ul>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

View File

@@ -15,7 +15,7 @@
?></pre>
<br>
<? if (file_exists($report)) { ?>
<a href='/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>
<a href='<?=$config['rel_root_folder']?>tmp/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>
<? } else { ?>
Echec de la commande
<? } ?>