Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ const pathSegments = computed(() => {
interface DrawerProps {
containerID: string;
title: string;
workdir?: string;
}

const acceptParams = async (params: DrawerProps): Promise<void> => {
visible.value = true;
containerID.value = params.containerID;
title.value = params.title;
filePath.value = '/';
filePath.value = params.workdir || '/';
await loadContainerFiles();
};

Expand Down
11 changes: 9 additions & 2 deletions frontend/src/views/container/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ import {
containerListStats,
containerOperator,
inspect,
loadContainerInfo,
loadContainerStatus,
searchContainer,
} from '@/api/modules/container';
Expand Down Expand Up @@ -677,9 +678,15 @@ const onTerminal = (row: any) => {
dialogTerminalRef.value!.acceptParams({ containerID: row.containerID, title: title });
};
const dialogFileBrowserRef = ref();
const onOpenFileBrowser = (row: any) => {
const onOpenFileBrowser = async (row: any) => {
const title = i18n.global.t('menu.container') + ' ' + row.name;
dialogFileBrowserRef.value!.acceptParams({ containerID: row.containerID, title: title });
let workdir = '/';
await loadContainerInfo(row.name)
.then((res) => {
workdir = res.data?.workingDir?.trim() || '/';
})
.catch(() => {});
dialogFileBrowserRef.value!.acceptParams({ containerID: row.containerID, title: title, workdir });
};

const onInspect = async (row: any) => {
Expand Down
Loading