diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 6056980f9..819575e34 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1144,6 +1144,9 @@ const message = { ignoreCertificateHelper: 'Ignoring untrusted certificates during downloads may lead to data leakage or tampering. Please use this option with caution, only when trusting the download source.', uploadOverLimit: 'The number of files exceeds 1000! Please compress and upload', + clashDitNotSuppport: 'File names are prohibited from containing .1panel_clash', + clashDeleteAlert: 'The Recycle Bin folder cannot be deleted', + clashOpenAlert: 'Please click the [Recycle Bin] button to open the recycle bin directory', }, ssh: { autoStart: 'Auto Start', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index ba86f6f92..218c88ced 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1088,6 +1088,9 @@ const message = { ignoreCertificateHelper: '下載時忽略不可信證書可能導致數據洩露或篡改。請謹慎使用此選項,僅在信任下載源的情況下啟用', uploadOverLimit: '文件數量超過 1000! 請壓縮後上傳', + clashDitNotSuppport: '檔名禁止包含 .1panel_clash', + clashDleteAlert: '回收站資料夾不能刪除', + clashOpenAlert: '回收站目錄請點選【回收站】按鈕開啟', }, ssh: { autoStart: '開機自啟', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 068f04753..07f6d8bf9 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1089,6 +1089,9 @@ const message = { ignoreCertificateHelper: '下载时忽略不可信证书可能导致数据泄露或篡改。请谨慎使用此选项,仅在信任下载源的情况下启用', uploadOverLimit: '文件数量超过 1000!请压缩后上传', + clashDitNotSuppport: '文件名禁止包含 .1panel_clash', + clashDleteAlert: '回收站文件夹不能删除', + clashOpenAlert: '回收站目录请点击【回收站】按钮打开', }, ssh: { autoStart: '开机自启', diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index ced318807..bf560c810 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -180,7 +180,7 @@ const initEditor = () => { folding: true, roundedSelection: false, overviewRulerBorder: false, - wordWrap: 'on', + wordWrap: config.wordWrap, }); editor.onDidChangeModelContent(() => { if (editor) { diff --git a/frontend/src/views/host/file-management/create/index.vue b/frontend/src/views/host/file-management/create/index.vue index bc8451ec9..62a583f65 100644 --- a/frontend/src/views/host/file-management/create/index.vue +++ b/frontend/src/views/host/file-management/create/index.vue @@ -67,7 +67,7 @@ import i18n from '@/lang'; import FileRole from '@/components/file-role/index.vue'; import { Rules } from '@/global/form-rules'; import FileList from '@/components/file-list/index.vue'; -import { MsgSuccess } from '@/utils/message'; +import { MsgSuccess, MsgWarning } from '@/utils/message'; const fileForm = ref(); let loading = ref(false); @@ -120,6 +120,10 @@ const submit = async (formEl: FormInstance | undefined) => { if (!valid) { return; } + if (getPath.value.indexOf('.1panel_clash') > -1) { + MsgWarning(i18n.global.t('file.clashDitNotSuppport')); + return; + } let addItem = {}; Object.assign(addItem, addForm); diff --git a/frontend/src/views/host/file-management/delete/index.vue b/frontend/src/views/host/file-management/delete/index.vue index 6bdfce4f6..ab76e9e92 100644 --- a/frontend/src/views/host/file-management/delete/index.vue +++ b/frontend/src/views/host/file-management/delete/index.vue @@ -56,7 +56,7 @@ import { ref } from 'vue'; import { File } from '@/api/interface/file'; import { getIcon } from '@/utils/util'; import { DeleteFile, GetRecycleStatus } from '@/api/modules/files'; -import { MsgSuccess } from '@/utils/message'; +import { MsgSuccess, MsgWarning } from '@/utils/message'; const open = ref(false); const files = ref(); @@ -85,6 +85,10 @@ const getStatus = async () => { const onConfirm = () => { const pros = []; for (const s of files.value) { + if (s['path'].indexOf('.1panel_clash') > -1) { + MsgWarning(i18n.global.t('file.clashDleteAlert')); + return; + } pros.push(DeleteFile({ path: s['path'], isDir: s['isDir'], forceDelete: forceDelete.value })); } loading.value = true; diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index ee8d265cc..f05e2883c 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -447,6 +447,10 @@ const handleSearchResult = (res: ResultData) => { const open = async (row: File.File) => { if (row.isDir) { + if (row.name == '.1panel_clash') { + MsgWarning(i18n.global.t('file.clashOpenAlert')); + return; + } const name = row.name; if (req.path.endsWith('/')) { req.path = req.path + name; @@ -830,6 +834,9 @@ const buttons = [ }, { label: i18n.global.t('commons.button.delete'), + disabled: (row: File.File) => { + return row.name == '.1panel_clash'; + }, click: delFile, }, { diff --git a/frontend/src/views/website/ssl/dns-account/create/index.vue b/frontend/src/views/website/ssl/dns-account/create/index.vue index e6a3464a8..6b34fb247 100644 --- a/frontend/src/views/website/ssl/dns-account/create/index.vue +++ b/frontend/src/views/website/ssl/dns-account/create/index.vue @@ -57,7 +57,7 @@ - + {{ $t('ssl.cfHelper') }}