diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/error.gohtml | 5 | ||||
| -rw-r--r-- | templates/layout.gohtml | 17 | ||||
| -rw-r--r-- | templates/manifest.gohtml | 52 | ||||
| -rw-r--r-- | templates/repositories.gohtml | 17 | ||||
| -rw-r--r-- | templates/repository.gohtml | 22 |
5 files changed, 113 insertions, 0 deletions
diff --git a/templates/error.gohtml b/templates/error.gohtml new file mode 100644 index 0000000..9b7ba03 --- /dev/null +++ b/templates/error.gohtml @@ -0,0 +1,5 @@ +{{define "error"}}{{template "header" .}} + <h1>{{.Status}}</h1> + <p>{{.Message}}</p> + <p><a href="/">Back to registry</a></p> +{{template "footer" .}}{{end}} diff --git a/templates/layout.gohtml b/templates/layout.gohtml new file mode 100644 index 0000000..cf6d839 --- /dev/null +++ b/templates/layout.gohtml @@ -0,0 +1,17 @@ +{{define "header"}}<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>{{.Title}}</title> + <link rel="stylesheet" href="/assets/styles.css"> +</head> +<body> +<main> +{{end}} + +{{define "footer"}} +</main> +</body> +</html> +{{end}} diff --git a/templates/manifest.gohtml b/templates/manifest.gohtml new file mode 100644 index 0000000..93ebecc --- /dev/null +++ b/templates/manifest.gohtml @@ -0,0 +1,52 @@ +{{define "manifest"}}{{template "header" .}} + <h1>Manifest in repository <a href="{{repoURL .Repository.Name}}">{{.Repository.Name}}</a> in <a href="/">registry</a></h1> + <h2>Tags referencing manifest</h2> + <table> + <thead><tr><th scope="col">Tag</th><th scope="col">Last updated</th></tr></thead> + <tbody> + {{range .Manifest.Tags}} + <tr> + <td>{{if eq .ManifestDigest $.Manifest.Digest}}{{.Name}}{{else}}<a href="{{manifestURL $.Repository.Name .ManifestDigest .Name}}">{{.Name}}</a>{{end}}</td> + <td title="{{timestamp .UpdatedAt}}">{{age .UpdatedAt .Age}}</td> + </tr> + {{else}} + <tr><td colspan="2">No tags reference this manifest.</td></tr> + {{end}} + </tbody> + </table> + <br> + <h2>Pull address</h2> + <div><pre class="literal" style="display: inline-block">{{pull .RegistryHost .Repository.Name .SelectedTag .Manifest.Digest}}</pre></div> + <br> + + {{if eq .Manifest.Kind "index"}} + <h2>Manifests in list</h2> + <table> + <thead><tr><th scope="col" colspan="2">OS/Arch</th><th scope="col">Size</th><th scope="col">Pull address</th></tr></thead> + <tbody> + {{range .Manifest.Platforms}} + <tr> + <td>{{.Platform}}</td><td>{{.Variant}}</td> + <td style="text-align: right" title="{{.SizeBytes}} bytes">{{size .SizeBytes}}</td> + <td>{{pull $.RegistryHost $.Repository.Name $.SelectedTag ""}}@<a class="monospace" href="{{manifestURL $.Repository.Name .Digest $.SelectedTag}}">{{.Digest}}</a></td> + </tr> + {{else}} + <tr><td colspan="4">No platform manifests found.</td></tr> + {{end}} + </tbody> + </table> + {{else}} + <h2>Layers in manifest</h2> + <table> + <thead><tr><th scope="col">Digest</th><th scope="col">Size</th></tr></thead> + <tbody> + {{range .Manifest.Layers}} + <tr><td class="monospace">{{.Digest}}</td><td style="text-align: right" title="{{.SizeBytes}} bytes">{{size .SizeBytes}}</td></tr> + {{else}} + <tr><td colspan="2">No layers found.</td></tr> + {{end}} + </tbody> + <tfoot><tr><td><b>Total size</b></td><td style="text-align: right" title="{{.Manifest.TotalSizeBytes}} bytes"><b>{{size .Manifest.TotalSizeBytes}}</b></td></tr></tfoot> + </table> + {{end}} +{{template "footer" .}}{{end}} diff --git a/templates/repositories.gohtml b/templates/repositories.gohtml new file mode 100644 index 0000000..09b5714 --- /dev/null +++ b/templates/repositories.gohtml @@ -0,0 +1,17 @@ +{{define "repositories"}}{{template "header" .}} + <p>This is a container registry.</p> + <h1>Repositories</h1> + <table> + <thead><tr><th scope="col">Name</th><th scope="col">Last updated</th></tr></thead> + <tbody> + {{range .Repositories}} + <tr> + <td><a href="{{repoURL .Name}}">{{.Name}}</a></td> + <td title="{{timestamp .UpdatedAt}}">{{age .UpdatedAt .Age}}</td> + </tr> + {{else}} + <tr><td colspan="2">No repositories found.</td></tr> + {{end}} + </tbody> + </table> +{{template "footer" .}}{{end}} diff --git a/templates/repository.gohtml b/templates/repository.gohtml new file mode 100644 index 0000000..5996684 --- /dev/null +++ b/templates/repository.gohtml @@ -0,0 +1,22 @@ +{{define "repository"}}{{template "header" .}} + <h1>Tags for {{.Repository.Name}} in <a href="/">registry</a></h1> + <table> + <thead><tr> + <th scope="col">Tag</th><th scope="col">Aliases</th><th scope="col">Last updated</th> + <th scope="col">Size or platforms</th><th scope="col">Pull address</th> + </tr></thead> + <tbody> + {{range .Repository.Tags}} + <tr> + <td><a href="{{manifestURL $.Repository.Name .ManifestDigest .Name}}">{{.Name}}</a></td> + <td>{{join .Aliases " "}}</td> + <td title="{{timestamp .UpdatedAt}}">{{age .UpdatedAt .Age}}</td> + <td>{{if .Platforms}}{{.Platforms}}{{else}}{{size .SizeBytes}}{{end}}</td> + <td>{{pull $.RegistryHost $.Repository.Name .Name ""}}</td> + </tr> + {{else}} + <tr><td colspan="5">No tags found.</td></tr> + {{end}} + </tbody> + </table> +{{template "footer" .}}{{end}} |