mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: add WSL and Docker support for file location opening
- Add WSL detection and Windows path conversion using wslpath - Add Docker/Kubernetes detection via /.dockerenv and /proc/1/cgroup - Implement clipboard fallback for containerized environments - Update open_file_location handler to detect WSL/Docker before POSIX - Update open_settings_location handler with same detection logic - Add clipboard API integration with graceful fallback in frontend - Add translations for clipboard feature across all 10 languages - Add unit tests for _is_wsl(), _is_docker(), and _wsl_to_windows_path() Fixes file manager opening failures in WSL and Docker environments.
This commit is contained in:
@@ -1001,7 +1001,20 @@ async function openFileLocation(filePath) {
|
||||
body: JSON.stringify({ 'file_path': filePath })
|
||||
});
|
||||
if (!resp.ok) throw new Error('Failed to open file location');
|
||||
showToast('modals.model.openFileLocation.success', {}, 'success');
|
||||
|
||||
const data = await resp.json();
|
||||
|
||||
if (data.mode === 'clipboard' && data.path) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(data.path);
|
||||
showToast('modals.model.openFileLocation.copied', { path: data.path }, 'success');
|
||||
} catch (clipboardErr) {
|
||||
console.warn('Clipboard API not available:', clipboardErr);
|
||||
showToast('modals.model.openFileLocation.clipboardFallback', { path: data.path }, 'info');
|
||||
}
|
||||
} else {
|
||||
showToast('modals.model.openFileLocation.success', {}, 'success');
|
||||
}
|
||||
} catch (err) {
|
||||
showToast('modals.model.openFileLocation.failed', {}, 'error');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user