Browse Source

修正国际化相关内容

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.8.2^2
zouap 3 years ago
parent
commit
18022c3af9
7 changed files with 47 additions and 32 deletions
  1. +15
    -10
      models/dataset.go
  2. +1
    -1
      modules/cloudbrain/resty.go
  3. +1
    -1
      options/locale/locale_en-US.ini
  4. +4
    -0
      routers/repo/dataset.go
  5. +1
    -1
      templates/repo/datasets/index.tmpl
  6. +23
    -17
      web_src/js/components/dataset/selectDataset.vue
  7. +2
    -2
      web_src/js/features/i18nVue.js

+ 15
- 10
models/dataset.go View File

@@ -171,16 +171,17 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
}

type SearchDatasetOptions struct {
Keyword string
OwnerID int64
User *User
RepoID int64
IncludePublic bool
RecommendOnly bool
Category string
Task string
License string
DatasetIDs []int64
Keyword string
OwnerID int64
User *User
RepoID int64
IncludePublic bool
RecommendOnly bool
Category string
Task string
License string
DatasetIDs []int64
ExcludeDatasetId int64
ListOptions
SearchOrderBy
IsOwner bool
@@ -240,6 +241,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID})
}

if opts.ExcludeDatasetId > 0 {
cond = cond.And(builder.Neq{"dataset.id": opts.ExcludeDatasetId})
}

if opts.PublicOnly {
cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic})
cond = cond.And(builder.Eq{"attachment.is_private": false})


+ 1
- 1
modules/cloudbrain/resty.go View File

@@ -93,7 +93,7 @@ sendjob:
return nil, fmt.Errorf("resty get queues detail failed: %s", err)
}

if jobResult.Code == errInvalidToken && retry < 1 {
if (res.StatusCode() == http.StatusUnauthorized || jobResult.Code == errInvalidToken) && retry < 1 {
retry++
_ = loginCloudbrain()
goto sendjob


+ 1
- 1
options/locale/locale_en-US.ini View File

@@ -924,7 +924,7 @@ dataset_name_tooltips = Please enter letters, numbers, _ and - up to 100 charact
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_instructions_for_use = Instructions for use: You can refer to Openi AI Collaboration Platform
dataset_camp_course = Newcomer Training Camp Course;
dataset_camp_course = OpenI_Learning;
dataset_upload = Upload
dataset_upload_status= Upload Status
dataset_file_name = File Name


+ 4
- 0
routers/repo/dataset.go View File

@@ -529,6 +529,10 @@ func ReferenceDatasetAvailable(ctx *context.Context) {
NeedAttachment: false,
CloudBrainType: models.TypeCloudBrainAll,
}
dataset, _ := models.GetDatasetByRepo(&models.Repository{ID: ctx.Repo.Repository.ID})
if dataset != nil {
opts.ExcludeDatasetId = dataset.ID
}
datasetMultiple(ctx, opts)

}


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

@@ -417,7 +417,7 @@
<div class="bgtask-content">
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
href="https://git.openi.org.cn/zeizei/OpenI_Learning">&nbsp;{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
</div>
</div>
</div>


+ 23
- 17
web_src/js/components/dataset/selectDataset.vue View File

@@ -11,9 +11,9 @@
v-if="benchmarkNew"
class="label-fix-width"
style="font-weight: normal"
>{{i18n.dataset_label}}</label
>{{ i18n.dataset_label }}</label
>
<label v-else>{{i18n.dataset_label}}</label>
<label v-else>{{ i18n.dataset_label }}</label>
<span
:class="
benchmarkNew === true ? 'dataset-train-span' : 'dataset-debug-span'
@@ -59,7 +59,7 @@
? 'select-dataset-button'
: 'select-dataset-button-color'
"
>{{i18n.dataset_select}}
>{{ i18n.dataset_select }}
</el-button>
<el-dialog
:title="i18n.dataset_select"
@@ -90,7 +90,11 @@
>
<el-tabs v-model="activeName" @tab-click="handleClick">
<!-- 当前项目的数据集 -->
<el-tab-pane :label="i18n.dataset_current_repo" name="first" v-loading="loadingCurrent">
<el-tab-pane
:label="i18n.dataset_current_repo"
name="first"
v-loading="loadingCurrent"
>
<el-row>
<el-tree
:data="currentDatasetList"
@@ -172,13 +176,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -201,7 +205,11 @@
</div>
</el-tab-pane>
<!-- 我上传的数据集 -->
<el-tab-pane :label="i18n.dataset_my_upload" name="second" v-loading="loadingMy">
<el-tab-pane
:label="i18n.dataset_my_upload"
name="second"
v-loading="loadingMy"
>
<el-row>
<el-tree
:data="myDatasetList"
@@ -274,13 +282,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -380,13 +388,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -486,13 +494,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -536,7 +544,7 @@
line-height: 40px;
"
>
{{i18n.dataset_selected}}
{{ i18n.dataset_selected }}
</div>
<div style="flex: 1; margin-top: 1.5rem">
<el-checkbox-group v-model="checkList">
@@ -558,7 +566,7 @@
color: #fff;
border: 1px solid #389e0d;
"
>{{i18n.dataset_ok}}</el-button
>{{ i18n.dataset_ok }}</el-button
>
</div>
</el-col>
@@ -732,7 +740,6 @@ export default {
.then((res) => {
this.loadingCurrent = false;
let data = JSON.parse(res.data.data);
console.log(data);
this.currentDatasetList = this.transformeTreeData(
data,
"currentTree",
@@ -996,7 +1003,6 @@ export default {
location.href.indexOf("train-job") !== -1 ||
location.href.indexOf("inference") !== -1
) {
console.log("this.benchmarkNew");
this.benchmarkNew = true;
}
if (


+ 2
- 2
web_src/js/features/i18nVue.js View File

@@ -150,10 +150,10 @@ export const i18nVue = {
downloads: "Downloads",
not_link_dataset: "No datasets have been linked yet",
no_link_dataset_tips1:
"You can display public datasets on the platform here by clicking the New Linked Dataset button.",
"You can display public datasets on the platform here by clicking the Linked Datasets button.",

dataset_instructions_for_use:
"Instructions for use: You can refer to Openi AI Collaboration Platform ",
"Instructions for use: You can refer to OpenI AI Collaboration Platform ",
dataset_camp_course: " Newcomer Training Camp Course",
dataset_link_success: "Linked dataset succeeded!",
dataset_link_failed: "Linked dataset Failed!",


Loading…
Cancel
Save