Migrate settings dialog to Vue (#335)

* Basic setting dialog

* Add custom setting value render

* handle combo options

* Add input slider

* 100% width for select dropdown
This commit is contained in:
Chenlei Hu
2024-08-07 14:01:43 -04:00
committed by GitHub
parent eb1c66c90a
commit 02d7f91e9e
7 changed files with 217 additions and 5 deletions

View File

@@ -9,15 +9,18 @@
import { app } from '@/scripts/app'
import { ComfySettingsDialog } from '@/scripts/ui/settings'
import { SettingParams } from '@/types/settingTypes'
import { defineStore } from 'pinia'
interface State {
settingValues: Record<string, any>
settings: Record<string, SettingParams>
}
export const useSettingStore = defineStore('setting', {
state: (): State => ({
settingValues: {}
settingValues: {},
settings: {}
}),
actions: {
addSettings(settings: ComfySettingsDialog) {
@@ -25,6 +28,7 @@ export const useSettingStore = defineStore('setting', {
const value = settings.getSettingValue(id)
this.settingValues[id] = value
}
this.settings = settings.settingsParamLookup
},
set(key: string, value: any) {