| 1 | <!DOCTYPE html> |
| 2 | <html lang="es"> |
| 3 | |
| 4 | <head> |
| 5 | |
| 6 | <meta charset="UTF-8"> |
| 7 | <meta name="viewport" content="width=device-width"> |
| 8 | |
| 9 | <title>Perfil</title> |
| 10 | |
| 11 | <script type="module" src="js/lib/manejaErrores.js"></script> |
| 12 | <script type="module" src="./js/custom/mi-nav.js"></script> |
| 13 | |
| 14 | |
| 15 | </head> |
| 16 | |
| 17 | <body> |
| 18 | |
| 19 | <mi-nav></mi-nav> |
| 20 | |
| 21 | <h1>Perfil</h1> |
| 22 | |
| 23 | <p> |
| 24 | <output id="outputSan"> |
| 25 | <progress max="100">Cargando…</progress> |
| 26 | </output> |
| 27 | </p> |
| 28 | |
| 29 | <p> |
| 30 | <output id="outputRoles"></output> |
| 31 | </p> |
| 32 | |
| 33 | <p> |
| 34 | |
| 35 | <a id="login" hidden href="login.html">Iniciar sesión</a> |
| 36 | |
| 37 | <button id="botonLogout" type="button" hidden> |
| 38 | Terminar sesión |
| 39 | </button> |
| 40 | |
| 41 | </p> |
| 42 | |
| 43 | <script type="module"> |
| 44 | |
| 45 | import { descargaVista } from "./js/lib/descargaVista.js" |
| 46 | import { consume } from "./js/lib/consume.js" |
| 47 | import { recibeJson } from "./js/lib/recibeJson.js" |
| 48 | |
| 49 | addEventListener("load", descargaDatos) |
| 50 | |
| 51 | async function descargaDatos() { |
| 52 | await descargaVista("php/vista-perfil.php") |
| 53 | botonLogout.addEventListener("click", logout) |
| 54 | } |
| 55 | |
| 56 | async function logout() { |
| 57 | await consume(recibeJson('php/logout.php?')) |
| 58 | location.reload() |
| 59 | } |
| 60 | |
| 61 | </script> |
| 62 | |
| 63 | </body> |
| 64 | |
| 65 | </html> |