Allow extension register custom topbar menu command (#982)

* Refactor command store

* Rename coreMenuStore to menuStore

* Extension API to register command

* Update README

* Add playwright test
This commit is contained in:
Chenlei Hu
2024-09-26 10:44:15 +09:00
committed by GitHub
parent a53f0ba4db
commit 3585cb69f5
11 changed files with 417 additions and 193 deletions

View File

@@ -36,7 +36,9 @@
icon="pi pi-stop"
severity="danger"
text
@click="() => commandStore.getCommand('Comfy.ClearPendingTasks')()"
@click="
() => commandStore.getCommandFunction('Comfy.ClearPendingTasks')()
"
v-tooltip.bottom="$t('sideToolbar.queueTab.clearPendingTasks')"
/>
<Button

View File

@@ -6,27 +6,33 @@
icon="pi pi-th-large"
v-tooltip="$t('sideToolbar.browseTemplates')"
text
@click="() => commandStore.getCommand('Comfy.BrowseTemplates')()"
@click="
() => commandStore.getCommandFunction('Comfy.BrowseTemplates')()
"
/>
<Button
class="browse-workflows-button"
icon="pi pi-folder-open"
v-tooltip="'Browse for an image or exported workflow'"
text
@click="() => commandStore.getCommand('Comfy.OpenWorkflow')()"
@click="() => commandStore.getCommandFunction('Comfy.OpenWorkflow')()"
/>
<Button
class="new-default-workflow-button"
icon="pi pi-code"
v-tooltip="'Load default workflow'"
text
@click="() => commandStore.getCommand('Comfy.LoadDefaultWorkflow')()"
@click="
() => commandStore.getCommandFunction('Comfy.LoadDefaultWorkflow')()
"
/>
<Button
class="new-blank-workflow-button"
icon="pi pi-plus"
v-tooltip="'Create a new blank workflow'"
@click="() => commandStore.getCommand('Comfy.NewBlankWorkflow')()"
@click="
() => commandStore.getCommandFunction('Comfy.NewBlankWorkflow')()
"
text
/>
</template>