Skip to content

Commit

Permalink
feat: #270 Improve error view (#1617)
Browse files Browse the repository at this point in the history
* feat: #270 Improve error view

Reverting change

Lint & Format

PR comments

Fixing typo

* nit

---------

Co-authored-by: Oto Ciulis <oto.ciulis@gmail.com>
Co-authored-by: huchenlei <huchenlei@proton.me>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent d5b8a55 commit c857e7d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ const messages = {
}
}
},
serverStart: {
reinstall: 'Reinstall',
reportIssue: 'Report Issue',
openLogs: 'Open Logs',
process: {
'initial-state': 'Loading...',
'python-setup': 'Setting up Python Environment...',
'starting-server': 'Starting ComfyUI server...',
ready: 'Finishing...',
error: 'Unable to start ComfyUI'
}
},
firstTimeUIMessage:
'This is the first time you use the new UI. Choose "Menu > Use New Menu > Disabled" to restore the old UI.',
download: 'Download',
Expand Down
38 changes: 33 additions & 5 deletions src/views/ServerStartView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,45 @@
<div
class="font-sans flex flex-col justify-center items-center h-screen m-0 text-neutral-300 bg-neutral-900 dark-theme pointer-events-auto"
>
<h2 class="text-2xl font-bold">{{ ProgressMessages[status] }}</h2>
<h2 class="text-2xl font-bold">{{ t(`serverStart.process.${status}`) }}</h2>
<div
v-if="status == ProgressStatus.ERROR"
class="flex items-center my-4 gap-2"
>
<Button
icon="pi pi-flag"
severity="secondary"
:label="t('serverStart.reportIssue')"
@click="reportIssue"
/>
<Button
icon="pi pi-file"
severity="secondary"
:label="t('serverStart.openLogs')"
@click="openLogs"
/>
<Button
icon="pi pi-refresh"
:label="t('serverStart.reinstall')"
@click="reinstall"
/>
</div>
<BaseTerminal @created="terminalCreated" />
</div>
</template>

<script setup lang="ts">
import Button from 'primevue/button'
import { ref, onMounted, Ref } from 'vue'
import BaseTerminal from '@/components/bottomPanel/tabs/terminal/BaseTerminal.vue'
import {
ProgressStatus,
ProgressMessages
} from '@comfyorg/comfyui-electron-types'
import { ProgressStatus } from '@comfyorg/comfyui-electron-types'
import { electronAPI } from '@/utils/envUtil'
import type { useTerminal } from '@/hooks/bottomPanelTabs/useTerminal'
import { Terminal } from '@xterm/xterm'
import { useI18n } from 'vue-i18n'
const electron = electronAPI()
const { t } = useI18n()
const status = ref<ProgressStatus>(ProgressStatus.INITIAL_STATE)
let xterm: Terminal | undefined
Expand All @@ -44,6 +66,12 @@ const terminalCreated = (
terminal.options.cursorInactiveStyle = 'block'
}
const reinstall = () => electron.reinstall()
const reportIssue = () => {
window.open('https://forum.comfy.org/c/v1-feedback/', '_blank')
}
const openLogs = () => electron.openLogsFolder()
onMounted(() => {
electron.sendReady()
electron.onProgressUpdate(updateProgress)
Expand Down

0 comments on commit c857e7d

Please sign in to comment.