Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-28 04:36:11 +01:00

Fix empty container layer history and UI (#21251) (#21278)

Backport of #21251
This commit is contained in:
KN4CK3R 2022-09-27 17:10:19 +02:00 committed by GitHub
parent 43b4c38d4f
commit 790770aef3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 3 deletions

View file

@ -95,7 +95,9 @@ func parseOCIImageConfig(r io.Reader) (*Metadata, error) {
if i := strings.Index(cmd, "#(nop) "); i != -1 { if i := strings.Index(cmd, "#(nop) "); i != -1 {
cmd = strings.TrimSpace(cmd[i+7:]) cmd = strings.TrimSpace(cmd[i+7:])
} }
imageLayers = append(imageLayers, cmd) if cmd != "" {
imageLayers = append(imageLayers, cmd)
}
} }
metadata := &Metadata{ metadata := &Metadata{

View file

@ -43,7 +43,7 @@
{{if .PackageDescriptor.Metadata.ImageLayers}} {{if .PackageDescriptor.Metadata.ImageLayers}}
<h4 class="ui top attached header">{{.i18n.Tr "packages.container.layers"}}</h4> <h4 class="ui top attached header">{{.i18n.Tr "packages.container.layers"}}</h4>
<div class="ui attached segment"> <div class="ui attached segment">
<table id="notice-table" class="ui very basic compact table"> <table class="ui very basic compact table">
<tbody> <tbody>
{{range .PackageDescriptor.Metadata.ImageLayers}} {{range .PackageDescriptor.Metadata.ImageLayers}}
<tr> <tr>
@ -57,7 +57,7 @@
{{if .PackageDescriptor.Metadata.Labels}} {{if .PackageDescriptor.Metadata.Labels}}
<h4 class="ui top attached header">{{.i18n.Tr "packages.container.labels"}}</h4> <h4 class="ui top attached header">{{.i18n.Tr "packages.container.labels"}}</h4>
<div class="ui attached segment"> <div class="ui attached segment">
<table id="notice-table" class="ui very basic compact table"> <table class="ui very basic compact table container-labels">
<thead> <thead>
<tr> <tr>
<th>{{.i18n.Tr "packages.container.labels.key"}}</th> <th>{{.i18n.Tr "packages.container.labels.key"}}</th>

View file

@ -0,0 +1,9 @@
.container-labels {
td:nth-child(1) {
vertical-align: top;
}
td:nth-child(2) {
overflow-wrap: anywhere;
}
}

View file

@ -34,5 +34,6 @@
@import "_admin"; @import "_admin";
@import "_explore"; @import "_explore";
@import "_review"; @import "_review";
@import "_package";
@import "./helpers.less"; @import "./helpers.less";