mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 00:09:16 +08:00
fix: 解决 i18n 导致页面错误的问题 (#4247)
This commit is contained in:
parent
cd43bff44d
commit
b1f20d125e
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
@ -7,6 +7,7 @@ yarn-error.log*
|
|||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
|
19705
frontend/package-lock.json
generated
19705
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@
|
|||||||
"axios": "^1.6.0",
|
"axios": "^1.6.0",
|
||||||
"echarts": "^5.3.0",
|
"echarts": "^5.3.0",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"element-plus": "^2.6.0",
|
"element-plus": "^2.3.4",
|
||||||
"fit2cloud-ui-plus": "^1.1.3",
|
"fit2cloud-ui-plus": "^1.1.3",
|
||||||
"js-base64": "^3.7.2",
|
"js-base64": "^3.7.2",
|
||||||
"js-md5": "^0.7.3",
|
"js-md5": "^0.7.3",
|
||||||
@ -46,7 +46,7 @@
|
|||||||
"vue": "^3.2.25",
|
"vue": "^3.2.25",
|
||||||
"vue-clipboard3": "^2.0.0",
|
"vue-clipboard3": "^2.0.0",
|
||||||
"vue-codemirror": "^6.1.1",
|
"vue-codemirror": "^6.1.1",
|
||||||
"vue-i18n": "^9.1.9",
|
"vue-i18n": "^9.10.2",
|
||||||
"vue-router": "^4.0.12",
|
"vue-router": "^4.0.12",
|
||||||
"vue3-seamless-scroll": "^1.2.0",
|
"vue3-seamless-scroll": "^1.2.0",
|
||||||
"xterm": "^4.19.0",
|
"xterm": "^4.19.0",
|
||||||
|
@ -25,7 +25,6 @@ defineProps({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.config-card {
|
.config-card {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: 10px;
|
|
||||||
.config-header {
|
.config-header {
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1446,8 +1446,8 @@ const message = {
|
|||||||
doc: 'Official document',
|
doc: 'Official document',
|
||||||
star: 'Star',
|
star: 'Star',
|
||||||
description: '1Panel, Modern, open source Linux server operation and maintenance management panel.',
|
description: '1Panel, Modern, open source Linux server operation and maintenance management panel.',
|
||||||
forum: 'Forum',
|
forum: 'Forum Help',
|
||||||
doc2: 'Document',
|
doc2: 'User Manual',
|
||||||
currentVersion: 'Version',
|
currentVersion: 'Version',
|
||||||
},
|
},
|
||||||
clean: {
|
clean: {
|
||||||
@ -2274,6 +2274,9 @@ const message = {
|
|||||||
execRule: 'Hit rule',
|
execRule: 'Hit rule',
|
||||||
acl: 'ACL',
|
acl: 'ACL',
|
||||||
sql: 'SQL injection',
|
sql: 'SQL injection',
|
||||||
|
cc: 'CC attack',
|
||||||
|
isBlocking: 'Blocking',
|
||||||
|
isFree: 'Unblocked',
|
||||||
},
|
},
|
||||||
monitor: {
|
monitor: {
|
||||||
name: 'Website Monitor',
|
name: 'Website Monitor',
|
||||||
|
@ -1347,8 +1347,8 @@ const message = {
|
|||||||
doc: '官方文檔',
|
doc: '官方文檔',
|
||||||
star: '點亮 Star',
|
star: '點亮 Star',
|
||||||
description: '1Panel,現代化、開源的 Linux 服務器運維管理面板。',
|
description: '1Panel,現代化、開源的 Linux 服務器運維管理面板。',
|
||||||
forum: '論壇',
|
forum: '論壇求助',
|
||||||
doc2: '文檔',
|
doc2: '使用手冊',
|
||||||
currentVersion: '當前運行版本:',
|
currentVersion: '當前運行版本:',
|
||||||
},
|
},
|
||||||
clean: {
|
clean: {
|
||||||
@ -2128,6 +2128,9 @@ const message = {
|
|||||||
execRule: '命中規則',
|
execRule: '命中規則',
|
||||||
acl: 'ACL',
|
acl: 'ACL',
|
||||||
sql: 'SQL 注入',
|
sql: 'SQL 注入',
|
||||||
|
cc: 'CC 攻擊',
|
||||||
|
isBlocking: '封鎖中',
|
||||||
|
isFree: '已解封',
|
||||||
},
|
},
|
||||||
monitor: {
|
monitor: {
|
||||||
name: '網站監控',
|
name: '網站監控',
|
||||||
|
@ -1348,8 +1348,8 @@ const message = {
|
|||||||
doc: '官方文档',
|
doc: '官方文档',
|
||||||
star: '点亮 Star',
|
star: '点亮 Star',
|
||||||
description: '1Panel,现代化、开源的 Linux 服务器运维管理面板。',
|
description: '1Panel,现代化、开源的 Linux 服务器运维管理面板。',
|
||||||
forum: '论坛',
|
forum: '论坛求助',
|
||||||
doc2: '文档',
|
doc2: '使用手冊',
|
||||||
currentVersion: '当前运行版本:',
|
currentVersion: '当前运行版本:',
|
||||||
},
|
},
|
||||||
clean: {
|
clean: {
|
||||||
@ -2129,6 +2129,9 @@ const message = {
|
|||||||
execRule: '命中规则',
|
execRule: '命中规则',
|
||||||
acl: 'ACL',
|
acl: 'ACL',
|
||||||
sql: 'SQL 注入',
|
sql: 'SQL 注入',
|
||||||
|
cc: 'CC 攻击',
|
||||||
|
isBlocking: '封禁中',
|
||||||
|
isFree: '已解封',
|
||||||
},
|
},
|
||||||
monitor: {
|
monitor: {
|
||||||
name: '网站监控',
|
name: '网站监控',
|
||||||
|
@ -502,9 +502,19 @@ export async function copyText(content: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getRuleType(ruleType: string) {
|
export function getRuleType(ruleType: string) {
|
||||||
|
if (ruleType == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
return i18n.global.t(`xpack.waf.${ruleType}`);
|
return i18n.global.t(`xpack.waf.${ruleType}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAction(action: string) {
|
export function getAction(action: string) {
|
||||||
|
if (action == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
return i18n.global.t(`xpack.waf.${action}`);
|
return i18n.global.t(`xpack.waf.${action}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLanguage() {
|
||||||
|
return localStorage.getItem('lang') || 'zh';
|
||||||
|
}
|
||||||
|
@ -174,8 +174,8 @@ import Detail from '../detail/index.vue';
|
|||||||
import Install from '../detail/install/index.vue';
|
import Install from '../detail/install/index.vue';
|
||||||
import router from '@/routers';
|
import router from '@/routers';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
|
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ const mobile = computed(() => {
|
|||||||
return globalStore.isMobile();
|
return globalStore.isMobile();
|
||||||
});
|
});
|
||||||
|
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
cacheSizeKey: 'app-page-size',
|
cacheSizeKey: 'app-page-size',
|
||||||
|
@ -78,13 +78,13 @@
|
|||||||
import { GetApp, GetAppDetail } from '@/api/modules/app';
|
import { GetApp, GetAppDetail } from '@/api/modules/app';
|
||||||
import MdEditor from 'md-editor-v3';
|
import MdEditor from 'md-editor-v3';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import Install from './install/index.vue';
|
import Install from './install/index.vue';
|
||||||
import router from '@/routers';
|
import router from '@/routers';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
|
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
|
|
||||||
const app = ref<any>({});
|
const app = ref<any>({});
|
||||||
const appDetail = ref<any>({});
|
const appDetail = ref<any>({});
|
||||||
|
@ -122,7 +122,6 @@ import { App } from '@/api/interface/app';
|
|||||||
import { GetAppInstallParams, UpdateAppInstallParams } from '@/api/modules/app';
|
import { GetAppInstallParams, UpdateAppInstallParams } from '@/api/modules/app';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import Header from '@/components/drawer-header/index.vue';
|
import Header from '@/components/drawer-header/index.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { Rules, checkNumberRange } from '@/global/form-rules';
|
import { Rules, checkNumberRange } from '@/global/form-rules';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
@ -130,6 +129,7 @@ import i18n from '@/lang';
|
|||||||
import { Codemirror } from 'vue-codemirror';
|
import { Codemirror } from 'vue-codemirror';
|
||||||
import { javascript } from '@codemirror/lang-javascript';
|
import { javascript } from '@codemirror/lang-javascript';
|
||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
|
|
||||||
const extensions = [javascript(), oneDark];
|
const extensions = [javascript(), oneDark];
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ const get = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getLabel = (row: EditForm): string => {
|
const getLabel = (row: EditForm): string => {
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
if (language == 'zh' || language == 'tw') {
|
if (language == 'zh' || language == 'tw') {
|
||||||
return row.labelZh;
|
return row.labelZh;
|
||||||
} else {
|
} else {
|
||||||
|
@ -317,11 +317,10 @@ import AppDetail from '../detail/index.vue';
|
|||||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import Status from '@/components/status/index.vue';
|
import Status from '@/components/status/index.vue';
|
||||||
import { getAge } from '@/utils/util';
|
import { getAge, getLanguage } from '@/utils/util';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { toFolder } from '@/global/business';
|
import { toFolder } from '@/global/business';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
const data = ref<any>();
|
const data = ref<any>();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@ -361,7 +360,7 @@ const router = useRouter();
|
|||||||
const activeName = ref(i18n.global.t('app.installed'));
|
const activeName = ref(i18n.global.t('app.installed'));
|
||||||
const mode = ref('installed');
|
const mode = ref('installed');
|
||||||
const moreTag = ref('');
|
const moreTag = ref('');
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
const appDetail = ref();
|
const appDetail = ref();
|
||||||
|
|
||||||
const sync = () => {
|
const sync = () => {
|
||||||
|
@ -43,11 +43,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { SearchApp } from '@/api/modules/app';
|
import { SearchApp } from '@/api/modules/app';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
|
|
||||||
let req = reactive({
|
let req = reactive({
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { Rules } from '@/global/form-rules';
|
import { Rules } from '@/global/form-rules';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
interface ParamObj extends App.InstallParams {
|
interface ParamObj extends App.InstallParams {
|
||||||
prop: string;
|
prop: string;
|
||||||
@ -97,7 +97,7 @@ const handleParams = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getLabel = (row: ParamObj): string => {
|
const getLabel = (row: ParamObj): string => {
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
if (language == 'zh' || language == 'tw') {
|
if (language == 'zh' || language == 'tw') {
|
||||||
return row.labelZh;
|
return row.labelZh;
|
||||||
} else {
|
} else {
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { Rules } from '@/global/form-rules';
|
import { Rules } from '@/global/form-rules';
|
||||||
|
import { getLanguage } from '@/utils/util';
|
||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
interface ParamObj extends App.FromField {
|
interface ParamObj extends App.FromField {
|
||||||
services: App.AppService[];
|
services: App.AppService[];
|
||||||
@ -93,7 +93,7 @@ const handleParams = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getLabel = (row: ParamObj): string => {
|
const getLabel = (row: ParamObj): string => {
|
||||||
const language = useI18n().locale.value;
|
const language = getLanguage();
|
||||||
if (language == 'zh' || language == 'tw') {
|
if (language == 'zh' || language == 'tw') {
|
||||||
return row.labelZh;
|
return row.labelZh;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user