From 4ef9fcde59a785febc2ea1c626e88acf5112ec97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:23:24 +0800 Subject: [PATCH] fix: Default display of hidden files (#9327) #9325 #9324 --- .../src/views/host/file-management/code-editor/index.vue | 2 +- frontend/src/views/host/file-management/index.vue | 7 ++++++- frontend/src/views/host/file-management/move/index.vue | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) 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 f6c74ac24..6de741e9c 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -753,7 +753,7 @@ const initEditor = () => { lineNumbersMinChars: 6, }); if (editor.getModel().getValue() === '') { - let defaultContent = '\n\n\n\n'; + let defaultContent = ''; editor.getModel().setValue(defaultContent); } diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index 984096d96..63233a0b8 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -603,7 +603,7 @@ let selects = ref([]); const initData = () => ({ path: '/', expand: true, - showHidden: false, + showHidden: true, page: 1, pageSize: 100, search: '', @@ -718,6 +718,7 @@ const handleSearchResult = (res: ResultData) => { const viewHideFile = async () => { req.showHidden = !req.showHidden; + localStorage.setItem('show-hidden', req.showHidden ? 'true' : 'false'); let searchResult = await searchFile(); handleSearchResult(searchResult); }; @@ -1411,6 +1412,10 @@ const getHostMount = async () => { }; onMounted(() => { + if (localStorage.getItem('show-hidden') === null) { + localStorage.setItem('show-hidden', 'true'); + } + req.showHidden = localStorage.getItem('show-hidden') === 'true'; getHostMount(); if (router.currentRoute.value.query.path) { req.path = String(router.currentRoute.value.query.path); diff --git a/frontend/src/views/host/file-management/move/index.vue b/frontend/src/views/host/file-management/move/index.vue index 207552c4c..798791ce2 100644 --- a/frontend/src/views/host/file-management/move/index.vue +++ b/frontend/src/views/host/file-management/move/index.vue @@ -246,6 +246,7 @@ const acceptParams = async (props: MoveProps) => { addForm.name = ''; addForm.allNames = props.allNames; type.value = props.type; + existFiles.value = []; if (props.name && props.name != '') { oldName.value = props.name; const res = await checkFile(props.path + '/' + props.name, false);