Compare commits

...

2 Commits

Author SHA1 Message Date
  wangjr 446104c834 修改翻页组件内部国际化实现 3 years ago
  wangjr 1d13695cfa 初步增加组件内国际化实现 3 years ago
14 changed files with 1018 additions and 881 deletions
Split View
  1. +2
    -0
      options/locale/locale_zh-CN.ini
  2. +24
    -11
      templates/admin/cloudbrain/list.tmpl
  3. +2
    -1
      templates/base/footer_content.tmpl
  4. +1
    -1
      templates/base/footer_content_fluid.tmpl
  5. +16
    -1
      templates/custom/select_dataset.tmpl
  6. +4
    -1
      templates/explore/data_analysis.tmpl
  7. +15
    -0
      templates/explore/datasets.tmpl
  8. +15
    -0
      templates/repo/datasets/index.tmpl
  9. +13
    -0
      web_src/js/components/Contributors.vue
  10. +4
    -1
      web_src/js/components/DataAnalysis.vue
  11. +15
    -2
      web_src/js/components/Images.vue
  12. +14
    -0
      web_src/js/components/Model.vue
  13. +877
    -862
      web_src/js/components/ProAnalysis.vue
  14. +16
    -1
      web_src/js/components/UserAnalysis.vue

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

@@ -2922,3 +2922,5 @@ cpu_num = CPU数
memory = 内存
shared_memory = 共享内存

[mirror]
imageMirror = 云脑镜像

+ 24
- 11
templates/admin/cloudbrain/list.tmpl View File

@@ -315,15 +315,28 @@
</div>
{{template "base/footer" .}}
<script>
function getParams(){
const params = new URLSearchParams(window.location.search)
let jobType = !params.get('jobType')? '{{.i18n.Tr "admin.cloudbrain.all_task_types"}}' : params.get('jobType')
let listType = !params.get('listType')? '{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}' : params.get('listType')
let jobStatus = !params.get('jobStatus')? '{{.i18n.Tr "admin.cloudbrain.all_status"}}' : params.get('jobStatus').toUpperCase()
const dropdownValueArray = [jobType,listType,jobStatus]
$('#adminCloud .default.text ').each(function(index,e){
$(e).text(dropdownValueArray[index])
})
}
getParams()
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}
function getParams(){
const params = new URLSearchParams(window.location.search)
let jobType = !params.get('jobType')? '{{.i18n.Tr "admin.cloudbrain.all_task_types"}}' : params.get('jobType')
let listType = !params.get('listType')? '{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}' : params.get('listType')
let jobStatus = !params.get('jobStatus')? '{{.i18n.Tr "admin.cloudbrain.all_status"}}' : params.get('jobStatus').toUpperCase()
const dropdownValueArray = [jobType,listType,jobStatus]
$('#adminCloud .default.text ').each(function(index,e){
$(e).text(dropdownValueArray[index])
})
}
getParams()
</script>

+ 2
- 1
templates/base/footer_content.tmpl View File

@@ -21,7 +21,7 @@
<div class="header item">{{.i18n.Tr "custom.foot.help"}}</div>
<div class="ui language bottom floating slide up dropdown link item">
<i class="world icon"></i>
<div class="text">{{.LangName}}</div>
<div class="text" id ='langName'>{{.LangName}}</div>
<div class="menu">
{{range .AllLangs}}
<a lang="{{.Lang}}" class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>
@@ -50,3 +50,4 @@
</div>
</div>
</footer>


+ 1
- 1
templates/base/footer_content_fluid.tmpl View File

@@ -19,7 +19,7 @@
<div class="header item">{{.i18n.Tr "custom.foot.help"}}</div>
<div class="ui language bottom floating slide up dropdown link item">
<i class="world icon"></i>
<div class="text">{{.LangName}}</div>
<div class="text" id ='langName'>{{.LangName}}</div>
<div class="menu">
{{range .AllLangs}}
<a lang="{{.Lang}}" class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>


+ 16
- 1
templates/custom/select_dataset.tmpl View File

@@ -135,4 +135,19 @@
</el-dialog>


</div>
</div>

<script>
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}
</script>

+ 4
- 1
templates/explore/data_analysis.tmpl View File

@@ -8,8 +8,11 @@

<style>
.full.height {
display: flex;
flex-flow: column wrap;
padding-bottom:0px;
/* flex-grow: 1; */
padding-bottom: 53px;
/* padding-bottom: 53px; */
}

</style>

+ 15
- 0
templates/explore/datasets.tmpl View File

@@ -216,3 +216,18 @@
</div>
</div>
{{template "base/footer" .}}

<script>
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}
</script>

+ 15
- 0
templates/repo/datasets/index.tmpl View File

@@ -344,3 +344,18 @@
{{template "base/delete_modal_actions" .}}
</div>
{{template "base/footer" .}}

<script>
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}
</script>

+ 13
- 0
web_src/js/components/Contributors.vue View File

@@ -36,7 +36,20 @@
</div>
</template>


<script>
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}

const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;



+ 4
- 1
web_src/js/components/DataAnalysis.vue View File

@@ -1,5 +1,5 @@
<template>
<div style="height:100%">
<div style="height:100%;flex:1" >
<el-tabs tab-position="left" v-model="activeName" style="height:100%" @tab-click="handleClick" >
<el-tab-pane label="概览" name="first" >
<span slot="label">
@@ -130,5 +130,8 @@
/deep/ .el-image{
filter:grayscale(100%)
}
/deep/ .el-pagination {
padding-bottom: 30px;
}
</style>

+ 15
- 2
web_src/js/components/Images.vue View File

@@ -256,12 +256,23 @@
</template>

<script>

const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config;
<script>

import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}

const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config;

export default {
components: {
@@ -421,6 +432,8 @@ export default {
}

};

</script>

<style scoped>


+ 14
- 0
web_src/js/components/Model.vue View File

@@ -131,8 +131,22 @@
</template>


<script>

import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}

const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config;

export default {


+ 877
- 862
web_src/js/components/ProAnalysis.vue
File diff suppressed because it is too large
View File


+ 16
- 1
web_src/js/components/UserAnalysis.vue View File

@@ -159,6 +159,19 @@
</template>

<script>
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}

import { export2Excel } from '../excel/util.js'
export default{
name:'UserAnalysis',
@@ -468,7 +481,9 @@
/deep/ .el-range-separator{
width: 20% !important;
}

/deep/ .el-pagination {
padding-bottom: 30px;
}
.colorChange {
background-color: #1684FC;
color: #FFFF;


Loading…
Cancel
Save