From bb25004e67465b415b257279b94c92592c12f183 Mon Sep 17 00:00:00 2001 From: pablinux Date: Wed, 21 Jan 2026 18:00:56 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20Cargar=20correctamente=20datos=20de=20la?= =?UTF-8?q?=20app=20en=20formulario=20de=20edici=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Construir script_path completo combinando path + entry_point - Usar valores por defecto cuando campos no existen en JSON - Agregar console.log para debug - El campo user usa 'pablinux' por defecto (no está en JSON) - Ahora los campos se llenan correctamente en lugar de mostrar solo placeholders --- web/edit.html | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/web/edit.html b/web/edit.html index 1ab4eab..c1910f2 100644 --- a/web/edit.html +++ b/web/edit.html @@ -456,15 +456,27 @@ const app = result.data; + console.log("App data:", app); // Debug + // Llenar formulario con datos actuales - document.getElementById("app_name").value = app.name; + document.getElementById("app_name").value = app.name || ""; document.getElementById("app_name").readOnly = true; // No cambiar nombre - document.getElementById("script_path").value = - app.entry_point; + + // Construir script_path completo + const scriptPath = + app.path && app.entry_point + ? `${app.path}/${app.entry_point}`.replace( + "//", + "/", + ) + : app.entry_point || ""; + + document.getElementById("script_path").value = scriptPath; document.getElementById("working_directory").value = - app.path; - document.getElementById("user").value = - app.user || "pablinux"; + app.path || ""; + + // El user no está en el JSON, usar valor por defecto + document.getElementById("user").value = "pablinux"; document.getElementById("restart_policy").value = "always"; document.getElementById("app_type").value = "nodejs"; document.getElementById("description").value = "";