Skip to content

Commit

Permalink
Add optional Notes field to streams
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoern-r committed May 11, 2020
1 parent fff760c commit a3ae627
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func AddHandler(store *Store) handleFunc {
Application: r.PostFormValue("application"),
AuthKey: r.PostFormValue("auth_key"),
AuthExpire: *expiry,
Notes: r.PostFormValue("notes"),
}

store.AddStream(stream)
Expand Down
1 change: 1 addition & 0 deletions storage/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ message Stream {
string auth_key = 4;
int64 auth_expire = 5;
string id = 6;
string notes = 7;
}
7 changes: 7 additions & 0 deletions template.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var templates = template.Must(template.New("form.html").Parse(
<th>Name</th>
<th>Auth</th>
<th>Expires</th>
<th>Notes</th>
<th></th>
</thead>
<tbody>
Expand All @@ -61,6 +62,7 @@ var templates = template.Must(template.New("form.html").Parse(
{{.AuthExpire}}
{{end}}
</td>
<td style="text-align:right;">{{.Notes}}</td>
<td style="text-align:right;">
<form class="inline" action="{{$.Store.Prefix}}/remove" method="POST">
{{ $.CsrfTemplate }}
Expand Down Expand Up @@ -103,6 +105,11 @@ var templates = template.Must(template.New("form.html").Parse(
</label>
<input type="text" id="authExpire" name="auth_expire" placeholder="never">
</div>
<div class="col-sm-12 col-md-6">
<label for="authKey">Notes</label>
<input type="text" id="notes" name="notes" placeholder="optional notes">
</div>
</div>
<div class="row">
Expand Down

0 comments on commit a3ae627

Please sign in to comment.