mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
feat: add TopbarBadge interface and implement cloud badge in extension
This commit is contained in:
15
src/extensions/core/cloudBadge.ts
Normal file
15
src/extensions/core/cloudBadge.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isProductionEnvironment } from '@/config/environment'
|
||||
import { useExtensionService } from '@/services/extensionService'
|
||||
|
||||
useExtensionService().registerExtension({
|
||||
name: 'Comfy.CloudBadge',
|
||||
// Only show badge when running in cloud environment
|
||||
topbarBadges: isProductionEnvironment()
|
||||
? [
|
||||
{
|
||||
label: 'BETA',
|
||||
text: 'Comfy Cloud'
|
||||
}
|
||||
]
|
||||
: undefined
|
||||
})
|
||||
@@ -1,4 +1,5 @@
|
||||
import './clipspace'
|
||||
import './cloudBadge'
|
||||
import './contextMenuFilter'
|
||||
import './dynamicPrompts'
|
||||
import './editAttention'
|
||||
|
||||
@@ -18,6 +18,14 @@ export interface AboutPageBadge {
|
||||
icon: string
|
||||
}
|
||||
|
||||
export interface TopbarBadge {
|
||||
text: string
|
||||
/**
|
||||
* Optional badge label (e.g., "BETA", "ALPHA", "NEW")
|
||||
*/
|
||||
label?: string
|
||||
}
|
||||
|
||||
type MenuCommandGroup = {
|
||||
/**
|
||||
* The path to the menu group.
|
||||
@@ -71,6 +79,10 @@ export interface ComfyExtension {
|
||||
* Badges to add to the about page
|
||||
*/
|
||||
aboutPageBadges?: AboutPageBadge[]
|
||||
/**
|
||||
* Badges to add to the topbar
|
||||
*/
|
||||
topbarBadges?: TopbarBadge[]
|
||||
/**
|
||||
* Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added
|
||||
* @param app The ComfyUI app instance
|
||||
|
||||
Reference in New Issue
Block a user