Skip to content

Commit 4ef9fcd

Browse files
authored
fix: Default display of hidden files (#9327)
#9325 #9324
1 parent 7889b5a commit 4ef9fcd

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

frontend/src/views/host/file-management/code-editor/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ const initEditor = () => {
753753
lineNumbersMinChars: 6,
754754
});
755755
if (editor.getModel().getValue() === '') {
756-
let defaultContent = '\n\n\n\n';
756+
let defaultContent = '';
757757
editor.getModel().setValue(defaultContent);
758758
}
759759

frontend/src/views/host/file-management/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ let selects = ref<any>([]);
603603
const initData = () => ({
604604
path: '/',
605605
expand: true,
606-
showHidden: false,
606+
showHidden: true,
607607
page: 1,
608608
pageSize: 100,
609609
search: '',
@@ -718,6 +718,7 @@ const handleSearchResult = (res: ResultData<File.File>) => {
718718
719719
const viewHideFile = async () => {
720720
req.showHidden = !req.showHidden;
721+
localStorage.setItem('show-hidden', req.showHidden ? 'true' : 'false');
721722
let searchResult = await searchFile();
722723
handleSearchResult(searchResult);
723724
};
@@ -1411,6 +1412,10 @@ const getHostMount = async () => {
14111412
};
14121413
14131414
onMounted(() => {
1415+
if (localStorage.getItem('show-hidden') === null) {
1416+
localStorage.setItem('show-hidden', 'true');
1417+
}
1418+
req.showHidden = localStorage.getItem('show-hidden') === 'true';
14141419
getHostMount();
14151420
if (router.currentRoute.value.query.path) {
14161421
req.path = String(router.currentRoute.value.query.path);

frontend/src/views/host/file-management/move/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ const acceptParams = async (props: MoveProps) => {
246246
addForm.name = '';
247247
addForm.allNames = props.allNames;
248248
type.value = props.type;
249+
existFiles.value = [];
249250
if (props.name && props.name != '') {
250251
oldName.value = props.name;
251252
const res = await checkFile(props.path + '/' + props.name, false);

0 commit comments

Comments
 (0)