|
142 | 142 | } |
143 | 143 | }, 300) |
144 | 144 |
|
| 145 | + const openInWeb = () => { |
| 146 | + const url = `https://bizyair.cn/community/models/${communityStore.TabSource}/${model.value?.id}?version=${currentVersion.value?.id}` |
| 147 | + window.open(url, '_blank') |
| 148 | + } |
| 149 | +
|
145 | 150 | const getShareCode = async () => { |
146 | 151 | if (!currentVersion.value) return |
147 | 152 | isLoading.value = true |
|
369 | 374 |
|
370 | 375 | const handleAddNode = async () => { |
371 | 376 | try { |
| 377 | + isLoading.value = true |
372 | 378 | const nodeTypes: Record<string, string> = { |
373 | 379 | LoRA: 'BizyAir_LoraLoader', |
374 | 380 | Controlnet: 'BizyAir_ControlNetLoader', |
|
415 | 421 |
|
416 | 422 | canvas.graph.add(loraLoaderNode) |
417 | 423 | communityStore.showDialog = false |
| 424 | + communityStore.showCommunityDetail = false |
418 | 425 | useToaster.success(t('community.detail.nodeAddedSuccessfully')) |
419 | 426 | } catch (error) { |
420 | 427 | console.error('Failed to add node:', error) |
421 | | - useToaster.error(t('community.detail.failedAddNode' + error)) |
| 428 | + useToaster.error(t('community.detail.failedAddNode') + error) |
| 429 | + } finally { |
| 430 | + isLoading.value = false |
422 | 431 | } |
423 | 432 | } |
424 | 433 |
|
|
700 | 709 | </svg> |
701 | 710 | </div> |
702 | 711 | </vTooltips> |
| 712 | + |
| 713 | + <vTooltips :tips="t('community.detail.open')"> |
| 714 | + <div |
| 715 | + @click="openInWeb" |
| 716 | + class="w-[48px] h-[48px] bg-[#4e4e4e] hover:bg-[#4e4e4e]/60 rounded-lg flex items-center justify-center cursor-pointer" |
| 717 | + > |
| 718 | + <svg |
| 719 | + xmlns="http://www.w3.org/2000/svg" |
| 720 | + width="18" |
| 721 | + height="18" |
| 722 | + viewBox="0 0 512 512" |
| 723 | + > |
| 724 | + <path |
| 725 | + fill="none" |
| 726 | + stroke="#FFF" |
| 727 | + stroke-linecap="round" |
| 728 | + stroke-linejoin="round" |
| 729 | + stroke-width="32" |
| 730 | + d="M384 224v184a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V168a40 40 0 0 1 40-40h167.48M336 64h112v112M224 288L440 72" |
| 731 | + /> |
| 732 | + </svg> |
| 733 | + </div> |
| 734 | + </vTooltips> |
| 735 | + |
703 | 736 | <Popover |
704 | 737 | v-if="['my', 'my_fork'].includes(communityStore.TabSource)" |
705 | 738 | class="bg-[#353535]" |
|
872 | 905 | <Button |
873 | 906 | v-if="model?.type !== 'Workflow'" |
874 | 907 | class="flex w-[170px] px-8 py-2 justify-center items-center gap-2 bg-[#F43F5E] hover:bg-[#F43F5E]/90 rounded-[6px]" |
| 908 | + :disabled="isLoading" |
875 | 909 | @click="handleAddNode" |
876 | 910 | > |
877 | 911 | <svg |
|
886 | 920 | stroke="#F9FAFB" |
887 | 921 | stroke-linecap="round" |
888 | 922 | stroke-linejoin="round" |
889 | | - /></svg |
890 | | - >{{ t('community.detail.addNode') }}</Button |
891 | | - > |
| 923 | + /> |
| 924 | + </svg> |
| 925 | + {{ t('community.detail.addNode') }} |
| 926 | + </Button> |
892 | 927 |
|
893 | 928 | <Button |
894 | 929 | v-if="model?.type === 'Workflow'" |
|
0 commit comments