diff --git a/frontend/src/views/setting/panel/hidemenu/index.vue b/frontend/src/views/setting/panel/hidemenu/index.vue index 2e6e146d3..d1ca60a1f 100644 --- a/frontend/src/views/setting/panel/hidemenu/index.vue +++ b/frontend/src/views/setting/panel/hidemenu/index.vue @@ -49,11 +49,13 @@ import { ElMessageBox } from 'element-plus'; import i18n from '@/lang'; import { updateMenu } from '@/api/modules/setting'; import { MsgSuccess } from '@/utils/message'; +import { GlobalStore } from '@/store'; const drawerVisible = ref(); const loading = ref(); const defaultCheck = ref([]); const emit = defineEmits<{ (e: 'search'): void }>(); +const globalStore = GlobalStore(); interface DialogProps { menuList: string; } @@ -82,6 +84,17 @@ function loadCheck(data: any, checkList: any) { } } +const removeXAlertDashboard = (data: any): any => { + return data + .filter((item: { label: string }) => item.label !== 'XAlertDashboard') + .map((item: { children: any }) => { + if (Array.isArray(item.children)) { + item.children = removeXAlertDashboard(item.children); + } + return item; + }); +}; + const onSaveStatus = async (row: any) => { if (row.label === '/xpack') { if (!row.isCheck) { @@ -123,6 +136,9 @@ const acceptParams = (params: DialogProps): void => { treeData.hideMenu = []; defaultCheck.value = []; treeData.hideMenu.push(JSON.parse(menuList.value)); + if (globalStore.isIntl) { + treeData.hideMenu = removeXAlertDashboard(treeData.hideMenu); + } loadCheck(treeData.hideMenu, defaultCheck.value); }; diff --git a/frontend/src/views/website/runtime/php/create/index.vue b/frontend/src/views/website/runtime/php/create/index.vue index faa8628f7..00a78cdaf 100644 --- a/frontend/src/views/website/runtime/php/create/index.vue +++ b/frontend/src/views/website/runtime/php/create/index.vue @@ -188,6 +188,48 @@ const appReq = reactive({ page: 1, pageSize: 20, }); +const phpSources = globalStore.isIntl + ? [ + { + label: i18n.global.t('runtime.default'), + value: 'dl-cdn.alpinelinux.org', + }, + { + label: i18n.global.t('runtime.xtom'), + value: 'mirrors.xtom.com', + }, + ] + : [ + { + label: i18n.global.t('runtime.ustc'), + value: 'mirrors.ustc.edu.cn', + }, + { + label: i18n.global.t('runtime.netease'), + value: 'mirrors.163.com', + }, + { + label: i18n.global.t('runtime.aliyun'), + value: 'mirrors.aliyun.com', + }, + { + label: i18n.global.t('runtime.tsinghua'), + value: 'mirrors.tuna.tsinghua.edu.cn', + }, + { + label: i18n.global.t('runtime.xtomhk'), + value: 'mirrors.xtom.com.hk', + }, + { + label: i18n.global.t('runtime.xtom'), + value: 'mirrors.xtom.com', + }, + { + label: i18n.global.t('runtime.default'), + value: 'dl-cdn.alpinelinux.org', + }, + ]; + const initData = (type: string) => ({ name: '', appDetailID: undefined, @@ -196,7 +238,7 @@ const initData = (type: string) => ({ type: type, resource: 'appstore', rebuild: false, - source: 'mirrors.ustc.edu.cn', + source: phpSources[0].value, }); const extensions = ref(); @@ -211,37 +253,6 @@ const rules = ref({ source: [Rules.requiredSelect], }); -const phpSources = [ - { - label: i18n.global.t('runtime.ustc'), - value: 'mirrors.ustc.edu.cn', - }, - { - label: i18n.global.t('runtime.netease'), - value: 'mirrors.163.com', - }, - { - label: i18n.global.t('runtime.aliyun'), - value: 'mirrors.aliyun.com', - }, - { - label: i18n.global.t('runtime.tsinghua'), - value: 'mirrors.tuna.tsinghua.edu.cn', - }, - { - label: i18n.global.t('runtime.xtomhk'), - value: 'mirrors.xtom.com.hk', - }, - { - label: i18n.global.t('runtime.xtom'), - value: 'mirrors.xtom.com', - }, - { - label: i18n.global.t('runtime.default'), - value: 'dl-cdn.alpinelinux.org', - }, -]; - const em = defineEmits(['close', 'submit']); const handleClose = () => {