apuntes:backend_frontend
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| apuntes:backend_frontend [2025/03/24 09:32] – [Frontend: carga de datos en una tabla] Santiago Faci | apuntes:backend_frontend [2025/03/24 09:34] (current) – [Backend: API] Santiago Faci | ||
|---|---|---|---|
| Line 611: | Line 611: | ||
| </ | </ | ||
| + | ==== Frontend: Utilidades ==== | ||
| + | |||
| + | <file javascript documentUtils.js> | ||
| + | const icons = new Map(); | ||
| + | icons.set(' | ||
| + | '< | ||
| + | '< | ||
| + | '</ | ||
| + | ); | ||
| + | icons.set(' | ||
| + | '< | ||
| + | '< | ||
| + | '< | ||
| + | '</ | ||
| + | ); | ||
| + | // TODO Añadir más iconos | ||
| + | |||
| + | const el = function (elementId) { | ||
| + | return document.getElementById(elementId); | ||
| + | }; | ||
| + | |||
| + | const icon = function(iconName) { | ||
| + | return icons.get(iconName); | ||
| + | }; | ||
| + | |||
| + | const td = function(text) { | ||
| + | return '< | ||
| + | } | ||
| + | |||
| + | module.exports = { | ||
| + | el, | ||
| + | icon, | ||
| + | td | ||
| + | }; | ||
| + | </ | ||
| ==== Frontend: carga de datos en una tabla ==== | ==== Frontend: carga de datos en una tabla ==== | ||
| Line 691: | Line 726: | ||
| }; | }; | ||
| </ | </ | ||
| + | ==== Frontend: Diálogos ==== | ||
| + | |||
| + | <file javascript dialogUtils.js> | ||
| + | import Toastify from ' | ||
| + | import ' | ||
| + | |||
| + | const notifyError = function(message) { | ||
| + | Toastify({ | ||
| + | text: message, | ||
| + | duration: 3000, | ||
| + | gravity: ' | ||
| + | position: ' | ||
| + | style: { | ||
| + | background: " | ||
| + | }, | ||
| + | }).showToast(); | ||
| + | }; | ||
| + | |||
| + | const notifyOk = function(message) { | ||
| + | Toastify({ | ||
| + | text: message, | ||
| + | duration: 3000, | ||
| + | gravity: ' | ||
| + | position: ' | ||
| + | style: { | ||
| + | background: " | ||
| + | }, | ||
| + | }).showToast(); | ||
| + | }; | ||
| + | |||
| + | module.exports = { | ||
| + | notifyError, | ||
| + | notifyOk | ||
| + | }; | ||
| + | </ | ||
| + | |||
| ==== Frontend: formulario de registro ==== | ==== Frontend: formulario de registro ==== | ||
apuntes/backend_frontend.1742808731.txt.gz · Last modified: by Santiago Faci
