mirror of
https://github.com/theonedev/onedev.git
synced 2026-02-01 17:37:19 +00:00
chore: Show docker image size by platform
This commit is contained in:
parent
12ff410716
commit
bc0d4e3b1f
@ -39,6 +39,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</wicket:enclosure>
|
||||
<div class="mt-4">
|
||||
<b>Image Size</b>
|
||||
<div wicket:id="imageSize" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<b>Image Manifest</b>
|
||||
<pre wicket:id="manifest" class="code text-break mt-2 mb-0"></pre>
|
||||
|
||||
@ -10,6 +10,7 @@ import io.onedev.server.web.component.link.copytoclipboard.CopyToClipboardLink;
|
||||
import io.onedev.server.web.component.tabbable.AjaxActionTab;
|
||||
import io.onedev.server.web.component.tabbable.Tab;
|
||||
import io.onedev.server.web.component.tabbable.Tabbable;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
@ -179,8 +180,16 @@ public class ContainerPackPanel extends Panel {
|
||||
fragment.add(new WebMarkupContainer("copyPullArchCommand").setVisible(false));
|
||||
}
|
||||
|
||||
var imageSize = 0;
|
||||
for (var layerNode: manifest.get("layers")) {
|
||||
var sizeNode = layerNode.get("size");
|
||||
if (sizeNode != null)
|
||||
imageSize += sizeNode.asLong();
|
||||
}
|
||||
fragment.add(new Label("imageSize", FileUtils.byteCountToDisplaySize(imageSize)));
|
||||
|
||||
fragment.add(new Label("manifest", formatJson(manifest)));
|
||||
|
||||
|
||||
var labels = new ArrayList<Pair<String, String>>();
|
||||
var labelsNode = config.get("config").get("Labels");
|
||||
if (labelsNode != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user