Browse Source

obs download link

tags/v1.22.2.2^2
lewis 3 years ago
parent
commit
6b0a34ca6e
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      models/attachment.go
  2. +1
    -1
      templates/repo/datasets/dataset_list.tmpl

+ 1
- 1
models/attachment.go View File

@@ -103,7 +103,7 @@ func (a *Attachment) S3DownloadURL() string {
if a.Type == TypeCloudBrainOne {
url, _ = storage.Attachments.PresignedGetURL(setting.Attachment.Minio.BasePath+AttachmentRelativePath(a.UUID), a.Name)
} else if a.Type == TypeCloudBrainTwo {
url, _ = storage.ObsGetPreSignedUrl(a.UUID, a.Name)
}

return url


+ 1
- 1
templates/repo/datasets/dataset_list.tmpl View File

@@ -14,7 +14,7 @@
<div class="eight wide column right aligned">
<div class="ui left mini icon buttons">
<span class="ui basic button text left" data-tooltip='{{$.i18n.Tr "dataset.download_count"}}' data-position="bottom right" style="width: 60px; padding-left: 0;">{{svg "octicon-flame" 16}} {{(.DownloadCount | PrettyNumber)}}</span>
<span class="ui basic basic button clipboard" data-clipboard-text="{{.S3DownloadURL}}" data-tooltip='{{$.i18n.Tr "dataset.copy_url"}}' data-clipboard-action="copy"{{if ne $.Type 0}} style="display:none;"{{end}}>{{svg "octicon-file" 16}}</span>
<span class="ui basic basic button clipboard" data-clipboard-text="{{.S3DownloadURL}}" data-tooltip='{{$.i18n.Tr "dataset.copy_url"}}' data-clipboard-action="copy">{{svg "octicon-file" 16}}</span>
<span class="ui basic basic button clipboard" data-clipboard-text="{{.FileChunk.Md5}}" data-tooltip='{{$.i18n.Tr "dataset.copy_md5"}}' data-clipboard-action="copy">{{svg "octicon-file-binary" 16}}</span>
</div>
{{if eq .DecompressState 1}}


Loading…
Cancel
Save