Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions src/components/helpcenter/HelpCenterMenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ import type { CSSProperties, Component } from 'vue'
import { useI18n } from 'vue-i18n'

import PuzzleIcon from '@/components/icons/PuzzleIcon.vue'
import { isCloud } from '@/platform/distribution/types'
import { useSettingStore } from '@/platform/settings/settingStore'
import type { ReleaseNote } from '@/platform/updates/common/releaseService'
import { useReleaseStore } from '@/platform/updates/common/releaseStore'
Expand Down Expand Up @@ -265,7 +266,7 @@ const moreMenuItem = computed(() =>
)

const menuItems = computed<MenuItem[]>(() => {
return [
const items: MenuItem[] = [
{
key: 'docs',
type: 'item',
Expand Down Expand Up @@ -305,8 +306,12 @@ const menuItems = computed<MenuItem[]>(() => {
void commandStore.execute('Comfy.ContactSupport')
emit('close')
}
},
{
}
]

// Extension manager - only in non-cloud distributions
if (!isCloud) {
items.push({
key: 'manager',
type: 'item',
icon: PuzzleIcon,
Expand All @@ -319,17 +324,20 @@ const menuItems = computed<MenuItem[]>(() => {
})
emit('close')
}
},
{
key: 'more',
type: 'item',
icon: '',
label: t('helpCenter.more'),
visible: hasVisibleMoreItems.value,
action: () => {}, // No action for more item
items: moreItems.value
}
]
})
}

items.push({
key: 'more',
type: 'item',
icon: '',
label: t('helpCenter.more'),
visible: hasVisibleMoreItems.value,
action: () => {}, // No action for more item
items: moreItems.value
})

return items
})

// Utility Functions
Expand Down Expand Up @@ -420,6 +428,9 @@ const formatReleaseDate = (dateString?: string): string => {
}

const shouldShowUpdateButton = (release: ReleaseNote): boolean => {
// Hide update buttons in cloud distribution
if (isCloud) return false

return (
releaseStore.shouldShowUpdateButton &&
release === releaseStore.recentReleases[0]
Expand Down
18 changes: 18 additions & 0 deletions src/platform/distribution/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Distribution types and compile-time constants for managing
* multi-distribution builds (Desktop, Localhost, Cloud)
*/

type Distribution = 'desktop' | 'localhost' | 'cloud'

declare global {
const __DISTRIBUTION__: Distribution
}

/** Current distribution - replaced at compile time */
const DISTRIBUTION: Distribution = __DISTRIBUTION__

/** Distribution type checks */
// const isDesktop = DISTRIBUTION === 'desktop'
// const isLocalhost = DISTRIBUTION === 'localhost'
export const isCloud = DISTRIBUTION === 'cloud'
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"src/types/**/*.d.ts",
"tailwind.config.ts",
"tests-ui/**/*",
"vite.config.mts",
"vitest.config.ts",
// "vitest.setup.ts",
]
Expand Down
8 changes: 7 additions & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const DISABLE_VUE_PLUGINS = process.env.DISABLE_VUE_PLUGINS === 'true'
const DEV_SERVER_COMFYUI_URL =
process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188'

const DISTRIBUTION = (process.env.DISTRIBUTION || 'localhost') as
| 'desktop'
| 'localhost'
| 'cloud'

export default defineConfig({
base: '',
server: {
Expand Down Expand Up @@ -195,7 +200,8 @@ export default defineConfig({
__SENTRY_DSN__: JSON.stringify(process.env.SENTRY_DSN || ''),
__ALGOLIA_APP_ID__: JSON.stringify(process.env.ALGOLIA_APP_ID || ''),
__ALGOLIA_API_KEY__: JSON.stringify(process.env.ALGOLIA_API_KEY || ''),
__USE_PROD_CONFIG__: process.env.USE_PROD_CONFIG === 'true'
__USE_PROD_CONFIG__: process.env.USE_PROD_CONFIG === 'true',
__DISTRIBUTION__: JSON.stringify(DISTRIBUTION)
},

resolve: {
Expand Down