mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 09:00:05 +00:00
[Refactor] Remove old workarounds (#2242)
This commit is contained in:
@@ -130,12 +130,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { TorchDeviceType } from '@comfyorg/comfyui-electron-types'
|
||||
import Tag from 'primevue/tag'
|
||||
import ToggleSwitch from 'primevue/toggleswitch'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { TorchDeviceType, electronAPI } from '@/utils/envUtil'
|
||||
import { electronAPI } from '@/utils/envUtil'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
||||
|
||||
export type InstallOptions = Parameters<ElectronAPI['installComfyUI']>[0]
|
||||
export type TorchDeviceType = InstallOptions['device']
|
||||
import {
|
||||
ElectronAPI,
|
||||
ElectronContextMenuOptions
|
||||
} from '@comfyorg/comfyui-electron-types'
|
||||
|
||||
export function isElectron() {
|
||||
return 'electronAPI' in window && window['electronAPI'] !== undefined
|
||||
return 'electronAPI' in window && window.electronAPI !== undefined
|
||||
}
|
||||
|
||||
export function electronAPI() {
|
||||
return (window as any)['electronAPI'] as ElectronAPI
|
||||
return (window as any).electronAPI as ElectronAPI
|
||||
}
|
||||
|
||||
type NativeContextOptions = Parameters<ElectronAPI['showContextMenu']>[0]
|
||||
export function showNativeMenu(options?: NativeContextOptions) {
|
||||
export function showNativeMenu(options?: ElectronContextMenuOptions) {
|
||||
electronAPI()?.showContextMenu(options)
|
||||
}
|
||||
|
||||
@@ -103,6 +103,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
InstallOptions,
|
||||
TorchDeviceType
|
||||
} from '@comfyorg/comfyui-electron-types'
|
||||
import Button from 'primevue/button'
|
||||
import Step from 'primevue/step'
|
||||
import StepList from 'primevue/steplist'
|
||||
@@ -116,11 +120,7 @@ import DesktopSettingsConfiguration from '@/components/install/DesktopSettingsCo
|
||||
import GpuPicker from '@/components/install/GpuPicker.vue'
|
||||
import InstallLocationPicker from '@/components/install/InstallLocationPicker.vue'
|
||||
import MigrationPicker from '@/components/install/MigrationPicker.vue'
|
||||
import {
|
||||
type InstallOptions,
|
||||
type TorchDeviceType,
|
||||
electronAPI
|
||||
} from '@/utils/envUtil'
|
||||
import { electronAPI } from '@/utils/envUtil'
|
||||
import BaseViewTemplate from '@/views/templates/BaseViewTemplate.vue'
|
||||
|
||||
const device = ref<TorchDeviceType>(null)
|
||||
|
||||
Reference in New Issue
Block a user