Browse Source

Merge branch 'fix-1591' of https://git.openi.org.cn/OpenI/aiforge into fix-1591

pull/1693/head
liuzx 3 years ago
parent
commit
c3d20132b6
11 changed files with 68 additions and 40 deletions
  1. +10
    -6
      options/locale/locale_en-US.ini
  2. +5
    -2
      options/locale/locale_zh-CN.ini
  3. +2
    -1
      routers/repo/dataset.go
  4. +9
    -9
      templates/custom/select_dataset.tmpl
  5. +3
    -3
      templates/explore/dataset_left.tmpl
  6. +1
    -1
      templates/explore/dataset_list.tmpl
  7. +14
    -5
      templates/explore/datasets.tmpl
  8. +1
    -1
      templates/repo/attachment/upload.tmpl
  9. +11
    -7
      templates/repo/datasets/index.tmpl
  10. +9
    -3
      web_src/js/components/MinioUploader.vue
  11. +3
    -2
      web_src/js/index.js

+ 10
- 6
options/locale/locale_en-US.ini View File

@@ -734,7 +734,8 @@ private = private
public = public public = public
dir = directory dir = directory
back = back back = back
copy_url=copy download url
copy_url=Copy Download Url
copy_md5 = Copy MD5
directory=preview of the datasets directory=preview of the datasets
create_label_task=create label task create_label_task=create label task
visibility = visibility visibility = visibility
@@ -785,11 +786,11 @@ category.computer_vision= computer vision
category.natural_language_processing= natural language processing category.natural_language_processing= natural language processing
category.speech_processing= speech processing category.speech_processing= speech processing
category.computer_vision_natural_language_processing= computer vision and natural language processing category.computer_vision_natural_language_processing= computer vision and natural language processing
attachment.delete= delete this version of dataset
attachment.delete= Delete this version of dataset
attachment.delete_desc= Are you sure you will delete this version of dataset, once deleted can not be recovery attachment.delete_desc= Are you sure you will delete this version of dataset, once deleted can not be recovery
public= public public= public
private= private private= private
delete= delete
delete= Delete
select_dataset=Select Dataset select_dataset=Select Dataset
current_project=Current Project current_project=Current Project
owner_dataset=Owner Dataset owner_dataset=Owner Dataset
@@ -801,7 +802,7 @@ dataset_name = Dataset Name
dataset_description = Dataset Description dataset_description = Dataset Description
select_category = Select Category select_category = Select Category
select_task = Select Research Direction/Application Area select_task = Select Research Direction/Application Area
dataset_name_tooltips = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-).
dataset_name_tooltips = Please enter letters, numbers, _ and - up to 100 characters.
dataset_no_create = No dataset has been created yet dataset_no_create = No dataset has been created yet
dataset_explain = Dataset: CloudBrain I provides CPU/GPU resources, Cloudbrain II provides Ascend NPU resources, and the data set used for debugging also needs to be uploaded to the corresponding environment; dataset_explain = Dataset: CloudBrain I provides CPU/GPU resources, Cloudbrain II provides Ascend NPU resources, and the data set used for debugging also needs to be uploaded to the corresponding environment;
dataset_instructions_for_use = Instructions for use: You can refer to Qizhi AI Collaboration Platform dataset_instructions_for_use = Instructions for use: You can refer to Qizhi AI Collaboration Platform
@@ -820,10 +821,13 @@ file_description = File Description
data_upload = Dataset Upload data_upload = Dataset Upload
illustrate = Illustrate illustrate = Illustrate
illustrate.only = Only Datasets In illustrate.only = Only Datasets In
illustrate.zip = Zip Format
illustrate.zip = zip/tar.gz Format
illustrate.fisrt_end = Can Initiate Cloudbrain Tasks illustrate.fisrt_end = Can Initiate Cloudbrain Tasks
modify_dataset = Modify Dataset modify_dataset = Modify Dataset
modify_dataset_description = Modify Dataset Description modify_dataset_description = Modify Dataset Description
search_dataset = Search Dataset Files
unzip_tooltips = If it has not been decompressed for a long time, please check whether the compressed package has encrypted files or file errors
zip_failed = Decompression failed, please check whether the compressed package is encrypted or contact technical support
[repo] [repo]
owner = Owner owner = Owner
repo_name = Repository Name repo_name = Repository Name
@@ -908,7 +912,7 @@ cloudbrain1 = cloudbrain1
cloudbrain2 = cloudbrain2 cloudbrain2 = cloudbrain2
cloudbrain_selection = select cloudbrain cloudbrain_selection = select cloudbrain
cloudbrain_platform_selection = Select the cloudbrain platform you want to use: cloudbrain_platform_selection = Select the cloudbrain platform you want to use:
confirm_choice = confirm
confirm_choice = Confirm
cloudbran1_tips = Only data in zip format can create cloudbrain tasks cloudbran1_tips = Only data in zip format can create cloudbrain tasks
cloudbrain_creator=Creator cloudbrain_creator=Creator
cloudbrain_task = Task Name cloudbrain_task = Task Name


+ 5
- 2
options/locale/locale_zh-CN.ini View File

@@ -806,7 +806,7 @@ dataset_name=数据集名称
dataset_description = 数据集描述 dataset_description = 数据集描述
select_category = 选择分类 select_category = 选择分类
select_task = 选择研究方向/应用领域 select_task = 选择研究方向/应用领域
dataset_name_tooltips = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾
dataset_name_tooltips = 请输入字母、数字、_和-,最长100个字符
dataset_no_create = 还未创建过数据集 dataset_no_create = 还未创建过数据集
dataset_explain = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境; dataset_explain = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
dataset_instructions_for_use = 使用说明:可以参考启智AI协作平台 dataset_instructions_for_use = 使用说明:可以参考启智AI协作平台
@@ -825,10 +825,13 @@ file_description = 文件描述
data_upload = 数据上传 data_upload = 数据上传
illustrate = 说明 illustrate = 说明
illustrate.only = 只有 illustrate.only = 只有
illustrate.zip = zip格式
illustrate.zip = zip/tar.gz格式
illustrate.fisrt_end = 的数据集才能发起云脑任务 illustrate.fisrt_end = 的数据集才能发起云脑任务
modify_dataset = 修改数据集 modify_dataset = 修改数据集
modify_dataset_description = 修改数据集文件描述 modify_dataset_description = 修改数据集文件描述
search_dataset = 搜索数据集文件
unzip_tooltips = 如果长时间未解压,请检查压缩包是否有加密文件或者文件错误
zip_failed = 解压失败,请检查压缩包是否有加密或者联系技术支持人员。


[repo] [repo]
owner=拥有者 owner=拥有者


+ 2
- 1
routers/repo/dataset.go View File

@@ -107,6 +107,7 @@ func QueryDataSet(ctx *context.Context) []*models.Attachment {
func DatasetIndex(ctx *context.Context) { func DatasetIndex(ctx *context.Context) {
log.Info("dataset index 1") log.Info("dataset index 1")
MustEnableDataset(ctx) MustEnableDataset(ctx)
ctx.Data["PageIsDataset"] = true


repo := ctx.Repo.Repository repo := ctx.Repo.Repository


@@ -153,7 +154,7 @@ func DatasetIndex(ctx *context.Context) {
} }


ctx.Data["Page"] = pager ctx.Data["Page"] = pager
ctx.Data["PageIsDataset"] = true
ctx.Data["Title"] = ctx.Tr("dataset.show_dataset") ctx.Data["Title"] = ctx.Tr("dataset.show_dataset")
ctx.Data["Link"] = ctx.Repo.RepoLink + "/datasets" ctx.Data["Link"] = ctx.Repo.RepoLink + "/datasets"
ctx.Data["dataset"] = dataset ctx.Data["dataset"] = dataset


+ 9
- 9
templates/custom/select_dataset.tmpl View File

@@ -30,7 +30,7 @@
> >
<div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> <div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;">
<i class="search icon" style="cursor: pointer;pointer-events:auto" @click="searchDataset()"></i> <i class="search icon" style="cursor: pointer;pointer-events:auto" @click="searchDataset()"></i>
<input type="text" placeholder="Search..." v-model="searchDataItem" @keyup.enter="searchDataset()">
<input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem" @keyup.enter="searchDataset()">
</div> </div>
<el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})">
@@ -49,11 +49,11 @@
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button>
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;">
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;">解压中</span>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;">解压失败</span>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span>
</span> </span>
</div> </div>
</div> </div>
@@ -75,11 +75,11 @@
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button>
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;">
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;">解压中</span>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;">解压失败</span>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span>
</span> </span>
</div> </div>
</div> </div>
@@ -100,11 +100,11 @@
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button>
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;">
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;">解压中</span>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;">解压失败</span>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span>
</span> </span>
</div> </div>
</div> </div>
@@ -125,11 +125,11 @@
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button>
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;">
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;">解压中</span>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;">解压失败</span>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span>
</span> </span>
</div> </div>
</div> </div>


+ 3
- 3
templates/explore/dataset_left.tmpl View File

@@ -27,7 +27,7 @@
<div class="flex flex-wrap"> <div class="flex flex-wrap">
{{range $category := categories}} {{range $category := categories}}
{{$Cate := $.i18n.Tr (printf "dataset.category.%s" $category)}} {{$Cate := $.i18n.Tr (printf "dataset.category.%s" $category)}}
<a class="tag {{if or (eq $category $.Category) (not $.Category)}} tag-red {{else}} inactive{{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$category}}&task={{$.Task}}&license={{$.License}}"><span>{{$Cate}}</span></a>
<a class="tag {{if eq $category $.Category}} tag-active {{else}} tag-gray{{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$category}}&task={{$.Task}}&license={{$.License}}"><span>{{$Cate}}</span></a>
{{end}} {{end}}
</div> </div>
@@ -44,7 +44,7 @@
<div class="flex flex-wrap history-content"> <div class="flex flex-wrap history-content">
{{range $task := tasks}} {{range $task := tasks}}
{{$Task := $.i18n.Tr (printf "dataset.task.%s" $task)}} {{$Task := $.i18n.Tr (printf "dataset.task.%s" $task)}}
<a class="tag {{if or (eq $task $.Task) (not $.Task)}} tag-purple {{else}} inactive{{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$task}}&license={{$.License}}"><span>{{$Task}}</span></a>
<a class="tag {{if eq $task $.Task}} tag-active {{else}} tag-gray{{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$task}}&license={{$.License}}"><span>{{$Task}}</span></a>
{{end}} {{end}}
</div> </div>
</div> </div>
@@ -59,7 +59,7 @@
</div> </div>
<div class="flex flex-wrap"> <div class="flex flex-wrap">
{{range $license := licenses}} {{range $license := licenses}}
<a class="tag {{if or (eq $license $.License) (not $.License)}} tag-blue {{else}} inactive {{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$license}}"><span>{{$license}}</span></a>
<a class="tag {{if eq $license $.License}} tag-active {{else}} tag-gray {{end}}" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$license}}"><span>{{$license}}</span></a>
{{end}} {{end}}
</div> </div>
</div> </div>


+ 1
- 1
templates/explore/dataset_list.tmpl View File

@@ -25,7 +25,7 @@
{{range .Datasets}} {{range .Datasets}}
<div class="item"> <div class="item">
<div class="ui header"> <div class="ui header">
<a class="name" href="{{.Repo.Link}}/datasets?type=0">
<a class="name" href="{{.Repo.Link}}/datasets">
{{.Repo.OwnerName}} / {{.Repo.Alias}} {{.Repo.OwnerName}} / {{.Repo.Alias}}
</a> </a>
<div class="ui right metas"> <div class="ui right metas">


+ 14
- 5
templates/explore/datasets.tmpl View File

@@ -65,6 +65,14 @@
filter: grayscale(100%); filter: grayscale(100%);
opacity: .5; opacity: .5;
} }
.tag.tag-active{
background-color: #0366d6;
color: #ffffff;
}
.tag-gray{
background-color: #f8f9fa;
color: #415058;
}
.tag { .tag {
align-items: center; align-items: center;
display: inline-flex; display: inline-flex;
@@ -133,8 +141,8 @@
<div class="ui row" style="clear: both;" id="dataset-base"> <div class="ui row" style="clear: both;" id="dataset-base">
<div class="ui two cards"> <div class="ui two cards">
{{range $k, $v :=.Datasets}} {{range $k, $v :=.Datasets}}
<div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')" style="cursor: pointer;">
<div class="content">
<div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')" style="cursor: pointer;box-shadow: 0px 4px 4px 0px rgba(232,232,232,0.6);border: 1px solid rgba(232, 232, 232, 1);">
<div class="content" style="border-bottom: none;">
<div class="repo_dataset_header" style="display: flex;align-items: center;justify-content: space-between;"> <div class="repo_dataset_header" style="display: flex;align-items: center;justify-content: space-between;">
<a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a> <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a>
{{if $.IsSigned}} {{if $.IsSigned}}
@@ -153,7 +161,8 @@
</span> </span>
{{end}} {{end}}
</div> </div>
<div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;">{{.Title}}</div>
<div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;font-weight: bold;">{{.Title}}</div>
{{if and (.Category) (.Task) (.License)}}
<div style="font-size: 12px;margin-top: 5px;height: 24px;"> <div style="font-size: 12px;margin-top: 5px;height: 24px;">
{{if .Category}} {{if .Category}}
{{$category := .Category}} {{$category := .Category}}
@@ -167,13 +176,13 @@
<a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.License}}">{{.License}}</a> <a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.License}}">{{.License}}</a>
{{end}} {{end}}
</div> </div>
{{end}}
<div class="description" style="-webkit-box-orient: vertical;-webkit-line-clamp: 2;display: -webkit-box;overflow: hidden;color:#999999;font-size: 14px;margin-top: 10px;"> <div class="description" style="-webkit-box-orient: vertical;-webkit-line-clamp: 2;display: -webkit-box;overflow: hidden;color:#999999;font-size: 14px;margin-top: 10px;">
<p>{{.Description}}</p> <p>{{.Description}}</p>
</div> </div>
</div> </div>
<div class="extra content">
<div class="extra content" style="border-top: none !important;">
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}"> <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}">
<img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1"> <img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1">


+ 1
- 1
templates/repo/attachment/upload.tmpl View File

@@ -64,7 +64,7 @@
- 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。 - 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。
</p> --> </p> -->
<p style="color: 505559;">{{$.i18n.Tr "dataset.illustrate"}}:</p> <p style="color: 505559;">{{$.i18n.Tr "dataset.illustrate"}}:</p>
<p style="line-height: 1.5;color: #101010;">{{$.i18n.Tr "dataset.illustrate.only"}}<span class="text red">{{$.i18n.Tr "dataset.illustrate.zip"}}</span>{{$.i18n.Tr "dataset.illustrate.fisrt_end"}};</br>
<p style="line-height: 1.5;color: #101010;">{{$.i18n.Tr "dataset.illustrate.only"}}<span class="text red">&nbsp;{{$.i18n.Tr "dataset.illustrate.zip"}}&nbsp;</span>{{$.i18n.Tr "dataset.illustrate.fisrt_end"}};</br>
{{$.i18n.Tr "dataset.dataset_explain"}}</p> {{$.i18n.Tr "dataset.dataset_explain"}}</p>


</div> </div>


+ 11
- 7
templates/repo/datasets/index.tmpl View File

@@ -131,6 +131,7 @@
<a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}" class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a> <a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}" class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a>
</span> </span>
</div> </div>
{{if and (.dataset.Category) (.dataset.Task) (.dataset.License)}}
<div class="column thirteen wide"> <div class="column thirteen wide">
{{if .dataset.Category}} {{if .dataset.Category}}
{{$category := .dataset.Category}} {{$category := .dataset.Category}}
@@ -144,7 +145,9 @@
<a class="ui repo-topic label topic" href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.dataset.License}}">{{.dataset.License}}</a> <a class="ui repo-topic label topic" href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.dataset.License}}">{{.dataset.License}}</a>
{{end}} {{end}}
</div> </div>
{{end}}
</div> </div>
{{if .dataset.Description}}
<div class="row" style="padding-top: 0;"> <div class="row" style="padding-top: 0;">
<div class=" wrapper"> <div class=" wrapper">
<input id="exp1" class="exp" type="checkbox"> <input id="exp1" class="exp" type="checkbox">
@@ -154,6 +157,7 @@
</div> </div>
</div> </div>
</div> </div>
{{end}}
<div class="row"> <div class="row">
<div class="column ten wide"></div> <div class="column ten wide"></div>
<div class="column six wide right aligned"> <div class="column six wide right aligned">
@@ -171,10 +175,10 @@
<div class="ui grid stackable" style="background: #f0f0f0;;"> <div class="ui grid stackable" style="background: #f0f0f0;;">
<div class="row"> <div class="row">
<!-- 数据集名称 --> <!-- 数据集名称 -->
<div class="four wide column">
<div class="four wide column" style="width: 24% !important;">
<span style="margin:0 6px">{{$.i18n.Tr "dataset.dataset_file_name"}}</span> <span style="margin:0 6px">{{$.i18n.Tr "dataset.dataset_file_name"}}</span>
</div> </div>
<div class="one wide column text center">
<div class="one wide column text center" style="width: 7.25% !important;">
{{$.i18n.Tr "repo.model.manage.size"}} {{$.i18n.Tr "repo.model.manage.size"}}
</div> </div>
<div class="two wide column text center"> <div class="two wide column text center">
@@ -199,7 +203,7 @@
<div class="row"> <div class="row">
<!-- 数据集名称 --> <!-- 数据集名称 -->


<div class="four wide column" style="display: flex;align-items: center;justify-content: space-between;">
<div class="four wide column" style="width: 24% !important;display: flex;align-items: center;">
{{if .Description}} {{if .Description}}
<el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper"> <el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper">
<div slot="content" >{{.Description}}</br><span><i class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}</span></div> <div slot="content" >{{.Description}}</br><span><i class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}</span></div>
@@ -220,7 +224,7 @@
<i class="WAITING" v-if="zipStatus[{{$k}}]==2"></i> <i class="WAITING" v-if="zipStatus[{{$k}}]==2"></i>
<i class="FAILED" v-if="zipStatus[{{$k}}]==3"></i> --> <i class="FAILED" v-if="zipStatus[{{$k}}]==3"></i> -->
</div> </div>
<div class="one wide column text center">
<div class="one wide column text center" style="width: 7.25% !important;">
{{.Size | FileSize}} {{.Size | FileSize}}
</div> </div>
<div class="two wide column text center"> <div class="two wide column text center">
@@ -241,7 +245,7 @@
<div class="three wide column text center"> <div class="three wide column text center">
{{.CreatedUnix | TimeSinceUnix1}} {{.CreatedUnix | TimeSinceUnix1}}
</div> </div>
<div class="four wide column text center">
<div class="four wide column text right">
<!-- <el-button type="text">下载</el-button> <!-- <el-button type="text">下载</el-button>
<el-button type="text">预览</el-button> <el-button type="text">预览</el-button>
<el-button type="text">标注</el-button> <el-button type="text">标注</el-button>
@@ -261,7 +265,7 @@
{{if eq .DecompressState 1}} {{if eq .DecompressState 1}}
<a class="ui basic blue button" href="datasets/dirs/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{$.i18n.Tr "preview"}}</a> <a class="ui basic blue button" href="datasets/dirs/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{$.i18n.Tr "preview"}}</a>
{{end}} {{end}}
{{if .CanDel}}
{{if and (.CanDel) (not $.Repository.IsPrivate)}}
<span class="ui basic blue button" style="color: #13c28d !important;" @click="setPrivate('{{.FileChunk.UUID}}',false,{{$k}})" v-if="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_public"}}</span> <span class="ui basic blue button" style="color: #13c28d !important;" @click="setPrivate('{{.FileChunk.UUID}}',false,{{$k}})" v-if="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_public"}}</span>
<span class="ui basic blue button" style="color: #fa8c16 !important;" @click="setPrivate('{{.FileChunk.UUID}}',true,{{$k}})" v-else="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_private"}}</span> <span class="ui basic blue button" style="color: #fa8c16 !important;" @click="setPrivate('{{.FileChunk.UUID}}',true,{{$k}})" v-else="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_private"}}</span>
{{end}} {{end}}
@@ -278,7 +282,7 @@
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item class="clipboard" data-clipboard-text="{{.DownloadURL}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_url"}}</el-dropdown-item> <el-dropdown-item class="clipboard" data-clipboard-text="{{.DownloadURL}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_url"}}</el-dropdown-item>
<el-dropdown-item class="clipboard" data-clipboard-text="{{.FileChunk.Md5}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_md5"}}</el-dropdown-item> <el-dropdown-item class="clipboard" data-clipboard-text="{{.FileChunk.Md5}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_md5"}}</el-dropdown-item>
{{if $.CanWrite}}
{{if and ($.CanWrite) (eq .DecompressState 1) }}
<el-dropdown-item @click.native="gotoAnnotate('{{$.RepoLink}}','{{.UUID}}',{{.Type}})">{{$.i18n.Tr "dataset.annotation"}}</el-dropdown-item> <el-dropdown-item @click.native="gotoAnnotate('{{$.RepoLink}}','{{.UUID}}',{{.Type}})">{{$.i18n.Tr "dataset.annotation"}}</el-dropdown-item>
{{end}} {{end}}
{{if .CanDel}} {{if .CanDel}}


+ 9
- 3
web_src/js/components/MinioUploader.vue View File

@@ -88,12 +88,12 @@ export default {
// previewTemplate += ' </div>\n'; // previewTemplate += ' </div>\n';
// previewTemplate += '</div>'; // previewTemplate += '</div>';
let previewTemplate = '' let previewTemplate = ''
previewTemplate += '<div class="dz-preview dz-file-preview" style="width:100%">'
previewTemplate += '<div class="dz-details">'
previewTemplate += '<div class="dz-preview dz-file-preview" style="width:100%;background: none;">'
previewTemplate += '<div class="dz-details" style="opacity: 1;">'
previewTemplate += '<div class="dz-filename"><span data-dz-name></span></div>' previewTemplate += '<div class="dz-filename"><span data-dz-name></span></div>'
previewTemplate += '<div class="dz-size" data-dz-size></div>' previewTemplate += '<div class="dz-size" data-dz-size></div>'
previewTemplate += '<div class="dz-progress ui active progress" style="top: 75%;width: 80%;left: 15%;"><div class="dz-upload bar" data-dz-uploadprogress><div class="progress"></div></div></div>' previewTemplate += '<div class="dz-progress ui active progress" style="top: 75%;width: 80%;left: 15%;"><div class="dz-upload bar" data-dz-uploadprogress><div class="progress"></div></div></div>'
previewTemplate += '<img data-dz-thumbnail />'
// previewTemplate += '<img data-dz-thumbnail />'
previewTemplate += '</div>' previewTemplate += '</div>'
previewTemplate += '<div class="dz-success-mark"><span>✔</span></div>' previewTemplate += '<div class="dz-success-mark"><span>✔</span></div>'
@@ -132,6 +132,7 @@ export default {
methods: { methods: {
cancelDataset(){ cancelDataset(){
location.href = this.repoPath location.href = this.repoPath
this.dropzoneUploader.removeAllFiles(true)
}, },
resetStatus() { resetStatus() {
this.progress = 0; this.progress = 0;
@@ -164,6 +165,11 @@ export default {
.getElementById('datasetId') .getElementById('datasetId')
.getAttribute('datasetId'); .getAttribute('datasetId');
this.resetStatus(); this.resetStatus();
console.log(this.file,!this.file?.upload)
if(!this.file?.upload){
this.btnFlag = false
return
}
this.computeMD5(this.file); this.computeMD5(this.file);
}, },




+ 3
- 2
web_src/js/index.js View File

@@ -3791,7 +3791,7 @@ function initVueDataset() {
{ min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' }, { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' },
// {required:true,message:'test',pattern:'/^[a-zA-Z0-9-_]{1,100}[^-]$/',trigger:'blur'}, // {required:true,message:'test',pattern:'/^[a-zA-Z0-9-_]{1,100}[^-]$/',trigger:'blur'},
{ validator: (rule, value, callback) => { { validator: (rule, value, callback) => {
if (/^[a-zA-Z0-9-_]{1,100}[^-]$/.test(value) == false) {
if (/^[a-zA-Z0-9-_.]{0,100}$/.test(value) == false) {
callback(new Error("输入不符合数据集名称规则")); callback(new Error("输入不符合数据集名称规则"));
} else { } else {
callback(); callback();
@@ -3948,7 +3948,8 @@ function initVueDataset() {
onApprove() { onApprove() {
_this.$axios.post('/attachments/delete',_this.qs.stringify(params)).then((res)=>{ _this.$axios.post('/attachments/delete',_this.qs.stringify(params)).then((res)=>{
console.log(res) console.log(res)
$('#'+uuid).hide()
// $('#'+uuid).hide()
location.reload()
}).catch(error=>{ }).catch(error=>{
console.log(error) console.log(error)
}) })


Loading…
Cancel
Save