diff --git a/package-lock.json b/package-lock.json index 0981d6a56..73db661dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "GPL-3.0-only", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", - "@comfyorg/comfyui-electron-types": "^0.4.11", + "@comfyorg/comfyui-electron-types": "^0.4.16", "@comfyorg/litegraph": "^0.8.62", "@primevue/forms": "^4.2.5", "@primevue/themes": "^4.2.5", @@ -1937,9 +1937,9 @@ "dev": true }, "node_modules/@comfyorg/comfyui-electron-types": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.4.11.tgz", - "integrity": "sha512-RGJeWwXjyv0Ojj7xkZKgcRxC1nFv1nh7qEWpNBiofxVgFiap9Ei79b/KJYxNE0no4BoYqRMaRg+sFtCE6yEukA==", + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.4.16.tgz", + "integrity": "sha512-AKy4WLVAuDka/Xjv8zrKwfU/wfRSQpFVE5DgxoLfvroCI0sw+rV1JqdL6xFVrYIoeprzbfKhQiyqlAWU+QgHyg==", "license": "GPL-3.0-only" }, "node_modules/@comfyorg/litegraph": { diff --git a/package.json b/package.json index 577ad91d1..af3db4bc1 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ }, "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", - "@comfyorg/comfyui-electron-types": "^0.4.11", + "@comfyorg/comfyui-electron-types": "^0.4.16", "@comfyorg/litegraph": "^0.8.62", "@primevue/forms": "^4.2.5", "@primevue/themes": "^4.2.5", diff --git a/src/components/common/UrlInput.vue b/src/components/common/UrlInput.vue index ff92bfd28..da23c6322 100644 --- a/src/components/common/UrlInput.vue +++ b/src/components/common/UrlInput.vue @@ -4,18 +4,18 @@ v-bind="$attrs" :model-value="internalValue" class="w-full" - :invalid="validationState === UrlValidationState.INVALID" + :invalid="validationState === ValidationState.INVALID" @update:model-value="handleInput" @blur="handleBlur" /> @@ -30,6 +30,7 @@ import { onMounted, ref, watch } from 'vue' import { isValidUrl } from '@/utils/formatUtil' import { checkUrlReachable } from '@/utils/networkUtil' +import { ValidationState } from '@/utils/validationUtil' const props = defineProps<{ modelValue: string @@ -38,16 +39,10 @@ const props = defineProps<{ const emit = defineEmits<{ 'update:modelValue': [value: string] + 'state-change': [state: ValidationState] }>() -enum UrlValidationState { - IDLE = 'IDLE', - LOADING = 'LOADING', - VALID = 'VALID', - INVALID = 'INVALID' -} - -const validationState = ref(UrlValidationState.IDLE) +const validationState = ref(ValidationState.IDLE) // Add internal value state const internalValue = ref(props.modelValue) @@ -60,6 +55,11 @@ watch( await validateUrl(newValue) } ) + +watch(validationState, (newState) => { + emit('state-change', newState) +}) + // Validate on mount onMounted(async () => { await validateUrl(props.modelValue) @@ -69,7 +69,7 @@ const handleInput = (value: string) => { // Update internal value without emitting internalValue.value = value // Reset validation state when user types - validationState.value = UrlValidationState.IDLE + validationState.value = ValidationState.IDLE } const handleBlur = async () => { @@ -88,24 +88,24 @@ const defaultValidateUrl = async (url: string): Promise => { } const validateUrl = async (value: string) => { - if (validationState.value === UrlValidationState.LOADING) return + if (validationState.value === ValidationState.LOADING) return const url = value.trim() // Reset state - validationState.value = UrlValidationState.IDLE + validationState.value = ValidationState.IDLE // Skip validation if empty if (!url) return - validationState.value = UrlValidationState.LOADING + validationState.value = ValidationState.LOADING try { const isValid = await (props.validateUrlFn ?? defaultValidateUrl)(url) validationState.value = isValid - ? UrlValidationState.VALID - : UrlValidationState.INVALID + ? ValidationState.VALID + : ValidationState.INVALID } catch { - validationState.value = UrlValidationState.INVALID + validationState.value = ValidationState.INVALID } } diff --git a/src/components/install/MirrorsConfiguration.vue b/src/components/install/MirrorsConfiguration.vue new file mode 100644 index 000000000..510acf1d5 --- /dev/null +++ b/src/components/install/MirrorsConfiguration.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/install/mirror/MirrorItem.vue b/src/components/install/mirror/MirrorItem.vue new file mode 100644 index 000000000..47056c3cf --- /dev/null +++ b/src/components/install/mirror/MirrorItem.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/constants/uvMirrors.ts b/src/constants/uvMirrors.ts new file mode 100644 index 000000000..21ed0ff2f --- /dev/null +++ b/src/constants/uvMirrors.ts @@ -0,0 +1,51 @@ +import { CUDA_TORCH_URL } from '@comfyorg/comfyui-electron-types' +import { NIGHTLY_CPU_TORCH_URL } from '@comfyorg/comfyui-electron-types' + +import { electronAPI, isElectron } from '@/utils/envUtil' + +export interface UVMirror { + /** + * The setting id defined for the mirror. + */ + settingId: string + /** + * The default mirror to use. + */ + mirror: string + /** + * The fallback mirror to use. + */ + fallbackMirror: string + /** + * The path suffix to validate the mirror is reachable. + */ + validationPathSuffix?: string +} + +const DEFAULT_TORCH_MIRROR = isElectron() + ? electronAPI().getPlatform() === 'darwin' + ? NIGHTLY_CPU_TORCH_URL + : CUDA_TORCH_URL + : '' + +export const UV_MIRRORS: UVMirror[] = [ + { + settingId: 'Comfy-Desktop.UV.PythonInstallMirror', + mirror: + 'https://github.com/astral-sh/python-build-standalone/releases/download', + fallbackMirror: + 'https://ghfast.top/https://github.com/astral-sh/python-build-standalone/releases/download', + validationPathSuffix: + '/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz' + }, + { + settingId: 'Comfy-Desktop.UV.PypiInstallMirror', + mirror: 'https://pypi.org/simple/', + fallbackMirror: 'https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple' + }, + { + settingId: 'Comfy-Desktop.UV.TorchInstallMirror', + mirror: DEFAULT_TORCH_MIRROR, + fallbackMirror: DEFAULT_TORCH_MIRROR + } +] diff --git a/src/extensions/core/electronAdapter.ts b/src/extensions/core/electronAdapter.ts index 5220a14fb..673bc04ce 100644 --- a/src/extensions/core/electronAdapter.ts +++ b/src/extensions/core/electronAdapter.ts @@ -1,7 +1,6 @@ import { t } from '@/i18n' import { app } from '@/scripts/app' import { useDialogService } from '@/services/dialogService' -import { useSettingStore } from '@/stores/settingStore' import { useWorkflowStore } from '@/stores/workflowStore' import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil' @@ -55,6 +54,27 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil' electronAPI.Config.setWindowStyle(newValue) } + }, + { + id: 'Comfy-Desktop.UV.PythonInstallMirror', + name: 'Python Install Mirror', + tooltip: `Managed Python installations are downloaded from the Astral python-build-standalone project. This variable can be set to a mirror URL to use a different source for Python installations. The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Distributions can be read from a local directory by using the file:// URL scheme.`, + type: 'url', + defaultValue: '' + }, + { + id: 'Comfy-Desktop.UV.PypiInstallMirror', + name: 'Pypi Install Mirror', + tooltip: `Default pip install mirror`, + type: 'url', + defaultValue: '' + }, + { + id: 'Comfy-Desktop.UV.TorchInstallMirror', + name: 'Torch Install Mirror', + tooltip: `Pip install mirror for pytorch`, + type: 'url', + defaultValue: '' } ], diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 0f0399d34..b75135c9b 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -212,7 +212,13 @@ "customNodeConfigurations": "Custom node configurations" }, "viewFullPolicy": "View full policy" - } + }, + "pythonMirrorPlaceholder": "Enter Python mirror URL", + "pypiMirrorPlaceholder": "Enter PyPI mirror URL", + "checkingMirrors": "Checking network access to python mirrors...", + "mirrorsReachable": "Network access to python mirrors is good", + "mirrorsUnreachable": "Network access to some python mirrors is bad", + "mirrorSettings": "Mirror Settings" }, "customNodes": "Custom Nodes", "customNodesDescription": "Reinstall custom nodes from existing ComfyUI installations.", @@ -472,6 +478,7 @@ "About": "About", "EditTokenWeight": "Edit Token Weight", "CustomColorPalettes": "Custom Color Palettes", + "UV": "UV", "ContextMenu": "Context Menu" }, "serverConfigItems": { diff --git a/src/locales/en/settings.json b/src/locales/en/settings.json index b9d57557c..5ed15c18c 100644 --- a/src/locales/en/settings.json +++ b/src/locales/en/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "Send anonymous usage metrics" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Pypi Install Mirror", + "tooltip": "Default pip install mirror" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Python Install Mirror", + "tooltip": "Managed Python installations are downloaded from the Astral python-build-standalone project. This variable can be set to a mirror URL to use a different source for Python installations. The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Distributions can be read from a local directory by using the file:// URL scheme." + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "Torch Install Mirror", + "tooltip": "Pip install mirror for pytorch" + }, "Comfy-Desktop_WindowStyle": { "name": "Window Style", "tooltip": "Custom: Replace the system title bar with ComfyUI's Top menu", diff --git a/src/locales/fr/main.json b/src/locales/fr/main.json index c867d66eb..5b0ca9602 100644 --- a/src/locales/fr/main.json +++ b/src/locales/fr/main.json @@ -220,6 +220,7 @@ "allowMetricsDescription": "Aidez à améliorer ComfyUI en envoyant des métriques d'utilisation anonymes. Aucune information personnelle ou contenu de flux de travail ne sera collecté.", "autoUpdate": "Mises à jour automatiques", "autoUpdateDescription": "Téléchargez et installez automatiquement les mises à jour lorsqu'elles deviennent disponibles. Vous serez toujours informé avant l'installation des mises à jour.", + "checkingMirrors": "Vérification de l'accès réseau aux miroirs python...", "dataCollectionDialog": { "collect": { "errorReports": "Message d'erreur et trace de la pile", @@ -239,7 +240,12 @@ }, "errorUpdatingConsent": "Erreur de mise à jour du consentement", "errorUpdatingConsentDetail": "Échec de la mise à jour des paramètres de consentement aux métriques", - "learnMoreAboutData": "En savoir plus sur la collecte de données" + "learnMoreAboutData": "En savoir plus sur la collecte de données", + "mirrorSettings": "Paramètres du Miroir", + "mirrorsReachable": "L'accès réseau aux miroirs python est bon", + "mirrorsUnreachable": "L'accès au réseau à certains miroirs python est mauvais", + "pypiMirrorPlaceholder": "Entrez l'URL du miroir PyPI", + "pythonMirrorPlaceholder": "Entrez l'URL du miroir Python" }, "systemLocations": "Emplacements système", "unhandledError": "Erreur inconnue", @@ -634,6 +640,7 @@ "Settings": "Paramètres", "Sidebar": "Barre Latérale", "Tree Explorer": "Explorateur d'Arbre", + "UV": "UV", "Validation": "Validation", "Window": "Fenêtre", "Workflow": "Flux de Travail" diff --git a/src/locales/fr/settings.json b/src/locales/fr/settings.json index c0e50351c..a82437b3c 100644 --- a/src/locales/fr/settings.json +++ b/src/locales/fr/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "Envoyer des métriques d'utilisation anonymes" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Miroir d'installation Pypi", + "tooltip": "Miroir d'installation pip par défaut" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Miroir d'installation Python", + "tooltip": "Les installations Python gérées sont téléchargées depuis le projet Astral python-build-standalone. Cette variable peut être définie sur une URL de miroir pour utiliser une source différente pour les installations Python. L'URL fournie remplacera https://github.com/astral-sh/python-build-standalone/releases/download dans, par exemple, https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Les distributions peuvent être lues à partir d'un répertoire local en utilisant le schéma d'URL file://." + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "Miroir d'installation Torch", + "tooltip": "Miroir d'installation Pip pour pytorch" + }, "Comfy-Desktop_WindowStyle": { "name": "Style de fenêtre", "options": { diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index 945382a74..fadfae585 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -220,6 +220,7 @@ "allowMetricsDescription": "匿名の使用状況メトリクスを送信してComfyUIを改善します。個人情報やワークフローの内容は収集されません。", "autoUpdate": "自動更新", "autoUpdateDescription": "更新が利用可能になると、自動的にダウンロードおよびインストールを行います。インストール前に通知が表示されます。", + "checkingMirrors": "Pythonミラーへのネットワークアクセスを確認中...", "dataCollectionDialog": { "collect": { "errorReports": "エラーメッセージとスタックトレース", @@ -239,7 +240,12 @@ }, "errorUpdatingConsent": "同意の更新エラー", "errorUpdatingConsentDetail": "メトリクスの同意設定の更新に失敗しました", - "learnMoreAboutData": "データ収集の詳細を見る" + "learnMoreAboutData": "データ収集の詳細を見る", + "mirrorSettings": "ミラー設定", + "mirrorsReachable": "Pythonミラーへのネットワークアクセスは良好です", + "mirrorsUnreachable": "一部のpythonミラーへのネットワークアクセスが悪い", + "pypiMirrorPlaceholder": "PyPIミラーURLを入力してください", + "pythonMirrorPlaceholder": "PythonミラーURLを入力してください" }, "systemLocations": "システムの場所", "unhandledError": "未知のエラー", @@ -634,6 +640,7 @@ "Settings": "設定", "Sidebar": "サイドバー", "Tree Explorer": "ツリーエクスプローラー", + "UV": "UV", "Validation": "検証", "Window": "ウィンドウ", "Workflow": "ワークフロー" diff --git a/src/locales/ja/settings.json b/src/locales/ja/settings.json index 0203f5150..61ce7192f 100644 --- a/src/locales/ja/settings.json +++ b/src/locales/ja/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "匿名の使用統計を送信する" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Pypi インストールミラー", + "tooltip": "デフォルトの pip インストールミラー" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Python Install Mirror", + "tooltip": "管理されたPythonのインストールは、Astral python-build-standaloneプロジェクトからダウンロードされます。この変数は、Pythonのインストールのための異なるソースを使用するためのミラーURLに設定することができます。提供されたURLは、例えば、https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gzの中でhttps://github.com/astral-sh/python-build-standalone/releases/downloadを置き換えます。ディストリビューションは、file:// URLスキームを使用してローカルディレクトリから読み取ることができます。" + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "Torch Install Mirror", + "tooltip": "pytorchのpipインストールミラー" + }, "Comfy-Desktop_WindowStyle": { "name": "ウィンドウスタイル", "options": { diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index 854ce3b21..418335702 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -220,6 +220,7 @@ "allowMetricsDescription": "익명의 사용 통계를 보내 ComfyUI를 개선하는 데 도움을 줍니다. 개인 정보나 워크플로 내용은 수집되지 않습니다.", "autoUpdate": "자동 업데이트", "autoUpdateDescription": "업데이트가 가능해지면 자동으로 다운로드하고 설치합니다. 업데이트가 설치되기 전에 항상 알림을 받습니다.", + "checkingMirrors": "파이썬 미러에 대한 네트워크 액세스 확인 중...", "dataCollectionDialog": { "collect": { "errorReports": "오류 메시지 및 스택 추적", @@ -239,7 +240,12 @@ }, "errorUpdatingConsent": "데이터 수집 동의 설정 업데이트 오류", "errorUpdatingConsentDetail": "데이터 수집 동의 설정 업데이트에 실패했습니다", - "learnMoreAboutData": "데이터 수집에 대해 더 알아보기" + "learnMoreAboutData": "데이터 수집에 대해 더 알아보기", + "mirrorSettings": "미러 설정", + "mirrorsReachable": "파이썬 미러에 대한 네트워크 액세스가 좋습니다", + "mirrorsUnreachable": "일부 파이썬 미러에 대한 네트워크 접근이 나쁩니다", + "pypiMirrorPlaceholder": "PyPI 미러 URL 입력", + "pythonMirrorPlaceholder": "Python 미러 URL 입력" }, "systemLocations": "시스템 위치", "unhandledError": "알 수 없는 오류", @@ -634,6 +640,7 @@ "Settings": "설정", "Sidebar": "사이드바", "Tree Explorer": "트리 탐색기", + "UV": "UV", "Validation": "검증", "Window": "창", "Workflow": "워크플로" diff --git a/src/locales/ko/settings.json b/src/locales/ko/settings.json index 8fde8be96..ea55dee6a 100644 --- a/src/locales/ko/settings.json +++ b/src/locales/ko/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "익명 사용 통계 보내기" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Pypi 설치 미러", + "tooltip": "기본 pip 설치 미러" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Python 설치 미러", + "tooltip": "관리되는 Python 설치파일은 Astral python-build-standalone 프로젝트에서 다운로드됩니다. 이 변수는 Python 설치파일의 다른 출처를 사용하기 위해 미러 URL로 설정할 수 있습니다. 제공된 URL은 예를 들어, https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz에서 https://github.com/astral-sh/python-build-standalone/releases/download를 대체합니다. 배포판은 file:// URL 스키마를 사용하여 로컬 디렉토리에서 읽을 수 있습니다." + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "토치 설치 미러", + "tooltip": "pytorch를 위한 Pip 설치 미러" + }, "Comfy-Desktop_WindowStyle": { "name": "창 스타일", "options": { diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index e2add40fd..de91161ec 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -220,6 +220,7 @@ "allowMetricsDescription": "Помогите улучшить ComfyUI, отправляя анонимные метрики использования. Личная информация или содержание рабочего процесса не будут собираться.", "autoUpdate": "Автоматические обновления", "autoUpdateDescription": "Автоматически загружать и устанавливать обновления, когда они становятся доступными. Вы всегда будете уведомлены перед установкой обновлений.", + "checkingMirrors": "Проверка доступа к зеркалам python по сети...", "dataCollectionDialog": { "collect": { "errorReports": "Сообщение об ошибке и трассировка стека", @@ -239,7 +240,12 @@ }, "errorUpdatingConsent": "Ошибка обновления согласия", "errorUpdatingConsentDetail": "Не удалось обновить настройки согласия на метрики", - "learnMoreAboutData": "Узнать больше о сборе данных" + "learnMoreAboutData": "Узнать больше о сборе данных", + "mirrorSettings": "Настройки зеркала", + "mirrorsReachable": "Сетевой доступ к зеркалам python хороший", + "mirrorsUnreachable": "Сетевой доступ к некоторым зеркалам python плохой", + "pypiMirrorPlaceholder": "Введите URL-зеркало PyPI", + "pythonMirrorPlaceholder": "Введите URL-зеркало Python" }, "systemLocations": "Системные места", "unhandledError": "Неизвестная ошибка", @@ -634,6 +640,7 @@ "Settings": "Настройки", "Sidebar": "Боковая панель", "Tree Explorer": "Дерево проводника", + "UV": "UV", "Validation": "Валидация", "Window": "Окно", "Workflow": "Рабочий процесс" diff --git a/src/locales/ru/settings.json b/src/locales/ru/settings.json index 659060a8d..69a085d9a 100644 --- a/src/locales/ru/settings.json +++ b/src/locales/ru/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "Отправлять анонимную статистику использования" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Pypi Установить Зеркало", + "tooltip": "Зеркало установки pip по умолчанию" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Зеркало для установки Python", + "tooltip": "Управляемые установки Python загружаются из проекта Astral python-build-standalone. Эта переменная может быть установлена на URL-адрес зеркала для использования другого источника для установок Python. Предоставленный URL заменит https://github.com/astral-sh/python-build-standalone/releases/download в, например, https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Дистрибутивы могут быть прочитаны из локального каталога, используя схему URL file://." + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "Установочное Зеркало Torch", + "tooltip": "Зеркало для установки pip для pytorch" + }, "Comfy-Desktop_WindowStyle": { "name": "Стиль окна", "options": { diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index 0c563d102..6e8da9cd7 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -220,6 +220,7 @@ "allowMetricsDescription": "通过发送匿名使用情况指标来帮助改进ComfyUI。不会收集任何个人信息或工作流内容。", "autoUpdate": "自动更新", "autoUpdateDescription": "更新可用时自动更新。您将在安装更新之前收到通知。", + "checkingMirrors": "正在检查到Python镜像的网络访问...", "dataCollectionDialog": { "collect": { "errorReports": "错误报告和堆栈跟踪", @@ -239,7 +240,12 @@ }, "errorUpdatingConsent": "更新同意错误", "errorUpdatingConsentDetail": "无法更新度量同意设置", - "learnMoreAboutData": "了解更多关于数据收集的信息" + "learnMoreAboutData": "了解更多关于数据收集的信息", + "mirrorSettings": "镜像设置", + "mirrorsReachable": "到Python镜像的网络访问良好", + "mirrorsUnreachable": "对某些python镜像的网络访问不佳", + "pypiMirrorPlaceholder": "输入PyPI镜像URL", + "pythonMirrorPlaceholder": "输入Python镜像URL" }, "systemLocations": "系统位置", "unhandledError": "未知错误", @@ -634,6 +640,7 @@ "Settings": "设置", "Sidebar": "侧边栏", "Tree Explorer": "树形浏览器", + "UV": "UV", "Validation": "验证", "Window": "窗口", "Workflow": "工作流" diff --git a/src/locales/zh/settings.json b/src/locales/zh/settings.json index d558f4a6d..6f1d16fbd 100644 --- a/src/locales/zh/settings.json +++ b/src/locales/zh/settings.json @@ -5,6 +5,18 @@ "Comfy-Desktop_SendStatistics": { "name": "发送匿名使用情况统计" }, + "Comfy-Desktop_UV_PypiInstallMirror": { + "name": "Pypi 安装镜像", + "tooltip": "默认 pip 安装镜像" + }, + "Comfy-Desktop_UV_PythonInstallMirror": { + "name": "Python安装镜像", + "tooltip": "管理的Python安装包从Astral python-build-standalone项目下载。此变量可以设置为镜像URL,以使用不同的Python安装源。提供的URL将替换https://github.com/astral-sh/python-build-standalone/releases/download,例如,在https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz中。可以通过使用file:// URL方案从本地目录读取分发包。" + }, + "Comfy-Desktop_UV_TorchInstallMirror": { + "name": "Torch安装镜像", + "tooltip": "用于pytorch的Pip安装镜像" + }, "Comfy-Desktop_WindowStyle": { "name": "窗口样式", "options": { diff --git a/src/utils/validationUtil.ts b/src/utils/validationUtil.ts new file mode 100644 index 000000000..a0b55ffe7 --- /dev/null +++ b/src/utils/validationUtil.ts @@ -0,0 +1,19 @@ +export enum ValidationState { + IDLE = 'IDLE', + LOADING = 'LOADING', + VALID = 'VALID', + INVALID = 'INVALID' +} + +export const mergeValidationStates = (states: ValidationState[]) => { + if (states.some((state) => state === ValidationState.INVALID)) { + return ValidationState.INVALID + } + if (states.some((state) => state === ValidationState.LOADING)) { + return ValidationState.LOADING + } + if (states.every((state) => state === ValidationState.VALID)) { + return ValidationState.VALID + } + return ValidationState.IDLE +} diff --git a/src/views/InstallView.vue b/src/views/InstallView.vue index 13cb7a9c4..c0c0754e7 100644 --- a/src/views/InstallView.vue +++ b/src/views/InstallView.vue @@ -81,7 +81,13 @@ v-model:autoUpdate="autoUpdate" v-model:allowMetrics="allowMetrics" /> -
+ +