feat(webui): bootstrap session handling and login process
This commit is contained in:
parent
63e2b1b09d
commit
6e069484cb
18 changed files with 447 additions and 1 deletions
20
pkg/webui/html/base.html
Normal file
20
pkg/webui/html/base.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/static/favicon.svg">
|
||||
<link rel="stylesheet" href="/static/main.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||
<title>tfstated</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
</header>
|
||||
<main class="container">
|
||||
{{ template "main" . }}
|
||||
</main>
|
||||
<footer>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
6
pkg/webui/html/error.html
Normal file
6
pkg/webui/html/error.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{ define "main" }}
|
||||
<article>
|
||||
<h1>{{ .Status }} - {{ .StatusText }}</h1>
|
||||
<p>{{ .Err }}</p>
|
||||
</article>
|
||||
{{ end }}
|
3
pkg/webui/html/index.html
Normal file
3
pkg/webui/html/index.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ define "main" }}
|
||||
<h1>TODO</h1>
|
||||
{{ end }}
|
29
pkg/webui/html/login.html
Normal file
29
pkg/webui/html/login.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{ define "main" }}
|
||||
{{ if .Forbidden }}
|
||||
<article>
|
||||
<p class="error-message">Invalid username or password</p>
|
||||
</article>
|
||||
{{ end }}
|
||||
<form action="/login" method="post">
|
||||
<fieldset>
|
||||
<label>
|
||||
Username
|
||||
<input type="text"
|
||||
placeholder="Username"
|
||||
name="username"
|
||||
value="{{ .Username }}"
|
||||
{{ if .Forbidden }}aria-invalid="true"{{ end }}
|
||||
required>
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
<input type="password"
|
||||
placeholder="Password"
|
||||
name="password"
|
||||
{{ if .Forbidden }}aria-invalid="true"{{ end }}
|
||||
required>
|
||||
</label>
|
||||
</fieldset>
|
||||
<button type="submit" value="login">Login</button>
|
||||
</form>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue