Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -20,8 +20,12 @@ import SecretManager from './views/SecretManager.vue'
import WelcomePage from './views/WelcomePage.vue'
import DataManager from './views/DataManager.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 @@ -66,19 +70,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 @@ -39,6 +39,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
4 changes: 3 additions & 1 deletion console/atest-ui/src/views/TestSuite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ const renameTestSuite = (name: string) => {
<HistoryInput placeholder="API" v-model="suite.api" group="apiAddress" />
</el-form-item>
<table style="width: 100%">
<tr>
<tbody>
<tr>
<td>
<el-select
v-model="suite.spec.kind"
Expand All @@ -329,6 +330,7 @@ const renameTestSuite = (name: string) => {
/>
</td>
</tr>
</tbody>
</table>

<el-collapse>
Expand Down
4 changes: 4 additions & 0 deletions tools/make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ help:
@echo -e "Usage:\n make \033[36m<Target>\033[0m \033[36m<Option>\033[0m\n\nTargets:"
@awk 'BEGIN {FS = ":.*##"; printf ""} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@echo -e "\n$$USAGE_OPTIONS"

Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO, this mk target more appropriate to put it in golang .mk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your correction. I will read the code carefully again.

.PHONY: fmt
fmt:
go fmt ./...
Copy link
Owner

Choose a reason for hiding this comment

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

It already exists. You can find it from golang.mk

Copy link
Owner

Choose a reason for hiding this comment

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

So, what is your pre-commit hook command?

Loading