|
|
@@ -2,6 +2,7 @@ package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/storage" |
|
|
|
"net/url" |
|
|
|
"sort" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
@@ -81,12 +82,19 @@ func DatasetIndex(ctx *context.Context) { |
|
|
|
ctx.Data["Attachments"] = attachments |
|
|
|
ctx.Data["IsOwner"] = true |
|
|
|
uuid := gouuid.NewV4().String() |
|
|
|
url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) |
|
|
|
log.Info(uuid) |
|
|
|
tmpUrl, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("PresignedPutURL", err) |
|
|
|
} |
|
|
|
log.Info(tmpUrl) |
|
|
|
preUrl,err := url.QueryUnescape(tmpUrl) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("QueryUnescape", err) |
|
|
|
} |
|
|
|
log.Info(preUrl) |
|
|
|
ctx.Data["uuid"] = uuid |
|
|
|
ctx.Data["url"] = url |
|
|
|
ctx.Data["url"] = preUrl |
|
|
|
renderAttachmentSettings(ctx) |
|
|
|
|
|
|
|
ctx.HTML(200, tplIndex) |
|
|
|