{{$.RenderedDescription|Str2html}}
{{end}} diff --git a/tests/integration/api_packages_container_test.go b/tests/integration/api_packages_container_test.go index ba76ee4baa..60cbecd067 100644 --- a/tests/integration/api_packages_container_test.go +++ b/tests/integration/api_packages_container_test.go @@ -6,10 +6,12 @@ package integration import ( "bytes" + "crypto/sha256" "encoding/base64" "fmt" "net/http" "strings" + "sync" "testing" "code.gitea.io/gitea/models/db" @@ -594,6 +596,32 @@ func TestPackageContainer(t *testing.T) { }) } + // https://github.com/go-gitea/gitea/issues/19586 + t.Run("ParallelUpload", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + + url := fmt.Sprintf("%sv2/%s/parallel", setting.AppURL, user.Name) + + var wg sync.WaitGroup + for i := 0; i < 10; i++ { + wg.Add(1) + + content := []byte{byte(i)} + digest := fmt.Sprintf("sha256:%x", sha256.Sum256(content)) + + go func() { + defer wg.Done() + + req := NewRequestWithBody(t, "POST", fmt.Sprintf("%s/blobs/uploads?digest=%s", url, digest), bytes.NewReader(content)) + addTokenAuthHeader(req, userToken) + resp := MakeRequest(t, req, http.StatusCreated) + + assert.Equal(t, digest, resp.Header().Get("Docker-Content-Digest")) + }() + } + wg.Wait() + }) + t.Run("OwnerNameChange", func(t *testing.T) { defer tests.PrintCurrentTest(t)() diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index b00b4aea9c..7efefd7084 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -260,6 +260,7 @@ export function initGlobalLinkActions() { e.preventDefault(); const $this = $(this); const redirect = $this.data('redirect'); + $this.prop('disabled', true); $.post($this.data('url'), { _csrf: csrfToken }).done((data) => { @@ -270,6 +271,8 @@ export function initGlobalLinkActions() { } else { window.location.reload(); } + }).always(() => { + $this.prop('disabled', false); }); } @@ -283,11 +286,14 @@ export function initGlobalLinkActions() { // FIXME: this is only used once, and should be replace with `link-action` instead $('.undo-button').on('click', function () { const $this = $(this); + $this.prop('disabled', true); $.post($this.data('url'), { _csrf: csrfToken, id: $this.data('id') }).done((data) => { window.location.href = data.redirect; + }).always(() => { + $this.prop('disabled', false); }); }); } diff --git a/web_src/js/markup/mermaid.js b/web_src/js/markup/mermaid.js index 984946045d..efd9abbb56 100644 --- a/web_src/js/markup/mermaid.js +++ b/web_src/js/markup/mermaid.js @@ -3,7 +3,7 @@ const {mermaidMaxSourceCharacters} = window.config; const iframeCss = ` :root {color-scheme: normal} - body {margin: 0; padding: 0} + body {margin: 0; padding: 0; overflow: hidden} #mermaid {display: block; margin: 0 auto} `; diff --git a/web_src/less/helpers.less b/web_src/less/helpers.less index f475693926..46284811ee 100644 --- a/web_src/less/helpers.less +++ b/web_src/less/helpers.less @@ -172,6 +172,8 @@ .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; } .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; } +.content-center { align-content: center !important; } + @media @mediaSm { .db-small { display: block !important; } .w-100-small { width: 100% !important; }