mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-10 07:30:08 +00:00
## Summary Extracts desktop UI into apps/desktop-ui package with minimal changes. ## Changes - **What**: - Separates desktop-specific code into standalone package with independent Vite config, router, and i18n - Drastically simplifies the main app router by removing all desktop routes - Adds a some code duplication, most due to the existing design - Some duplication can be refactored to be *simpler* on either side - no need to split things by `isElectron()` - Rudimentary storybook support has been added - **Breaking**: Stacked PR for publishing must be merged before this PR makes it to stable core (but publishing _could_ be done manually) - #5915 - **Dependencies**: Takes full advantage of pnpm catalog. No additional dependencies added. ## Review Focus - Should be no changes to normal frontend operation - Scripts added to root package.json are acceptable - The duplication in this PR is copied as is, wherever possible. Any corrections or fix-ups beyond the scope of simply migrating the functionality as-is, can be addressed in later PRs. That said, if any changes are made, it instantly becomes more difficult to separate the duplicated code out into a shared utility. - Tracking issue to address concerns: #5925 ### i18n Fixing i18n is out of scope for this PR. It is a larger task that we should consider carefully and implement properly. Attempting to isolate the desktop i18n and duplicate the _current_ localisation scripts would be wasted energy.
72 lines
1.9 KiB
Vue
72 lines
1.9 KiB
Vue
<template>
|
|
<div :class="wrapperClass">
|
|
<div class="grid grid-rows-2 gap-8">
|
|
<!-- Top container: Logo -->
|
|
<div class="flex items-end justify-center">
|
|
<img
|
|
src="/assets/images/comfy-brand-mark.svg"
|
|
:alt="t('g.logoAlt')"
|
|
class="w-60"
|
|
/>
|
|
</div>
|
|
<!-- Bottom container: Progress and text -->
|
|
<div class="flex flex-col items-center justify-center gap-4">
|
|
<ProgressBar
|
|
v-if="!hideProgress"
|
|
:mode="progressMode"
|
|
:value="progressPercentage ?? 0"
|
|
:show-value="false"
|
|
class="w-90 h-2 mt-8"
|
|
:pt="{ value: { class: 'bg-brand-yellow' } }"
|
|
/>
|
|
<h1 v-if="title" class="font-inter font-bold text-3xl text-neutral-300">
|
|
{{ title }}
|
|
</h1>
|
|
<p v-if="statusText" class="text-lg text-neutral-400">
|
|
{{ statusText }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import ProgressBar from 'primevue/progressbar'
|
|
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const { t } = useI18n()
|
|
|
|
/** Props for the StartupDisplay component */
|
|
interface StartupDisplayProps {
|
|
/** Progress: 0-100 for determinate, undefined for indeterminate */
|
|
progressPercentage?: number
|
|
/** Main title text */
|
|
title?: string
|
|
/** Status text shown below the title */
|
|
statusText?: string
|
|
/** Hide the progress bar */
|
|
hideProgress?: boolean
|
|
/** Use full screen wrapper (default: true) */
|
|
fullScreen?: boolean
|
|
}
|
|
|
|
const {
|
|
progressPercentage,
|
|
title,
|
|
statusText,
|
|
hideProgress = false,
|
|
fullScreen = true
|
|
} = defineProps<StartupDisplayProps>()
|
|
|
|
const progressMode = computed(() =>
|
|
progressPercentage === undefined ? 'indeterminate' : 'determinate'
|
|
)
|
|
|
|
const wrapperClass = computed(() =>
|
|
fullScreen
|
|
? 'flex items-center justify-center min-h-screen'
|
|
: 'flex items-center justify-center'
|
|
)
|
|
</script>
|