Skip to content
Merged
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;
workingDir?: string;
}

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

Expand Down
14 changes: 12 additions & 2 deletions frontend/src/views/container/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,19 @@ 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 workingDir = '/';
try {
const res = await inspect({ id: row.containerID, type: 'container', detail: '' });
const data = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
if (data?.Config?.WorkingDir) {
workingDir = data.Config.WorkingDir;
}
} catch (e) {
/* fallback to root */
}
dialogFileBrowserRef.value!.acceptParams({ containerID: row.containerID, title: title, workingDir: workingDir });
};

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