Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ console/atest-desktop/atest.exe
console/atest-desktop/coverage
atest-store-git
.db
.marscode/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new blank line

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, we put a new line at the end of each file. You can search the reason in Google.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,I will search it.

2 changes: 1 addition & 1 deletion console/atest-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 19 additions & 9 deletions console/atest-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Guide,
DataAnalysis, Help, Setting
} from '@element-plus/icons-vue'
import { ref, watch } from 'vue'
import { ref, watch, getCurrentInstance} from 'vue'
import { API } from './views/net'
import { Cache } from './views/cache'
import TestingPanel from './views/TestingPanel.vue'
Expand All @@ -21,8 +21,12 @@ import WelcomePage from './views/WelcomePage.vue'
import DataManager from './views/DataManager.vue'
import MagicKey from './components/MagicKey.vue'
import { useI18n } from 'vue-i18n'
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import enUS from 'element-plus/dist/locale/en.mjs'

const { t, locale: i18nLocale } = useI18n()
const app = getCurrentInstance()?.appContext.app;

import { setAsDarkTheme, getThemes, setTheme, getTheme } from './theme'

Expand Down Expand Up @@ -67,19 +71,25 @@ const handleSelect = (key: string) => {
const locale = ref(Cache.GetPreference().language)
i18nLocale.value = locale.value

watch(locale, (e: string) =>{
Cache.WithLocale(e)
i18nLocale.value = e
})
watch(locale, (newLocale: string) => {
updateLocale(newLocale);
});
const updateLocale = (newLocale: string) => {
locale.value = newLocale;
i18nLocale.value = newLocale;
Cache.WithLocale(newLocale);

const elementLocale = newLocale === 'zh-CN' ? zhCn : enUS;
app?.use(ElementPlus, { locale: elementLocale });
};
const handleChangeLan = (command: string) => {
switch (command) {
case "chinese":
locale.value = "zh-CN"
break;
locale.value = 'zh-CN';
break;
case "english":
locale.value = "en-US"
break;
locale.value = 'en-US';
break;
}
};

Expand Down
1 change: 1 addition & 0 deletions console/atest-ui/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"codeGenerator": "代码生成",
"testing": "测试",
"history": "测试历史",
"mock": "模拟",
"welcome": "欢迎",
"secrets": "凭据",
"stores": "存储",
Expand Down
2 changes: 1 addition & 1 deletion console/atest-ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ app.config.errorHandler = (error) => {
app.use(ElementPlus, {
locale: lang === 'zh' ? zhCn : enUS
})
app.use(i18n)

app.use(i18n)
app.mount('#app')

const dontShowAgain = window.location.search.indexOf('newbie') === -1;
Expand Down
2 changes: 2 additions & 0 deletions console/atest-ui/src/views/TestSuite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ const renameTestSuite = (name: string) => {
<HistoryInput placeholder="API" v-model="suite.api" group="apiAddress" />
</el-form-item>
<table class="full-width">
<tbody>
<tr>
<td>
<el-select
Expand All @@ -337,6 +338,7 @@ const renameTestSuite = (name: string) => {
/>
</td>
</tr>
</tbody>
</table>

<el-collapse>
Expand Down
Loading