Hide repositories with 0 tags count

This commit is contained in:
Roman Vynar 2020-02-19 11:29:54 +02:00
parent 67d82c7d59
commit b6398fa33c
3 changed files with 9 additions and 1 deletions

View File

@ -7,11 +7,12 @@
such as those generated by Docker BuildX or manually (thanks to Christoph Honal @StarGate01).
So now we support the following formats: Manifest v2 schema 1, Manifest v2 schema 2, Manifest List v2 schema 2
and all their confusing combinations.
* Amend representation of the tag info page.
* Change logging library, add "-log-level" argument and put most of the logging into DEBUG mode.
* You can define timezone when running container by adding `TZ` env var, e.g. "-e TZ=America/Los_Angeles"
(thanks to @gminog).
* Fix initial ownership of /opt/data dir in Dockerfile.
* Amend representation of the tag info page.
* Hide repositories with 0 tags count.
### 0.8.2 (2019-07-30)

View File

@ -302,6 +302,11 @@ func (c *Client) DeleteTag(repo, tag string) {
c.logger.Error(errs[0])
} else {
// Returns 202 on success.
if !strings.Contains(repo, "/") {
c.tagCounts["library/"+repo]--
} else {
c.tagCounts[repo]--
}
c.logger.Infof("DELETE %s (tag:%s) %s", uri, tag, resp.Status)
}
}

View File

@ -56,10 +56,12 @@
</thead>
<tbody>
{{range repo := repos}}
{{if !isset(tagCounts[namespace+"/"+repo]) || (isset(tagCounts[namespace+"/"+repo]) && tagCounts[namespace+"/"+repo] > 0)}}
<tr>
<td><a href="{{ basePath }}/{{ namespace }}/{{ repo|url }}">{{ repo }}</a></td>
<td>{{ tagCounts[namespace+"/"+repo] }}</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>