Browse Source

解决多数据集下显示错乱问题。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.8.2^2
zouap 3 years ago
parent
commit
53598bf21d
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      models/cloudbrain.go

+ 15
- 4
models/cloudbrain.go View File

@@ -30,9 +30,9 @@ const (
)

const (
NPUResource = "NPU"
GPUResource = "CPU/GPU"
AllResource = "all"
NPUResource = "NPU"
GPUResource = "CPU/GPU"
AllResource = "all"

//notebook storage category
EVSCategory = "EVS"
@@ -2173,7 +2173,18 @@ func GetDatasetInfo(uuidStr string) (map[string]DatasetInfo, string, error) {
log.Error("GetAttachmentsByUUIDs failed: %v", err)
return nil, datasetNames, err
}
for i, attach := range attachs {
for i, tmpUuid := range uuids {
var attach *Attachment
for _, tmpAttach := range attachs {
if tmpAttach.UUID == tmpUuid {
attach = tmpAttach
break
}
}
if attach == nil {
log.Error("GetAttachmentsByUUIDs failed: %v", err)
return nil, datasetNames, err
}
fileName := strings.TrimSuffix(strings.TrimSuffix(strings.TrimSuffix(attach.Name, ".zip"), ".tar.gz"), ".tgz")
for _, datasetInfo := range datasetInfos {
if fileName == datasetInfo.Name {


Loading…
Cancel
Save