Compare commits

...

5 Commits

5 changed files with 85 additions and 7 deletions

View File

@@ -1909,12 +1909,12 @@ def get_dashboard_data(
mechanic_ranking = [
schemas.MechanicRanking(
mechanic_id=m.id,
mechanic_name=m.full_name,
mechanic_name=m.full_name or "Sin nombre",
total_inspections=m.total,
avg_score=round(m.avg_score, 2) if m.avg_score else 0.0,
completion_rate=round((m.completed / m.total * 100) if m.total > 0 else 0, 2)
)
for m in mechanic_stats
for m in mechanic_stats if m.full_name
]
# ESTADÍSTICAS POR CHECKLIST
@@ -1955,11 +1955,11 @@ def get_dashboard_data(
checklist_stats = [
schemas.ChecklistStats(
checklist_id=c.id,
checklist_name=c.name,
checklist_name=c.name or "Sin nombre",
total_inspections=c.total,
avg_score=round(c.avg_score, 2) if c.avg_score else 0.0
)
for c in checklist_stats_data
for c in checklist_stats_data if c.name
]
# INSPECCIONES POR FECHA (últimos 30 días)
@@ -2099,8 +2099,8 @@ def get_inspections_report(
"id": r.id,
"vehicle_plate": r.vehicle_plate,
"checklist_id": r.checklist_id,
"checklist_name": r.checklist_name,
"mechanic_name": r.mechanic_name,
"checklist_name": r.checklist_name or "Sin nombre",
"mechanic_name": r.mechanic_name or "Sin nombre",
"status": r.status,
"score": r.score,
"max_score": r.max_score,

25
backend/docker.ps1 Normal file
View File

@@ -0,0 +1,25 @@
Clear-Host
# Input
$version = Read-Host "Ingrese el numero de version (ej: 1.0.34)"
Write-Host "`n=== Construyendo imagen dymai/syntria-backend:$version ===`n"
docker build -t "dymai/syntria-backend:$version" .
if ($LASTEXITCODE -ne 0) {
Write-Host "`nERROR: El build fallo. No se realizara el push." -ForegroundColor Red
pause
exit 1
}
Write-Host "`n=== Subiendo imagen a Docker Hub ===`n"
docker push "dymai/syntria-backend:$version"
if ($LASTEXITCODE -ne 0) {
Write-Host "`nERROR: El push fallo." -ForegroundColor Red
pause
exit 1
}
Write-Host "`n=== Proceso completado exitosamente ===`n" -ForegroundColor Green
pause

27
frontend/buildFront.ps1 Normal file
View File

@@ -0,0 +1,27 @@
Clear-Host
# Pedir version
$version = Read-Host "Ingrese el numero de version (ej: 1.0.34)"
Write-Host "`n=== Construyendo imagen dymai/syntria-frontend:$version ===`n"
docker build -f Dockerfile.prod -t "dymai/syntria-frontend:$version" .
# Si build falla, no continuar
if ($LASTEXITCODE -ne 0) {
Write-Host "`nERROR: El build fallo. No se realizara el push." -ForegroundColor Red
pause
exit 1
}
Write-Host "`n=== Subiendo imagen a Docker Hub ===`n"
docker push "dymai/syntria-frontend:$version"
# Si push falla, mostrar error
if ($LASTEXITCODE -ne 0) {
Write-Host "`nERROR: El push fallo." -ForegroundColor Red
pause
exit 1
}
Write-Host "`n=== Proceso completado exitosamente ===`n" -ForegroundColor Green
pause

View File

@@ -8,7 +8,7 @@ export default function Sidebar({ user, activeTab, setActiveTab, sidebarOpen, se
<div className="w-8 h-8 bg-gradient-to-br from-indigo-500 to-purple-500 rounded-lg flex items-center justify-center">
<span className="text-white font-bold text-lg">S</span>
</div>
<h2 className="text-xl font-bold bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent">Syntria</h2>
<h2 className="text-xl font-bold bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent">Ayutec</h2>
</div>
)}
<button

26
gitUpdate.ps1 Normal file
View File

@@ -0,0 +1,26 @@
Clear-Host
# Pedir mensaje de commit
$mensaje = Read-Host "Ingrese el mensaje de commit"
Write-Host "Agregando archivos..."
git add .
Write-Host "Creando commit..."
git commit -m "$mensaje"
Write-Host "Haciendo push a la rama develop..."
$pushOutput = git push origin develop 2>&1
# Revisar si fallo la autenticacion
if ($pushOutput -match "Authentication failed" -or $pushOutput -match "Failed to authenticate") {
Write-Host "`nERROR: Fallo la autenticacion. Ejecutando git init para reconfigurar..." -ForegroundColor Red
git init
Write-Host "Intentando push nuevamente..."
git push origin develop
}
Write-Host "`nProceso finalizado."
pause