Show logs when editing a code
All checks were successful
/ build-container (push) Successful in 8m14s
All checks were successful
/ build-container (push) Successful in 8m14s
This commit is contained in:
parent
060b5705c8
commit
a26b9cc63e
7 changed files with 113 additions and 5 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"html/template"
|
||||
"io/fs"
|
||||
"time"
|
||||
|
||||
"git.janky.solutions/finn/lockserver/config"
|
||||
)
|
||||
|
@ -19,7 +20,8 @@ var (
|
|||
Templates *template.Template
|
||||
|
||||
funcs = template.FuncMap{
|
||||
"version": func() string { return fmt.Sprintf("better-zwave-locks %s", config.Version) },
|
||||
"version": func() string { return fmt.Sprintf("better-zwave-locks %s", config.Version) },
|
||||
"time_since": func(t time.Time) string { return time.Since(t).Round(time.Second).String() },
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -8,4 +8,11 @@
|
|||
<br />
|
||||
<input type="submit" value="save" />
|
||||
</form>
|
||||
<br /><br />
|
||||
|
||||
<ul>
|
||||
{{ range $_, $entry := .Data.log }}
|
||||
<li>{{ $entry.State }} (<i>{{ $entry.Timestamp | time_since }} ago</i>)</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ template "footer.html" }}
|
||||
|
|
|
@ -20,4 +20,7 @@
|
|||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
||||
|
||||
<br /><br />
|
||||
|
||||
{{ template "footer.html" }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue