update
This commit is contained in:
@@ -424,24 +424,6 @@ const handleQuickCommandExecute = (command: string) => {
|
|||||||
<i v-if="!isSearching" class="fas fa-search text-base"></i>
|
<i v-if="!isSearching" class="fas fa-search text-base"></i>
|
||||||
<i v-else class="fas fa-times text-base"></i>
|
<i v-else class="fas fa-times text-base"></i>
|
||||||
</button>
|
</button>
|
||||||
<!-- File Manager Button -->
|
|
||||||
<button
|
|
||||||
v-if="showPopupFileManagerBoolean"
|
|
||||||
@click="openFileManagerModal"
|
|
||||||
class="flex-shrink-0 flex items-center justify-center w-8 h-8 border border-border/50 rounded-lg text-text-secondary transition-colors duration-200 hover:bg-border hover:text-foreground"
|
|
||||||
:title="t('fileManager.title', '文件管理器')"
|
|
||||||
>
|
|
||||||
<i class="fas fa-folder text-base"></i>
|
|
||||||
</button>
|
|
||||||
<!-- File Editor Button -->
|
|
||||||
<button
|
|
||||||
v-if="showPopupFileEditorBoolean"
|
|
||||||
@click="openFileEditorModal"
|
|
||||||
class="flex-shrink-0 flex items-center justify-center w-8 h-8 border border-border/50 rounded-lg text-text-secondary transition-colors duration-200 hover:bg-border hover:text-foreground"
|
|
||||||
:title="t('fileEditor.title', '文件编辑器')"
|
|
||||||
>
|
|
||||||
<i class="fas fa-edit text-base"></i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!-- Search navigation buttons (Hide on mobile when searching) -->
|
<!-- Search navigation buttons (Hide on mobile when searching) -->
|
||||||
<template v-if="isSearching && !props.isMobile"> <!-- +++ Add !props.isMobile condition +++ -->
|
<template v-if="isSearching && !props.isMobile"> <!-- +++ Add !props.isMobile condition +++ -->
|
||||||
@@ -460,6 +442,24 @@ const handleQuickCommandExecute = (command: string) => {
|
|||||||
<i class="fas fa-arrow-down text-base"></i>
|
<i class="fas fa-arrow-down text-base"></i>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- File Manager Button -->
|
||||||
|
<button
|
||||||
|
v-if="showPopupFileManagerBoolean"
|
||||||
|
@click="openFileManagerModal"
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-8 h-8 border border-border/50 rounded-lg text-text-secondary transition-colors duration-200 hover:bg-border hover:text-foreground"
|
||||||
|
:title="t('fileManager.title', '文件管理器')"
|
||||||
|
>
|
||||||
|
<i class="fas fa-folder text-base"></i>
|
||||||
|
</button>
|
||||||
|
<!-- File Editor Button -->
|
||||||
|
<button
|
||||||
|
v-if="showPopupFileEditorBoolean"
|
||||||
|
@click="openFileEditorModal"
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-8 h-8 border border-border/50 rounded-lg text-text-secondary transition-colors duration-200 hover:bg-border hover:text-foreground"
|
||||||
|
:title="t('fileEditor.title', '文件编辑器')"
|
||||||
|
>
|
||||||
|
<i class="fas fa-edit text-base"></i>
|
||||||
|
</button>
|
||||||
<!-- Note: On mobile, when searching, only the close button (inside toggleSearch button logic) will be effectively visible in this control group -->
|
<!-- Note: On mobile, when searching, only the close button (inside toggleSearch button logic) will be effectively visible in this control group -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,12 +77,13 @@ const isVirtualKeyboardVisible = ref(true); // +++ State for virtual keyboard vi
|
|||||||
|
|
||||||
// --- 文件管理器模态框状态 ---
|
// --- 文件管理器模态框状态 ---
|
||||||
const showFileManagerModal = ref(false);
|
const showFileManagerModal = ref(false);
|
||||||
const fileManagerProps = shallowRef<null | {
|
const fileManagerPropsMap = shallowRef<Map<string, {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
instanceId: string;
|
instanceId: string;
|
||||||
dbConnectionId: string;
|
dbConnectionId: string;
|
||||||
wsDeps: WebSocketDependencies;
|
wsDeps: WebSocketDependencies;
|
||||||
}>(null);
|
}>>(new Map());
|
||||||
|
const currentFileManagerSessionId = ref<string | null>(null);
|
||||||
|
|
||||||
// --- 处理全局键盘事件 ---
|
// --- 处理全局键盘事件 ---
|
||||||
const handleGlobalKeyDown = (event: KeyboardEvent) => {
|
const handleGlobalKeyDown = (event: KeyboardEvent) => {
|
||||||
@@ -683,23 +684,25 @@ const handleFileManagerOpenRequest = (payload: { sessionId: string }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 生成 instanceId
|
// 3. 生成或获取 instanceId
|
||||||
const instanceId = `fm-modal-${sessionId}-${Date.now()}`;
|
const currentProps = fileManagerPropsMap.value.get(sessionId);
|
||||||
|
const instanceId = currentProps ? currentProps.instanceId : `fm-modal-${sessionId}`;
|
||||||
|
|
||||||
// 4. 设置 props 并显示模态框
|
// 4. 设置 props 并显示模态框
|
||||||
fileManagerProps.value = {
|
const newProps = {
|
||||||
sessionId,
|
sessionId,
|
||||||
instanceId,
|
instanceId,
|
||||||
dbConnectionId: String(dbConnectionId), // 确保是 string
|
dbConnectionId: String(dbConnectionId), // 确保是 string
|
||||||
wsDeps,
|
wsDeps,
|
||||||
};
|
};
|
||||||
|
fileManagerPropsMap.value.set(sessionId, newProps);
|
||||||
|
currentFileManagerSessionId.value = sessionId;
|
||||||
showFileManagerModal.value = true;
|
showFileManagerModal.value = true;
|
||||||
console.log(`[WorkspaceView] Opening FileManager modal with props:`, fileManagerProps.value);
|
console.log(`[WorkspaceView] Opening FileManager modal with props for session ${sessionId}:`, newProps);
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeFileManagerModal = () => {
|
const closeFileManagerModal = () => {
|
||||||
showFileManagerModal.value = false;
|
showFileManagerModal.value = false;
|
||||||
// fileManagerProps.value = null; // 不再清理 props,以实现保活
|
|
||||||
console.log('[WorkspaceView] FileManager modal hidden (kept alive).');
|
console.log('[WorkspaceView] FileManager modal hidden (kept alive).');
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -796,24 +799,28 @@ const closeFileManagerModal = () => {
|
|||||||
<!-- RDP Modal is now rendered in App.vue -->
|
<!-- RDP Modal is now rendered in App.vue -->
|
||||||
<!-- VNC Modal is now rendered in App.vue -->
|
<!-- VNC Modal is now rendered in App.vue -->
|
||||||
|
|
||||||
<!-- FileManager Modal -->
|
<!-- FileManager Modal Container -->
|
||||||
<div v-if="fileManagerProps" v-show="showFileManagerModal" class="fixed inset-0 flex items-center justify-center z-50 p-4" :style="{ backgroundColor: 'var(--overlay-bg-color)' }" @click.self="closeFileManagerModal">
|
<div v-show="showFileManagerModal && currentFileManagerSessionId && fileManagerPropsMap.get(currentFileManagerSessionId)" class="fixed inset-0 flex items-center justify-center z-50 p-4" :style="{ backgroundColor: 'var(--overlay-bg-color)' }" @click.self="closeFileManagerModal">
|
||||||
<div class="bg-background rounded-lg shadow-xl w-full max-w-4xl h-[85vh] flex flex-col overflow-hidden border border-border">
|
<div class="bg-background rounded-lg shadow-xl w-full max-w-4xl h-[85vh] flex flex-col overflow-hidden border border-border">
|
||||||
<div class="flex justify-between items-center p-3 border-b border-border flex-shrink-0 bg-header">
|
<div class="flex justify-between items-center p-3 border-b border-border flex-shrink-0 bg-header">
|
||||||
<h2 class="text-lg font-semibold text-foreground">{{ t('fileManager.modalTitle', '文件管理器') }} ({{ fileManagerProps.sessionId }})</h2>
|
<h2 class="text-lg font-semibold text-foreground">{{ t('fileManager.modalTitle', '文件管理器') }} ({{ currentFileManagerSessionId }})</h2>
|
||||||
<button @click="closeFileManagerModal" class="text-text-secondary hover:text-foreground transition-colors">
|
<button @click="closeFileManagerModal" class="text-text-secondary hover:text-foreground transition-colors">
|
||||||
<i class="fas fa-times text-xl"></i>
|
<i class="fas fa-times text-xl"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow overflow-hidden">
|
<div class="flex-grow overflow-hidden">
|
||||||
|
<template v-for="props in fileManagerPropsMap.values()" :key="props.sessionId">
|
||||||
|
<div v-show="props.sessionId === currentFileManagerSessionId" class="h-full">
|
||||||
<FileManager
|
<FileManager
|
||||||
:session-id="fileManagerProps.sessionId"
|
:session-id="props.sessionId"
|
||||||
:instance-id="fileManagerProps.instanceId"
|
:instance-id="props.instanceId"
|
||||||
:db-connection-id="fileManagerProps.dbConnectionId"
|
:db-connection-id="props.dbConnectionId"
|
||||||
:ws-deps="fileManagerProps.wsDeps"
|
:ws-deps="props.wsDeps"
|
||||||
class="h-full"
|
class="h-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user