chore(docs): Add P2601 Dashboard UI updates and bitacora records

This commit is contained in:
Ricardo Monla
2026-02-24 17:39:59 -03:00
parent 2acf1cd416
commit cec837edbe
15 changed files with 183 additions and 4 deletions
+17 -2
View File
@@ -105,11 +105,26 @@ def procesar_backups_tipo_proxmox(tarea_cfg)
end
if nombre_vm.nil? || nombre_vm.empty?
# Fallback: extraemos el ID de la VM del nombre de archivo (ej. vzdump-qemu-101-...)
# Fallback 1: Extraer el nombre de la VM desde dentro del propio archivo .log
begin
File.foreach(ruta_log) do |line|
if line =~ /INFO: VM Name:\s*(.+)$/
nombre_vm = $1.strip
log :info, "#{tarea_cfg[:id]}: Nombre '#{nombre_vm}' extraído del log '#{nombre_base_log}'."
break
end
end
rescue StandardError => e
log :warn, "#{tarea_cfg[:id]}: Error leyendo log para extraer VM Name: #{e.message}"
end
end
if nombre_vm.nil? || nombre_vm.empty?
# Fallback 2: extraemos el ID de la VM del nombre de archivo (ej. vzdump-qemu-101-...)
regex_match = nombre_base_log.match(/vzdump-(?:qemu|lxc)-(\d+)-/)
if regex_match
nombre_vm = "VM-#{regex_match[1]}"
log :info, "#{tarea_cfg[:id]}: Sin .notes válido para '#{nombre_base_log}'. Respaldo asignado a: #{nombre_vm}"
log :info, "#{tarea_cfg[:id]}: Sin .notes ni nombre en log para '#{nombre_base_log}'. Respaldo asignado a: #{nombre_vm}"
else
log :warn, "#{tarea_cfg[:id]}: No se pudo determinar nombre de VM para '#{nombre_base_log}'. Saltando."
next