Line data Source code
1 : <template>
2 : <TextTooltip
3 0 : v-if="hasDeployments"
4 : :text="$t('deploymentSwitcher.manageDeploymentsTooltip')"
5 : side="right"
6 : >
7 : <MenuItem as-child :class="switcherItemClass">
8 : <a
9 : :href="buildsUrl"
10 : target="_blank"
11 : rel="noopener noreferrer"
12 : class="text-foreground no-underline"
13 : data-testid="deployment-switcher-builds"
14 : >
15 : <i
16 : class="icon-[lucide--arrow-up-right] size-3.5 text-muted-foreground"
17 : aria-hidden="true"
18 : />
19 : {{ $t('deploymentSwitcher.manageDeployments') }}
20 : </a>
21 : </MenuItem>
22 : </TextTooltip>
23 : <MenuItem
24 : v-else
25 : :class="switcherItemClass"
26 : data-testid="deployment-switcher-create"
27 : @select="emit('createCustomDeployment')"
28 : >
29 : <i
30 : class="icon-[lucide--plus] size-3.5 text-muted-foreground"
31 : aria-hidden="true"
32 : />
33 : {{ $t('deploymentSwitcher.createCustomDeployment') }}
34 : </MenuItem>
35 : </template>
36 :
37 : <script setup lang="ts">
38 : import MenuItem from '@comfyorg/design-system/menu/MenuItem'
39 : import TextTooltip from '@comfyorg/design-system/tooltip/TextTooltip'
40 : import { getComfyPlatformBaseUrl } from '@/config/comfyApi'
41 : import { switcherItemClass } from './deploymentSwitcherStyles'
42 :
43 : const { hasDeployments } = defineProps<{ hasDeployments: boolean }>()
44 0 : const emit = defineEmits<{ createCustomDeployment: [] }>()
45 0 : const buildsUrl = `${getComfyPlatformBaseUrl()}/profile/builds`
46 : </script>
|