',"","",function(t){this.on("updated",function(){this.tags["material-button"]&&(Array.isArray(this.tags["material-button"])?this.tags["material-button"]:[this.tags["material-button"]]).forEach(function(t){t.root.onclick=function(){registryUI.taglist.instance.trigger("page-update",t.p.page)}})})}),riot.tag2("remove-image",'
delete ',"","",function(t){const e=this;this.on("updated",function(){}),this.on("updated",function(){e.multiDelete!=e.opts.multiDelete&&(e.tags["material-button"]&&(e.delete=function(t){const i=e.opts.image.name,r=e.opts.image.tag;if(registryUI.taglist.go(i),!e.digest)return void registryUI.snackbar("Information for "+i+":"+r+" are not yet loaded.");const a=new Http;a.addEventListener("loadend",function(){200==this.status||202==this.status?(registryUI.taglist.display(),registryUI.snackbar("Deleting "+i+":"+r+" image. Run `registry garbage-collect config.yml` on your registry")):404==this.status?t||registryUI.errorSnackbar("Digest not found for this image in your registry."):registryUI.snackbar(this.responseText)}),a.open("DELETE",registryUI.url()+"/v2/"+i+"/manifests/"+e.digest),a.setRequestHeader("Accept","application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json"),a.addEventListener("error",function(){registryUI.errorSnackbar("An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: ['DELETE'].")}),a.send()},e.tags["material-button"].root.onclick=function(){e.delete()}),e.tags["material-checkbox"]&&(!e.opts.multiDelete&&e.tags["material-checkbox"].checked&&e.tags["material-checkbox"].toggle(),e.tags["material-checkbox"].on("toggle",function(){registryUI.taglist.instance.trigger("toggle-remove-image",this.checked)})),e.multiDelete=e.opts.multiDelete)}),t.image.one("content-digest",function(t){e.digest=t,e.update()}),t.image.trigger("get-content-digest")}),riot.tag2("tag-history-button",'
history ',"","",function(t){this.on("mount",function(){const t=this;this.refs.button.root.onclick=function(){registryUI.taghistory._image=t.opts.image,registryUI.taghistory.go(t.opts.image.name,t.opts.image.tag)}}),this.update()}),riot.tag2("tag-history-element",'
{registryUI.getHistoryIcon(entry.key)} {entry.key.replace(\'_\', \' \')}
{entry.value}
{e}
',"",'class="{entry.key}"',function(t){}),riot.tag2("tag-history",'
',"","",function(t){const e=this,i=function(t){switch(t){case"id":return 1;case"created":return 2;case"created_by":return 3;case"size":return 4;case"os":return 5;case"architecture":return 6;case"linux":return 7;case"docker_version":return 8;default:return 10}},r=function(t,e){return i(t.key)-i(e.key)},a=function(t,e){switch(t){case"created":return new Date(e).toLocaleString();case"created_by":const i=e.match(/\/bin\/sh *-c *#\(nop\) *([A-Z]+)/);return i&&i[1]||"RUN";case"size":return registryUI.bytesToSize(e);case"Entrypoint":case"Cmd":return(e||[]).join(" ");case"Labels":return Object.keys(e||{}).map(function(t){return e[t]?t+"="+e[t]:""});case"Volumes":case"ExposedPorts":return Object.keys(e)}return e||""},s=function(t){function i(t){const e=[];for(var i in t)if(t.hasOwnProperty(i)&&"empty_layer"!=i){const r=t[i],s={key:i,value:a(i,r)};e.push(s)}return e.sort(r)}e.elements.push(i(function(t){const e=["architecture","User","created","docker_version","os","Cmd","Entrypoint","Env","Labels","User","Volumes","WorkingDir","author","id","ExposedPorts"].reduce(function(e,i){const r=t[i]||t.config[i];return r&&(e[i]=r),e},{});return!e.author&&e.Labels&&e.Labels.maintainer&&(e.author=t.config.Labels.maintainer,delete e.Labels.maintainer),e}(t))),t.history.reverse().forEach(function(t){e.elements.push(i(t))}),registryUI.taghistory.loadend=!0,e.update()};registryUI.taghistory.display=function(){e.elements=[];const t=registryUI.taghistory._image&®istryUI.taghistory._image.blobs;if(t)return window.scrollTo(0,0),s(t);const i=new registryUI.DockerImage(registryUI.taghistory.image,registryUI.taghistory.tag);i.fillInfo(),i.on("blobs",s)},this.on("mount",function(){e.refs["tag-history-tag"].tags["material-button"].root.onclick=function(){registryUI.taglist.go(registryUI.taghistory.image)}}),registryUI.taghistory.display(),e.update()}),riot.tag2("taglist",'
Creation date | Size | History | delete |
| | | | | |
',"","",function(t){var e=registryUI.taglist.instance=this;e.page=registryUI.getPageQueryParam(),registryUI.taglist.tags=[];const i=function(){const t=window.innerWidth;var e=0,i=registryUI.taglist.tags.reduce(function(t,e){return e.tag.length>t?e.tag.length:t},0);e=t>=1440?71:t<1024?0:15+(t-1024)/416*56,i>20&&(e-=i-20),registryUI.taglist.tags.map(function(t){t.trigger("content-digest-chars",e)})};window.addEventListener("resize",i),window.requestAnimationFrame(i),this.multiDelete=!1,this.toDelete=0,this.on("delete",function(){registryUI.isImageRemoveActivated&&this.multiDelete}),this.on("multi-delete",function(){registryUI.isImageRemoveActivated&&(this.multiDelete=!this.multiDelete)}),this.on("toggle-remove-image",function(t){t?this.toDelete++:this.toDelete--,this.toDelete<=1&&this.update()}),this.on("page-update",function(t){e.page=t<1?1:t,registryUI.updateQueryString(registryUI.getQueryParams({page:e.page})),this.toDelete=0,this.update()}),this._getRemoveImageTags=function(){var t=e.refs["taglist-tag"].tags["remove-image"];return t instanceof Array||(t=[t]),t},registryUI.taglist.bulkDelete=function(t){e.multiDelete&&e.toDelete>0&&(t.altKey&&e._getRemoveImageTags().filter(function(t){return t.tags["material-checkbox"].checked}).forEach(function(t){t.tags["material-checkbox"].toggle()}),e._getRemoveImageTags().filter(function(t){return t.tags["material-checkbox"].checked}).forEach(function(t){t.delete(!0)}))},this.on("update",function(){var t=this.refs["taglist-tag"].refs["remove-tag-checkbox"];t&&!t._toggle&&(t._toggle=t.toggle,t.toggle=function(t){t.altKey?(this.checked||this._toggle(),e._getRemoveImageTags().filter(function(t){return!t.tags["material-checkbox"].checked}).forEach(function(t){t.tags["material-checkbox"].toggle()})):this._toggle()},t.on("toggle",function(){registryUI.taglist.instance.multiDelete=this.checked,registryUI.taglist.instance.update()}))}),registryUI.taglist.display=function(){if(registryUI.taglist.tags=[],"taglist"==route.routeName){const t=new Http;registryUI.taglist.instance.update(),t.addEventListener("load",function(){if(registryUI.taglist.tags=[],200==this.status){const t=JSON.parse(this.responseText).tags||[];registryUI.taglist.tags=t.map(function(t){return new registryUI.DockerImage(registryUI.taglist.name,t)}).sort(registryUI.DockerImage.compare),window.requestAnimationFrame(i),e.trigger("page-update",Math.min(e.page,registryUI.getNumPages(registryUI.taglist.tags)))}else 404==this.status?registryUI.snackbar("Server not found",!0):registryUI.snackbar(this.responseText,!0)}),t.addEventListener("error",function(){registryUI.snackbar(this.getErrorMessage(),!0),registryUI.taglist.tags=[]}),t.addEventListener("loadend",function(){registryUI.taglist.loadend=!0,registryUI.taglist.instance.update()}),t.open("GET",registryUI.url()+"/v2/"+registryUI.taglist.name+"/tags/list"),t.send(),registryUI.taglist.asc=!0}},registryUI.taglist.display(),registryUI.taglist.instance.update(),registryUI.taglist.reverse=function(){registryUI.taglist.asc?(registryUI.taglist.tags.reverse(),registryUI.taglist.asc=!1):(registryUI.taglist.tags.sort(registryUI.DockerImage.compare),registryUI.taglist.asc=!0),registryUI.taglist.instance.update()}});