summaryrefslogtreecommitdiff
path: root/pkg/webui/html
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/webui/html')
-rw-r--r--pkg/webui/html/states.html6
-rw-r--r--pkg/webui/html/states_new.html33
2 files changed, 39 insertions, 0 deletions
diff --git a/pkg/webui/html/states.html b/pkg/webui/html/states.html
index 787ac73..37d80cf 100644
--- a/pkg/webui/html/states.html
+++ b/pkg/webui/html/states.html
@@ -1,5 +1,11 @@
{{ define "main" }}
<main class="responsive" id="main">
+ <a href="/states/new">
+ <button class="small-round">
+ <i>add</i>
+ <span>New</span>
+ </button>
+ </a>
<table class="clickable-rows no-space">
<thead>
<tr>
diff --git a/pkg/webui/html/states_new.html b/pkg/webui/html/states_new.html
new file mode 100644
index 0000000..68facc7
--- /dev/null
+++ b/pkg/webui/html/states_new.html
@@ -0,0 +1,33 @@
+{{ define "main" }}
+<main class="responsive">
+ <form action="/states/new" enctype="multipart/form-data" method="post">
+ <fieldset>
+ <div class="field border label{{ if .PathError }} invalid{{ end }}">
+ <input autofocus
+ id="path"
+ name="path"
+ required
+ type="text"
+ value="{{ .Path }}">
+ <label for="path">Path</label>
+ {{ if .PathDuplicate }}
+ <span class="error">This path already exist</span>
+ {{ else if .PathError }}
+ <span class="error">Invalid path</span>
+ {{ else }}
+ <span class="helper">Valid URL path beginning with a /</span>
+ {{ end }}
+ </div>
+ <div class="field label border">
+ <input name="file"
+ required
+ type="file">
+ <input type="text">
+ <label>File</label>
+ <span class="helper">JSON state file</span>
+ </div>
+ <button class="small-round" type="submit" value="submit">New</button>
+ </fieldset>
+ </form>
+</main>
+{{ end }}