feat: categorias de integracion (pagina-web/sam/profesores/otras-apps) + badge prod/dev
This commit is contained in:
1 parent
3787152ca0
commit
66ed027043
3 files changed
+59
-19
No files matched your search
+30
-2
@@ -10,11 +10,14 @@ export default function UploadPage() {
|
||||
branch: "main",
|
||||
port: "",
|
||||
subdomain: "",
|
||||
category: "otras-apps",
|
||||
});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [result, setResult] = useState<{ ok: boolean; message: string } | null>(null);
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleChange = (
|
||||
e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>
|
||||
) => {
|
||||
setForm({ ...form, [e.target.name]: e.target.value });
|
||||
};
|
||||
|
||||
@@ -27,6 +30,7 @@ export default function UploadPage() {
|
||||
name: form.name.trim().toLowerCase(),
|
||||
repoUrl: form.repoUrl.trim(),
|
||||
branch: form.branch.trim() || "main",
|
||||
category: form.category,
|
||||
};
|
||||
if (form.port) payload.port = parseInt(form.port, 10);
|
||||
if (form.subdomain) payload.subdomain = form.subdomain.trim();
|
||||
@@ -43,7 +47,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: "" });
|
||||
setForm({ name: "", repoUrl: "", branch: "main", port: "", subdomain: "", category: "otras-apps" });
|
||||
} else {
|
||||
setResult({ ok: false, message: data.error || `Error HTTP ${res.status}` });
|
||||
}
|
||||
@@ -188,6 +192,27 @@ export default function UploadPage() {
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div className="col-md-6">
|
||||
<label className="form-label fw-semibold">
|
||||
¿A qué corresponde? <span className="text-danger">*</span>
|
||||
</label>
|
||||
<select
|
||||
name="category"
|
||||
value={form.category}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="form-select"
|
||||
>
|
||||
<option value="pagina-web">Página Web</option>
|
||||
<option value="sam">SAM</option>
|
||||
<option value="profesores">Profesores</option>
|
||||
<option value="otras-apps">Otras Aplicaciones</option>
|
||||
</select>
|
||||
<div className="form-text">
|
||||
Define en qué sección del índice SAM aparece el módulo.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="col-md-6">
|
||||
<label className="form-label fw-semibold">Rama</label>
|
||||
<input
|
||||
@@ -197,6 +222,9 @@ export default function UploadPage() {
|
||||
placeholder="main"
|
||||
className="form-control"
|
||||
/>
|
||||
<div className="form-text">
|
||||
main = producción, otra rama = desarrollo.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="col-12 mt-2">
|
||||
|
||||
Reference in new issue
Block a user