diff --git a/static/index.html b/static/index.html index 2ac9b5d..1a82972 100644 --- a/static/index.html +++ b/static/index.html @@ -485,17 +485,25 @@ function openRestoreModal(type, filename, size) { // Now get instructions based on type let instructions = ''; if (type === 'apps') { - instructions = `📦 Apps restaurado em: ${d.extracted_to}\n\n` + + const appName = filename.split('-')[0]; + instructions = `📦 App restaurado em: ${d.extracted_to}\n\n` + `Para aplicar:\n` + - ` cp -r ${d.extracted_to}/Camila/* /root/Apps/Camila/\n` + - ` cp -r ${d.extracted_to}/RAG/* /root/Apps/RAG/\n` + - ` cp -r ${d.extracted_to}/VOXDO/* /root/Apps/VOXDO/\n\n` + + ` rsync -av --ignore-existing ${d.extracted_to}/${appName}/ /root/Apps/${appName}/\n\n` + `Depois reinicie os serviços.`; } else if (type === 'bd') { - instructions = `🗄️ Backup BD restaurado em: ${d.extracted_to}\n\n` + + const dbType = filename.includes('supabase') ? 'Supabase' : 'Gitea'; + let sqlCommand = `cat ${d.sql_files?.[0] || ''} | docker exec -i psql -U postgres -d `; + + if (dbType === 'Supabase') { + sqlCommand = `cat ${d.sql_files?.[0] || ''} | docker exec -i supabase-db psql -U postgres -d postgres`; + } else { + sqlCommand = `cat ${d.sql_files?.[0] || ''} | docker exec -i coolify-db psql -U postgres -d postgres`; + } + + instructions = `🗄️ Backup BD (${dbType}) restaurado em: ${d.extracted_to}\n\n` + `SQL: ${d.sql_files?.join(', ') || 'não encontrado'}\n\n` + - `Para restaurar:\n` + - ` cat ${d.sql_files?.[0] || ''} | docker exec -i psql -U postgres -d `; + `Para restaurar execute no host:\n` + + ` ${sqlCommand}`; } else if (type === 'git') { instructions = `🐙 Backup Git restaurado em: ${d.extracted_to}\n\n` + `Arquivos: ${(d.files || []).slice(0,5).join(', ')}...\n\n` +