Skip to content

Commit

Permalink
feat(endpoint/log.html): add empty placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Dec 13, 2022
1 parent 335a489 commit a092e0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/endpoint/templates/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
color: rgba(var(--fg), .3);
}

.empty-log {
display: block;
text-align: center;
font-size: 150%;
color: rgba(var(--fg), .5);
}

table {
width: 100%;
border-collapse: collapse;
Expand Down Expand Up @@ -119,6 +126,9 @@
</form>
</article>
<article>
{{ if eq .Total 0 -}}
<span class="empty-log">No Data</span>
{{- else -}}
{{ block "pager" . }}{{ end }}
<table>
<thead>
Expand Down Expand Up @@ -155,6 +165,7 @@
<a href="{{ printf "/log.ltsv?%s" .RawQuery }}" type="text/plain" download="ayd-log.ltsv">LTSV</a>
<a href="{{ printf "/log.json?%s" .RawQuery }}" type="application/json" download="ayd-log.json">JSON</a>
</div>
{{ end }}
</article>

<script>
Expand Down
8 changes: 8 additions & 0 deletions internal/endpoint/testdata/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@
color: rgba(var(--fg), .3);
}

.empty-log {
display: block;
text-align: center;
font-size: 150%;
color: rgba(var(--fg), .5);
}

table {
width: 100%;
border-collapse: collapse;
Expand Down Expand Up @@ -380,6 +387,7 @@
<a href="/log.ltsv?query=&amp;since=2021-01-01T00%3A00%3A00Z&amp;until=2021-01-03T00%3A00%3A00Z" type="text/plain" download="ayd-log.ltsv">LTSV</a>
<a href="/log.json?query=&amp;since=2021-01-01T00%3A00%3A00Z&amp;until=2021-01-03T00%3A00%3A00Z" type="application/json" download="ayd-log.json">JSON</a>
</div>

</article>

<script>
Expand Down

0 comments on commit a092e0b

Please sign in to comment.