feat: upload con kind/context/visible + toggle visible ya estaba
This commit is contained in:
1 parent
222fdac54d
commit
08bf7254a1
1 file changed
+16
-1
+16
-1
@@ -17,6 +17,7 @@ export default function UploadPage() {
|
||||
kind: "frontend",
|
||||
visible: true,
|
||||
targetPort: "",
|
||||
context: "",
|
||||
});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [result, setResult] = useState<{ ok: boolean; message: string } | null>(null);
|
||||
@@ -49,6 +50,7 @@ export default function UploadPage() {
|
||||
if (form.port) payload.port = parseInt(form.port, 10);
|
||||
if (form.subdomain) payload.subdomain = form.subdomain.trim();
|
||||
if (form.targetPort) payload.targetPort = parseInt(form.targetPort, 10);
|
||||
if (form.kind === "backend" && form.context.trim()) payload.context = form.context.trim();
|
||||
|
||||
try {
|
||||
const res = await fetch("/api/modules", {
|
||||
@@ -62,7 +64,7 @@ export default function UploadPage() {
|
||||
ok: true,
|
||||
message: `Módulo "${payload.name}" registrado. Deploy: ${data.webhook ? "webhook creado" : "sin webhook"}${data.deployLog ? " · " + data.deployLog.slice(0, 80) : ""}`,
|
||||
});
|
||||
setForm({ name: "", repoUrl: "", branch: "main", port: "", subdomain: "", category: "otras-apps", kind: "frontend", visible: true, targetPort: "" });
|
||||
setForm({ name: "", repoUrl: "", branch: "main", port: "", subdomain: "", category: "otras-apps", kind: "frontend", visible: true, targetPort: "", context: "" });
|
||||
} else {
|
||||
setResult({ ok: false, message: data.error || `Error HTTP ${res.status}` });
|
||||
}
|
||||
@@ -199,6 +201,19 @@ export default function UploadPage() {
|
||||
/>
|
||||
<div className="form-text">Puerto que expone el contenedor.</div>
|
||||
</div>
|
||||
<div className="col-md-6">
|
||||
<label className="form-label fw-semibold">
|
||||
Subdirectorio <small className="text-muted">(backend monorepo)</small>
|
||||
</label>
|
||||
<input
|
||||
name="context"
|
||||
value={form.context}
|
||||
onChange={handleChange}
|
||||
placeholder="ej: backend-dotnet"
|
||||
className="form-control"
|
||||
/>
|
||||
<div className="form-text">Carpeta con el Dockerfile (vacío = raíz).</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
|
||||
Reference in new issue
Block a user