mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-25 07:14:43 +08:00
feat: 增加回收站文件夹限制 (#4479)
This commit is contained in:
parent
2eae8274f6
commit
38b0c42555
8 changed files with 28 additions and 4 deletions
|
@ -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',
|
||||
|
|
|
@ -1088,6 +1088,9 @@ const message = {
|
|||
ignoreCertificateHelper:
|
||||
'下載時忽略不可信證書可能導致數據洩露或篡改。請謹慎使用此選項,僅在信任下載源的情況下啟用',
|
||||
uploadOverLimit: '文件數量超過 1000! 請壓縮後上傳',
|
||||
clashDitNotSuppport: '檔名禁止包含 .1panel_clash',
|
||||
clashDleteAlert: '回收站資料夾不能刪除',
|
||||
clashOpenAlert: '回收站目錄請點選【回收站】按鈕開啟',
|
||||
},
|
||||
ssh: {
|
||||
autoStart: '開機自啟',
|
||||
|
|
|
@ -1089,6 +1089,9 @@ const message = {
|
|||
ignoreCertificateHelper:
|
||||
'下载时忽略不可信证书可能导致数据泄露或篡改。请谨慎使用此选项,仅在信任下载源的情况下启用',
|
||||
uploadOverLimit: '文件数量超过 1000!请压缩后上传',
|
||||
clashDitNotSuppport: '文件名禁止包含 .1panel_clash',
|
||||
clashDleteAlert: '回收站文件夹不能删除',
|
||||
clashOpenAlert: '回收站目录请点击【回收站】按钮打开',
|
||||
},
|
||||
ssh: {
|
||||
autoStart: '开机自启',
|
||||
|
|
|
@ -180,7 +180,7 @@ const initEditor = () => {
|
|||
folding: true,
|
||||
roundedSelection: false,
|
||||
overviewRulerBorder: false,
|
||||
wordWrap: 'on',
|
||||
wordWrap: config.wordWrap,
|
||||
});
|
||||
editor.onDidChangeModelContent(() => {
|
||||
if (editor) {
|
||||
|
|
|
@ -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<FormInstance>();
|
||||
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -447,6 +447,10 @@ const handleSearchResult = (res: ResultData<File.File>) => {
|
|||
|
||||
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,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="API Token" prop="authorization.apiKey">
|
||||
<el-input v-model.trim="account.authorization['apiKey']"></el-input>
|
||||
<span class="input-help">
|
||||
<span class="input-help text-red-500">
|
||||
{{ $t('ssl.cfHelper') }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
|
|
Loading…
Reference in a new issue