faaso/public/index.html

107 lines
3.5 KiB
HTML

<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.colors.min.css" /> <script src="https://unpkg.com/htmx.org@2.0.0"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<header class="container">
<h1>FaaSO Admin Interface</h1>
</header>
<article>
<nav>
<ul>
<li><strong style="font-size: 200%;">Your Funko Collection</strong></li>
</ul>
<ul>
<li><button id="update-funkos" style="float:right; display:inline;" hx-trigger="load, click, every 60s"
hx-get="funkos/?format=html" hx-target="#funko-list">
Refresh
</button>
</ul>
</nav>
<span id="message"></span>
<table hx-target="#message" class="striped">
<thead>
<tr>
<th>Name</th>
<th>Instances</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="funko-list">
</tbody>
</table>
<div id="terminal" style="resize: vertical; overflow: auto;"></div>
</article>
<script>
update_funkos = function () {
document.getElementById("update-funkos").click()
}
</script>
<article>
<nav>
<ul>
<li><strong style="font-size: 200%;">Your Secrets</strong>
</ul>
<ul>
<li><button id="update-secrets" style="float:right; display:inline;" hx-trigger="load, click, every 60s"
hx-get="secrets/?format=html" hx-target="#secret-list">
Refresh
</button>
<li><button style="float:right; display:inline;" onclick="show_new_secret()">
Add
</button>
</ul>
</nav>
<span id="message"></span>
<table hx-target="#message">
<thead>
<tr>
<th>Funko</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="secret-list">
</tbody>
<dialog id="add-secret">
<article>
<header>
New Secret
</header>
<form hx-post="secrets/">
<input placeholder="funko name" id="new-secret-funko" name="funko">
<input placeholder="secret name" id="new-secret-name" name="name">
<input placeholder="secret value" type="password" id="new-secret-password" name="value">
<fieldset role="group" style="text-align: right;">
<button style="width:9em; display: inline;" type="submit" hx-on:htmx:after-request="hide_new_secret()">CREATE</button>
<button style="width:9em; display: inline;" onclick="hide_new_secret(); close();" aria-label="Close" rel="prev">CLOSE</button>
</fieldset>
</form>
</article>
</dialog>
<script>
update_secrets = function() {
document.getElementById("update-secrets").click()
}
show_new_secret = function() {
document.getElementById('new-secret-funko').value=""
document.getElementById('new-secret-name').value=""
document.getElementById('new-secret-password').value=""
document.getElementById('add-secret').show()
}
hide_new_secret = function() {
document.getElementById('new-secret-funko').value=""
document.getElementById('new-secret-name').value=""
document.getElementById('new-secret-password').value=""
document.getElementById('add-secret').close()
update_secrets()
}
</script>
</article>
</body>