summaryrefslogtreecommitdiff
path: root/pkg/webui/html
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/webui/html')
-rw-r--r--pkg/webui/html/base.html20
-rw-r--r--pkg/webui/html/error.html6
-rw-r--r--pkg/webui/html/index.html3
-rw-r--r--pkg/webui/html/login.html29
4 files changed, 58 insertions, 0 deletions
diff --git a/pkg/webui/html/base.html b/pkg/webui/html/base.html
new file mode 100644
index 0000000..1c15cc5
--- /dev/null
+++ b/pkg/webui/html/base.html
@@ -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>
diff --git a/pkg/webui/html/error.html b/pkg/webui/html/error.html
new file mode 100644
index 0000000..d2ea7e1
--- /dev/null
+++ b/pkg/webui/html/error.html
@@ -0,0 +1,6 @@
+{{ define "main" }}
+<article>
+ <h1>{{ .Status }} - {{ .StatusText }}</h1>
+ <p>{{ .Err }}</p>
+</article>
+{{ end }}
diff --git a/pkg/webui/html/index.html b/pkg/webui/html/index.html
new file mode 100644
index 0000000..5c50159
--- /dev/null
+++ b/pkg/webui/html/index.html
@@ -0,0 +1,3 @@
+{{ define "main" }}
+<h1>TODO</h1>
+{{ end }}
diff --git a/pkg/webui/html/login.html b/pkg/webui/html/login.html
new file mode 100644
index 0000000..0c2a167
--- /dev/null
+++ b/pkg/webui/html/login.html
@@ -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 }}