mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -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:
@@ -364,7 +364,19 @@ export class SettingsManager {
|
||||
throw new Error(`Request failed with status ${response.status}`);
|
||||
}
|
||||
|
||||
showToast('settings.openSettingsFileLocation.success', {}, 'success');
|
||||
const data = await response.json();
|
||||
|
||||
if (data.mode === 'clipboard' && data.path) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(data.path);
|
||||
showToast('settings.openSettingsFileLocation.copied', { path: data.path }, 'success');
|
||||
} catch (clipboardErr) {
|
||||
console.warn('Clipboard API not available:', clipboardErr);
|
||||
showToast('settings.openSettingsFileLocation.clipboardFallback', { path: data.path }, 'info');
|
||||
}
|
||||
} else {
|
||||
showToast('settings.openSettingsFileLocation.success', {}, 'success');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to open settings file location:', error);
|
||||
showToast('settings.openSettingsFileLocation.failed', {}, 'error');
|
||||
|
||||
Reference in New Issue
Block a user