[Electron] Terminal commands (#1531)

* Add live terminal output

* Fix scrolling

* Refactor loading

* Fallback to polling if endpoint fails

* Comment

* Move clientId to executionStore
Refactor types

* Remove polling

* wip terminal command input

* Refactor to use node-pty

* Hide tabs if not electron

* Lint fix

* ts fix

* Refactor tab components
This commit is contained in:
pythongosssss
2024-11-17 19:43:08 +00:00
committed by GitHub
parent 545a990365
commit b5f0c4bf73
9 changed files with 297 additions and 120 deletions

View File

@@ -2,8 +2,12 @@ import type { BottomPanelExtension } from '@/types/extensionTypes'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useCommandStore } from '@/stores/commandStore'
import { useIntegratedTerminalTab } from '@/hooks/bottomPanelTabs/integratedTerminalTab'
import {
useLogsTerminalTab,
useCommandTerminalTab
} from '@/hooks/bottomPanelTabs/terminalTabs'
import { ComfyExtension } from '@/types/comfy'
import { isElectron } from '@/utils/envUtil'
export const useBottomPanelStore = defineStore('bottomPanel', () => {
const bottomPanelVisible = ref(false)
@@ -49,7 +53,10 @@ export const useBottomPanelStore = defineStore('bottomPanel', () => {
}
const registerCoreBottomPanelTabs = () => {
registerBottomPanelTab(useIntegratedTerminalTab())
registerBottomPanelTab(useLogsTerminalTab())
if (isElectron()) {
registerBottomPanelTab(useCommandTerminalTab())
}
}
const registerExtensionBottomPanelTabs = (extension: ComfyExtension) => {