diff --git a/models/attachment.go b/models/attachment.go index 127e73d9c..47589a8dd 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -43,6 +43,8 @@ type Attachment struct { DecompressState int32 `xorm:"DEFAULT 0"` Type int `xorm:"DEFAULT 0"` CreatedUnix timeutil.TimeStamp `xorm:"created"` + + FileChunk *FileChunk `xorm:"-"` } type AttachmentUsername struct { diff --git a/models/dataset.go b/models/dataset.go index b307a1352..f4713d77b 100755 --- a/models/dataset.go +++ b/models/dataset.go @@ -235,6 +235,14 @@ func getDatasetAttachments(e Engine, typeCloudBrain int, rels ...*Dataset) (err for sortedRels.ID[currentIndex] < attachment.DatasetID { currentIndex++ } + fileChunks := make([]*FileChunk, 0, 10) + err = e. + Where("uuid = ?", attachment.UUID). + Find(&fileChunks) + if err != nil { + return err + } + attachment.FileChunk = fileChunks[0] sortedRels.Rel[currentIndex].Attachments = append(sortedRels.Rel[currentIndex].Attachments, attachment) } diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index f11dc4eb3..751aea64b 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -642,6 +642,7 @@ public=公有 dir=目录 back=返回 copy_url=复制下载链接 +copy_md5=复制文件MD5 directory=查看数据集目录结构 visibility=可见性 visibility_description=只有组织所有人或拥有权利的组织成员才能看到。 diff --git a/templates/repo/datasets/dataset_list.tmpl b/templates/repo/datasets/dataset_list.tmpl index a86b7c6ca..5adb601fe 100755 --- a/templates/repo/datasets/dataset_list.tmpl +++ b/templates/repo/datasets/dataset_list.tmpl @@ -18,17 +18,21 @@ {{svg "octicon-file" 16}} +