mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-22 05:17:32 +00:00
Compare commits
3 Commits
fetch-node
...
favicon-gr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
962afa35af | ||
|
|
05534184a6 | ||
|
|
a0a00bacdd |
@@ -1,23 +1,41 @@
|
||||
import { useFavicon } from '@vueuse/core'
|
||||
import { watch } from 'vue'
|
||||
import { type WatchHandle, ref, watch } from 'vue'
|
||||
|
||||
import { useExecutionStore } from '@/stores/executionStore'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
|
||||
export const useProgressFavicon = () => {
|
||||
const defaultFavicon = '/assets/images/favicon_progress_16x16/frame_9.png'
|
||||
const favicon = useFavicon(defaultFavicon)
|
||||
const executionStore = useExecutionStore()
|
||||
const settingsStore = useSettingStore()
|
||||
const totalFrames = 10
|
||||
|
||||
watch(
|
||||
[() => executionStore.executionProgress, () => executionStore.isIdle],
|
||||
([progress, isIdle]) => {
|
||||
if (isIdle) {
|
||||
favicon.value = defaultFavicon
|
||||
} else {
|
||||
const frame = Math.floor(progress * totalFrames)
|
||||
favicon.value = `/assets/images/favicon_progress_16x16/frame_${frame}.png`
|
||||
const watchHandle = ref<WatchHandle>()
|
||||
|
||||
function watchProgress() {
|
||||
watchHandle.value = watch(
|
||||
[() => executionStore.executionProgress, () => executionStore.isIdle],
|
||||
([progress, isIdle]) => {
|
||||
if (isIdle) {
|
||||
favicon.value = defaultFavicon
|
||||
} else {
|
||||
const frame = Math.floor(progress * totalFrames)
|
||||
favicon.value = `/assets/images/favicon_progress_16x16/frame_${frame}.png`
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => settingsStore.get('Comfy.Window.TabIconProgress'),
|
||||
(showProgress) => {
|
||||
if (showProgress) {
|
||||
watchProgress()
|
||||
} else {
|
||||
watchHandle.value?.stop()
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -828,5 +828,14 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
versionAdded: '1.19.1'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Window.TabIconProgress',
|
||||
name: 'Show progress in browser tab icon (favicon)',
|
||||
tooltip:
|
||||
'Updates the browser tab icon to show the progress of the current task.',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
versionAdded: '1.20.0'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
"after": "after"
|
||||
}
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "Show progress in browser tab icon (favicon)",
|
||||
"tooltip": "Updates the browser tab icon to show the progress of the current task."
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "Show confirmation when closing window"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "Controla cuándo se actualizan los valores del widget (aleatorizar/incrementar/decrementar), ya sea antes de que se encole el aviso o después."
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "Mostrar progreso en el icono de la pestaña del navegador (favicon)",
|
||||
"tooltip": "Actualiza el icono de la pestaña del navegador para mostrar el progreso de la tarea actual."
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "Mostrar confirmación al cerrar la ventana"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "Contrôle quand les valeurs du widget sont mises à jour (randomize/increment/decrement), soit avant que l'invite ne soit mise en file d'attente, soit après."
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "Afficher la progression dans l’icône d’onglet du navigateur (favicon)",
|
||||
"tooltip": "Met à jour l’icône de l’onglet du navigateur pour afficher la progression de la tâche en cours."
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "Afficher une confirmation lors de la fermeture de la fenêtre"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "ウィジェットの値が更新されるタイミングを制御します(ランダム化/インクリメント/デクリメント)、プロンプトがキューに入れられる前または後のいずれかです。"
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "ブラウザータブアイコン(ファビコン)に進行状況を表示",
|
||||
"tooltip": "現在のタスクの進行状況をブラウザータブのアイコンに表示します。"
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "ウィンドウを閉じるときに確認を表示"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "위젯 값이 업데이트되는 시점을 제어합니다 (무작위화/증가/감소), 프롬프트가 큐에 추가되기 전 또는 후입니다."
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "브라우저 탭 아이콘(파비콘)에 진행 상황 표시",
|
||||
"tooltip": "현재 작업의 진행 상황을 브라우저 탭 아이콘에 표시합니다."
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "창 닫을 때 확인 표시"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "Управляет тем, когда обновляются значения виджета (случайные/увеличение/уменьшение), либо до того, как запрос будет поставлен в очередь, либо после."
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "Показывать прогресс в значке вкладки браузера (favicon)",
|
||||
"tooltip": "Обновляет значок вкладки браузера, чтобы показывать прогресс текущей задачи."
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "Показать подтверждение при закрытии окна"
|
||||
},
|
||||
|
||||
@@ -332,6 +332,10 @@
|
||||
},
|
||||
"tooltip": "控制组件值的更新时机(随机/增加/减少),可以在执行工作流之前或之后。"
|
||||
},
|
||||
"Comfy_Window_TabIconProgress": {
|
||||
"name": "在浏览器标签图标中显示进度",
|
||||
"tooltip": "更新浏览器标签图标以显示当前任务的进度。"
|
||||
},
|
||||
"Comfy_Window_UnloadConfirmation": {
|
||||
"name": "关闭窗口时显示确认"
|
||||
},
|
||||
|
||||
@@ -463,7 +463,8 @@ const zSettings = z.object({
|
||||
'main.sub.setting.name': z.any(),
|
||||
'single.setting': z.any(),
|
||||
'LiteGraph.Node.DefaultPadding': z.boolean(),
|
||||
'LiteGraph.Pointer.TrackpadGestures': z.boolean()
|
||||
'LiteGraph.Pointer.TrackpadGestures': z.boolean(),
|
||||
'Comfy.Window.TabIconProgress': z.boolean()
|
||||
})
|
||||
|
||||
export type EmbeddingsResponse = z.infer<typeof zEmbeddingsResponse>
|
||||
|
||||
Reference in New Issue
Block a user