fix: align backup ui and downloads

This commit is contained in:
2026-03-10 13:48:55 +01:00
parent acee6d471c
commit 4757c766f6
5 changed files with 283 additions and 133 deletions

View File

@@ -4,15 +4,17 @@ type BackupScript = {
key: string
label: string
icon?: string
downloadFolders?: string[]
command: string
}
export default defineEventHandler(() => {
return {
scripts: (scripts as BackupScript[]).map(({ key, label, icon }) => ({
scripts: (scripts as BackupScript[]).map(({ key, label, icon, downloadFolders }) => ({
key,
label,
icon: icon || "mdi:play-circle-outline"
icon: icon || "mdi:play-circle-outline",
downloadFolders: downloadFolders || []
}))
}
})

View File

@@ -4,6 +4,7 @@ import scripts from "../config/backup-script.json"
type BackupScript = {
key: string
label: string
downloadFolders?: string[]
command: string
}
@@ -44,6 +45,7 @@ export default defineEventHandler(async (event) => {
ok: true,
key: script.key,
label: script.label,
downloadFolders: script.downloadFolders || [],
output: output.trim()
}
} catch (error) {

View File

@@ -3,18 +3,20 @@
"key": "backup-bdd-recette",
"label": "Backup BDD recette",
"icon": "mdi:database-export",
"command": "ssh ferme 'cd /home/malio/Scripts-Serveur/RecetteScripts && bash backup-bdd-recette.sh && exit'"
"downloadFolders": ["ferme", "inventory", "sirh", "user"],
"command": "ssh ferme 'cd /home/malio/Malio-ops/RecetteScripts && bash backup-bdd-recette.sh && exit'"
},
{
"key": "check-statut-recette",
"label": "Check statut recette",
"icon": "mdi:server-network",
"command": "ssh ferme 'cd /home/malio/Scripts-Serveur/RecetteScripts && bash check-statut-recette.sh && exit'"
"command": "ssh ferme 'cd /home/malio/Malio-ops/RecetteScripts && bash check-statut-recette.sh && exit'"
},
{
"key": "backup-vaultwarden",
"label": "Backup vaultwarden",
"icon": "mdi:data",
"command": "ssh ferme 'cd /home/malio/Scripts-Serveur/BackupVaultWarden && bash backup-vaultwarden.sh && exit'"
"downloadFolders": ["bitwarden"],
"command": "ssh bitwarden 'cd /home/matt/vaultwarden/Malio-ops/BackupVaultWarden && bash backup-vaultwarden.sh && exit'"
}
]