-
Notifications
You must be signed in to change notification settings - Fork 450
feat: add upgrade modal for model upload when private models disabled #7124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
62bd595
feat: add upgrade modal for model upload when private models disabled
luke-mino-altherr 615a700
feat: extend feature flags to read from remote config
luke-mino-altherr 0f1e4e8
Update src/scripts/api.ts
luke-mino-altherr 9a2f43a
refactor: improve i18n and security in upgrade modal components
luke-mino-altherr fb16f19
Apply suggestions from code review
luke-mino-altherr 75cabea
code review comments
luke-mino-altherr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: add upgrade modal for model upload when private models disabled
Add separate upgrade modal that displays when users without private models try to upload models, prompting them to upgrade their subscription. - Add upgrade modal with body, header, and footer components - Conditionally show upgrade or upload modal based on privateModelsEnabled flag - Integrate with subscription system via showSubscriptionDialog() - Add localization keys for upgrade messaging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Loading branch information
commit 62bd595a99a2df216c014e952eda9fd8aeecd43f
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/platform/assets/components/UploadModelUpgradeModal.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| <template> | ||
| <div | ||
| class="upload-model-upgrade-modal flex flex-col justify-between gap-6 p-4 pt-6 border-t-[1px] border-border-default" | ||
| > | ||
| <!-- Upgrade Content --> | ||
| <UploadModelUpgradeModalBody /> | ||
|
|
||
| <!-- Footer --> | ||
luke-mino-altherr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <UploadModelUpgradeModalFooter | ||
| @close="handleClose" | ||
| @subscribe="handleSubscribe" | ||
| /> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import UploadModelUpgradeModalBody from '@/platform/assets/components/UploadModelUpgradeModalBody.vue' | ||
| import UploadModelUpgradeModalFooter from '@/platform/assets/components/UploadModelUpgradeModalFooter.vue' | ||
| import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription' | ||
| import { useDialogStore } from '@/stores/dialogStore' | ||
|
|
||
| const dialogStore = useDialogStore() | ||
| const { showSubscriptionDialog } = useSubscription() | ||
|
|
||
| function handleClose() { | ||
| dialogStore.closeDialog({ key: 'upload-model-upgrade' }) | ||
| } | ||
|
|
||
| function handleSubscribe() { | ||
| showSubscriptionDialog() | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .upload-model-upgrade-modal { | ||
| width: 90vw; | ||
| max-width: 500px; | ||
| min-height: 200px; | ||
| } | ||
|
|
||
| @media (min-width: 640px) { | ||
| .upload-model-upgrade-modal { | ||
| width: auto; | ||
| min-width: 450px; | ||
| } | ||
| } | ||
| </style> | ||
11 changes: 11 additions & 0 deletions
11
src/platform/assets/components/UploadModelUpgradeModalBody.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <template> | ||
| <div | ||
| class="flex flex-1 flex-col items-center justify-center gap-6 text-base text-muted-foreground" | ||
| > | ||
| <p class="m-0 max-w-md"> | ||
| {{ $t('assetBrowser.upgradeFeatureDescription') }} | ||
| </p> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"></script> |
36 changes: 36 additions & 0 deletions
36
src/platform/assets/components/UploadModelUpgradeModalFooter.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <template> | ||
| <div class="flex justify-end gap-2 w-full"> | ||
| <span | ||
| class="text-muted-foreground mr-auto underline flex items-center gap-2" | ||
| > | ||
| <i class="icon-[lucide--circle-question-mark]" /> | ||
| <a | ||
| href="https://blog.comfy.org/p/comfy-cloud-new-features-and-pricing" | ||
| target="_blank" | ||
| class="text-muted-foreground" | ||
| >{{ $t('Learn more') }}</a | ||
| > | ||
| </span> | ||
| <TextButton | ||
| :label="$t('g.close')" | ||
| type="transparent" | ||
| size="md" | ||
| @click="emit('close')" | ||
| /> | ||
| <TextButton | ||
| :label="$t('Subscribe')" | ||
| type="secondary" | ||
| size="md" | ||
| @click="emit('subscribe')" | ||
| /> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import TextButton from '@/components/button/TextButton.vue' | ||
|
|
||
| const emit = defineEmits<{ | ||
| (e: 'close'): void | ||
| (e: 'subscribe'): void | ||
| }>() | ||
luke-mino-altherr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </script> | ||
5 changes: 5 additions & 0 deletions
5
src/platform/assets/components/UploadModelUpgradeModalHeader.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <template> | ||
| <div class="flex items-center gap-2 p-4 font-bold"> | ||
| <span>{{ $t('assetBrowser.upgradeToUnlockFeature') }}</span> | ||
| </div> | ||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.