Centralized management of external links (#4471)

Update the desktop guide links to make them platform and locale-aware

Edited by Terry:
Refactor external link management by introducing a centralized
useExternalLink composable with automatic locale and platform detection
for documentation URLs.

- Created useExternalLink composable - A new centralized utility for
managing all external links
- Dynamic docs URL builder (buildDocsUrl) - Automatically constructs
docs.comfy.org URLs with:
  - Locale detection (Chinese vs English)
  - Platform detection (macOS vs Windows for desktop)
  - Flexible path construction with options

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-4471-Add-platform-and-locale-aware-desktop-guide-URL-2346d73d3650815ea4a4dd64be575bbe)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Terry Jia <terryjia88@gmail.com>
This commit is contained in:
ComfyUI Wiki
2025-11-14 13:35:28 +08:00
committed by GitHub
parent 1a6913c466
commit b347dd1734
17 changed files with 361 additions and 83 deletions

View File

@@ -1,6 +1,7 @@
import { defineStore } from 'pinia'
import { computed } from 'vue'
import { useExternalLink } from '@/composables/useExternalLink'
import type { AboutPageBadge } from '@/types/comfy'
import { electronAPI, isElectron } from '@/utils/envUtil'
@@ -11,6 +12,7 @@ export const useAboutPanelStore = defineStore('aboutPanel', () => {
const frontendVersion = __COMFYUI_FRONTEND_VERSION__
const extensionStore = useExtensionStore()
const systemStatsStore = useSystemStatsStore()
const { staticUrls } = useExternalLink()
const coreVersion = computed(
() => systemStatsStore?.systemStats?.system?.comfyui_version ?? ''
)
@@ -24,20 +26,20 @@ export const useAboutPanelStore = defineStore('aboutPanel', () => {
? 'v' + electronAPI().getComfyUIVersion()
: coreVersion.value
}`,
url: 'https://github.com/comfyanonymous/ComfyUI',
url: staticUrls.github,
icon: 'pi pi-github'
},
{
label: `ComfyUI_frontend v${frontendVersion}`,
url: 'https://github.com/Comfy-Org/ComfyUI_frontend',
url: staticUrls.githubFrontend,
icon: 'pi pi-github'
},
{
label: 'Discord',
url: 'https://www.comfy.org/discord',
url: staticUrls.discord,
icon: 'pi pi-discord'
},
{ label: 'ComfyOrg', url: 'https://www.comfy.org/', icon: 'pi pi-globe' }
{ label: 'ComfyOrg', url: staticUrls.comfyOrg, icon: 'pi pi-globe' }
])
const allBadges = computed<AboutPageBadge[]>(() => [