#3889 fix-3787

Merged
ychao_1983 merged 2 commits from fix-3787 into V20230322 1 year ago
  1. +1
    -5
      templates/explore/datasets.tmpl
  2. +5
    -1
      templates/repo/cloudbrain/image/edit.tmpl
  3. +1
    -1
      templates/repo/debugjob/index.tmpl
  4. +15
    -4
      web_src/vuepages/pages/dataset/square/components/PublicDataset.vue

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

@@ -4,11 +4,7 @@
.el-tabs__nav-wrap::after {
position: static !important;
}
.el-empty__description p{
font-size: 18px;
color: rgba(63, 63, 64, 1);
font-size: 18px;
}

</style>
<div class="explore repositories">
<div id="datasets-square" style="display:none"


+ 5
- 1
templates/repo/cloudbrain/image/edit.tmpl View File

@@ -33,7 +33,11 @@
<label class="label_color" for="">{{$.i18n.Tr "dataset.dataset_available_clusters"}}</label>
<div class="ui basic label" style="border: none !important;color:#3291f8;">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path fill="none" d="M0 0h24v24H0z"></path><path d="M4 3h16a1 1 0 0 1 1 1v7H3V4a1 1 0 0 1 1-1zM3 13h18v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7zm4 3v2h3v-2H7zM7 6v2h3V6H7z"></path></svg>
CPU/GPU
{{if eq .Type 2}}
{{$.i18n.Tr "cloudbrain.resource_cluster_c2net_simple"}} GPU
{{else}}
{{$.i18n.Tr "cloudbrain.resource_cluster_openi_simple"}} GPU
{{end}}
</div>
<input type="hidden" value="{{.Type}}" name="type">
</div>


+ 1
- 1
templates/repo/debugjob/index.tmpl View File

@@ -273,7 +273,7 @@
{{$.CsrfTokenHtml}}
{{if .CanDebug}}
{{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
<a style="margin: 0 1rem;" id="ai-debug-{{.Cloudbrain.ID}}"
<a id="ai-debug-{{.Cloudbrain.ID}}"
class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button'
data-jobid="{{.Cloudbrain.ID}}"
data-repopath='{{$.RepoLink}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{.Cloudbrain.ID}}/'>


+ 15
- 4
web_src/vuepages/pages/dataset/square/components/PublicDataset.vue View File

@@ -65,7 +65,7 @@
</div>
</div>
</div>
<el-empty v-else :description="$t('noDataset')" :image-size="100" style="background-color: rgba(245, 245, 246, 0.5);min-height: 400px;"></el-empty>
<el-empty v-else :description="$t('noDataset')" :image-size="100" style="background-color: rgba(245, 245, 246, 0.5);min-height: 400px;padding: 40px 0 80px 0;"></el-empty>
<div class="center" style="margin-top: 2rem;" v-if="!showEmpty">
<el-pagination
background
@@ -133,7 +133,7 @@ export default {
},
checked:false,
sortList:[
{name:'default',active:false},
{name:'default',active:true},
{name:'latest',active:false},
{name:'oldest',active:false},
{name:'recentupdate',active:false},
@@ -180,13 +180,17 @@ export default {
let url = `/explore/${dataType}`
this.loading=true
getDatasets(url,this.params).then((res)=>{
console.log(res,JSON.parse(res.data.data))
if(res.data.result_code==='0'){
if(res.data.data==='null'||res.data.data=='[]'){
this.showEmpty = true
this.total = 0
}else{
this.publicDataList = JSON.parse(res.data.data)
if(dataType==='my_favorite_datasets'){
this.publicDataList.forEach((ele,index)=>{
this.publicDataList[index].IsStaring = true
})
}
this.total = Number(res.data.count)
this.showEmpty = false
}
@@ -212,12 +216,19 @@ export default {
location.href = `/${item.Repo.OwnerName}/${item.Repo.Name}/datasets`
},
postSquareStar(item,index){
if(this.isSigned==='false' || !this.isSigned || this.dataGet!=='public_datasets') return;
if(this.isSigned==='false' || !this.isSigned || this.dataGet =='my_datasets') return;
let baseUrl=`/${item.Repo.OwnerName}/${item.Repo.Name}/datasets/${item.ID}/`
let url = item.IsStaring ? baseUrl+'unstar': baseUrl+'star'
let changeItem = item
putDatasetStar(url).then((res)=>{
if(res.data.Code===0){
if(this.dataGet =='my_favorite_datasets'){
this.publicDataList = this.publicDataList.filter((ele)=>{
return ele.ID!==item.ID
});
Message.success(this.$t('datasets.unstarSuccess'))
return
}
if(item.IsStaring){
changeItem.IsStaring = false
changeItem.NumStars = changeItem.NumStars - 1


Loading…
Cancel
Save