-
Couldn't load subscription status.
- Fork 392
disable instant queue mode on cloud #6141
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
Changes from 1 commit
c495567
ba2299e
c924695
f7a96af
940bc52
0d7b223
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| showDelay: 600 | ||
| }" | ||
| class="comfyui-queue-button" | ||
| :label="activeQueueModeMenuItem.label" | ||
| :label="String(activeQueueModeMenuItem.label)" | ||
| severity="primary" | ||
| size="small" | ||
| :model="queueModeMenuItems" | ||
|
|
@@ -82,10 +82,12 @@ | |
| import { storeToRefs } from 'pinia' | ||
| import Button from 'primevue/button' | ||
| import ButtonGroup from 'primevue/buttongroup' | ||
| import type { MenuItem } from 'primevue/menuitem' | ||
DrJKL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import SplitButton from 'primevue/splitbutton' | ||
| import { computed } from 'vue' | ||
| import { useI18n } from 'vue-i18n' | ||
|
|
||
| import { isCloud } from '@/platform/distribution/types' | ||
DrJKL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import { useCommandStore } from '@/stores/commandStore' | ||
| import { | ||
| useQueuePendingTaskCountStore, | ||
|
|
@@ -100,32 +102,37 @@ const queueCountStore = storeToRefs(useQueuePendingTaskCountStore()) | |
| const { mode: queueMode } = storeToRefs(useQueueSettingsStore()) | ||
|
|
||
| const { t } = useI18n() | ||
| const queueModeMenuItemLookup = computed(() => ({ | ||
| disabled: { | ||
| key: 'disabled', | ||
| label: t('menu.run'), | ||
| tooltip: t('menu.disabledTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'disabled' | ||
| const queueModeMenuItemLookup = computed(() => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this computed? |
||
| const items: Record<string, MenuItem> = { | ||
| disabled: { | ||
| key: 'disabled', | ||
| label: t('menu.run'), | ||
| tooltip: t('menu.disabledTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'disabled' | ||
| } | ||
| }, | ||
| change: { | ||
| key: 'change', | ||
| label: `${t('menu.run')} (${t('menu.onChange')})`, | ||
| tooltip: t('menu.onChangeTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'change' | ||
| } | ||
| } | ||
| }, | ||
| instant: { | ||
| key: 'instant', | ||
| label: `${t('menu.run')} (${t('menu.instant')})`, | ||
| tooltip: t('menu.instantTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'instant' | ||
| } | ||
| }, | ||
| change: { | ||
| key: 'change', | ||
| label: `${t('menu.run')} (${t('menu.onChange')})`, | ||
| tooltip: t('menu.onChangeTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'change' | ||
| } | ||
| if (!isCloud) { | ||
christian-byrne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| items.instant = { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Completely optional but there is a way to do this inline |
||
| key: 'instant', | ||
| label: `${t('menu.run')} (${t('menu.instant')})`, | ||
| tooltip: t('menu.instantTooltip'), | ||
| command: () => { | ||
| queueMode.value = 'instant' | ||
| } | ||
| } | ||
| } | ||
| })) | ||
| return items | ||
| }) | ||
|
|
||
| const activeQueueModeMenuItem = computed( | ||
|
||
| () => queueModeMenuItemLookup.value[queueMode.value] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[quality] medium Priority
Issue: Unnecessary type coercion with String() wrapper
Context: The labels from MenuItem objects should already be strings from i18n translations
Suggestion: Remove String() wrapper or add proper typing if there's a specific type issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved type safety with nullish coalescing in c761174