puerta/internal/server/admin.html

242 lines
7.2 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>puerta@nidi.to</title>
<link rel="stylesheet" href="https://cdn.rob.mx/css/fonts.css" />
<link rel="stylesheet" href="https://cdn.rob.mx/nidito/index.css" />
<link rel="stylesheet" href="/static/index.css" />
2023-01-03 07:40:38 +00:00
<style>
#user-list {
2023-01-04 04:21:49 +00:00
display: grid;
2023-01-03 07:40:38 +00:00
padding: 0;
margin: 0;
2023-01-04 04:21:49 +00:00
grid-template-columns: repeat(3, 1fr);
gap: 10px;
grid-auto-rows: minmax(100px, auto);
position: relative;
2023-01-03 07:40:38 +00:00
}
#main-nav a {
color: #fff
}
2023-01-04 04:21:49 +00:00
table {
width: 100%;
2023-01-03 07:40:38 +00:00
}
2023-01-04 04:21:49 +00:00
.rex-record {
font-size: .8em;
2023-01-03 07:40:38 +00:00
}
</style>
</head>
<body>
<header id="main-header">
<div class="container">
<h1>Puerta</h1>
2023-01-03 07:40:38 +00:00
<nav id="main-nav">
<a class="nav-item" href="#invitades">Invitades</a>
<a class="nav-item" href="#crear">Crear Invitade</a>
<a class="nav-item" href="#registro">Registro</a>
</nav>
</div>
</header>
<main class="container">
2023-01-03 07:40:38 +00:00
<section id="invitades" class="hidden">
<h2>Invitades</h2>
<ul id="user-list"></ul>
<template id="user-info-panel">
<style>
@import "/static/index.css";
2023-01-04 04:21:49 +00:00
:host {
border: 1px solid #c11145;
border-radius: 5px;
box-sizing: border-box;
transition: all ease-in-out .2s;
}
:host(.editing) {
position: absolute;
background-color: #f9f2f4;
float: left;
width: 100%;
box-shadow: 0px 1px 4px, 2px 2px #c11145;
}
button {
font-family: "Aestetico", sans-serif;
border-width: 2px;
border-radius: 6px;
}
header h3 {
background: #c46e87;
margin: 0;
padding: .5em .2em;
color: #fff
}
header .user-info-meta {
padding: .5em .2em;
}
header button {
float: right;
border-radius: 100%;
background-color: rgba(255,255,255,.5);
margin: .5em;
font-size: 1em;
width: 1.5em;
height: 1.5em;
}
header button:hover {
background-color: rgba(255,255,255,.8)
}
form {
padding: .5em;
}
#actions {
border-top: 1px solid #eee;
padding: .5em 0;
margin: .5em 0em;
}
.user-delete {
font-size: 1.2em;
display: inline;
}
.user-save {
float: right;
font-size: 1.2em;
}
2023-01-03 07:40:38 +00:00
.user-info-panel {
list-style: none;
}
</style>
<li class="user-info-panel">
<header>
2023-01-04 04:21:49 +00:00
<button class="user-edit"></button>
2023-01-03 07:40:38 +00:00
<h3>Alguien</h3>
2023-01-04 04:21:49 +00:00
<div class="user-info-meta">
<code>alguien</code>
</div>
2023-01-03 07:40:38 +00:00
</header>
<form action="/api/user/:id" class="user-info-panel-details hidden">
<label for="name">Nombre</label>
<input name="name" value="" placeholder="João Gilberto" required />
2023-01-04 04:21:49 +00:00
<label for="greeting">Saludo</label>
2023-01-03 07:40:38 +00:00
<input name="greeting" placeholder="Olá Joãzinho!" />
<label for="password">Password</label>
<input type="password" name="password" />
<label for="schedule">Horarios</label>
<input type="text" name="schedule" placeholder="days=1-5 hours=8-20:35" autocorrect="off"/>
<label for="expires">Expires</label>
<input type="datetime-local" name="expires" placeholder="2023-01-01T00:00:00Z" />
<label for="ttl">TTL</label>
<input type="text" name="max_ttl" placeholder="30d" autocorrect="off"/>
2023-01-04 04:21:49 +00:00
<div>
<input type="checkbox" name="is_admin" /><label for="admin">Admin?</label>
</div>
2023-01-03 07:40:38 +00:00
2023-01-04 04:21:49 +00:00
<div>
<input type="checkbox" name="second_factor" /><label for="admin">Requiere 2FA?</label>
</div>
2023-01-03 07:40:38 +00:00
2023-01-04 04:21:49 +00:00
<div id="actions">
<button class="user-delete">Eliminar</button>
<button class="user-save">Guardar cambios</button>
</div>
2023-01-03 07:40:38 +00:00
</form>
</li>
</template>
</section>
<section id="crear" class="hidden">
<h2>Crear Invitade</h2>
<form id="create-user" method="post" action="/api/user">
<label for="user">Handle</label>
2023-01-03 07:40:38 +00:00
<input name="handle" placeholder="joao" autocorrect="off" required />
<label for="name">Nombre</label>
2023-01-03 07:40:38 +00:00
<input name="name" placeholder="João Gilberto" required />
2023-01-04 04:21:49 +00:00
<label for="greeting">Saludo</label>
<input name="greeting" placeholder="Olá Joãzinho!" />
<label for="password">Password</label>
2023-01-03 07:40:38 +00:00
<input type="password" name="password" required />
<label for="schedule">Horarios</label>
<input type="text" name="schedule" placeholder="days=1-5 hours=8-20:35" autocorrect="off"/>
<label for="expires">Expires</label>
<input type="datetime-local" name="expires" placeholder="2023-01-01T00:00:00Z" />
<label for="max_ttl">TTL</label>
<input type="text" name="max_ttl" placeholder="30d" autocorrect="off"/>
2023-01-04 04:21:49 +00:00
<div>
<input type="checkbox" name="is_admin" /><label for="admin">Admin?</label>
</div>
2023-01-04 04:21:49 +00:00
<div>
<input type="checkbox" name="second_factor" /><label for="admin">Requiere 2FA?</label>
</div>
<button id="create-user-submit" type="submit">Crear</button>
</form>
</section>
2023-01-03 07:40:38 +00:00
<section id="registro" class="hidden">
<h2>Entradas recientes</h2>
<table>
2023-01-04 04:21:49 +00:00
<colgroup>
<col span="1" style="width: 10%;">
<col span="1" style="width: 15%;">
<col span="1" style="width: 5%;">
<col span="1" style="width: 5%;">
<col span="1" style="width: 15%;">
<col span="1" style="width: 50%;">
</colgroup>
2023-01-03 07:40:38 +00:00
<thead>
<tr>
<th>ts</th>
<th>nombre</th>
<th>status</th>
<th>2fa</th>
<th>ip</th>
<th>ua</th>
</tr>
</thead>
<tbody id="rex-records">
</tbody>
</table>
<template id="rex-record">
<style>
@import "/static/index.css";
</style>
</template>
</section>
</main>
2023-01-03 07:40:38 +00:00
<script src="https://cdn.jsdelivr.net/npm/@teamhanko/hanko-webauthn@latest/dist/browser-global/hanko-webauthn.browser-global.js"></script>
2023-01-03 07:40:38 +00:00
<script type="module" src="/static/admin.js"></script>
</body>
</html>