ADD: KnobConfig & KeyConfig

This commit is contained in:
Robert Kossessa
2024-02-04 15:21:02 +01:00
parent d843f7c878
commit 7f85f9986e
8 changed files with 161 additions and 73 deletions

View File

@@ -19,6 +19,8 @@ import { createPinia, defineStore } from 'pinia'
import Axios from 'axios'
import schema from '@/data/profileSchema.json'
import Ajv from 'ajv'
import KnobConfig from '@/components/config/pages/KnobConfig.vue'
import KeyConfig from '@/components/config/pages/KeyConfig.vue'
const ajv = new Ajv()
@@ -29,11 +31,28 @@ export const useStore = defineStore('main', {
profiles: [],
selectedProfileId: null,
connected: false,
currentConfigPage: 'knob',
}
},
getters: {
profileIds: (state) => state.profiles.map(p => p.id),
selectedProfile: (state) => state.profiles.find(p => p.id === state.selectedProfileId),
currentConfigComponent: (state) => {
switch (state.currentConfigPage) {
case 'knob':
return KnobConfig
case 'a':
return KeyConfig
case 'b':
return KeyConfig
case 'c':
return KeyConfig
case 'd':
return KeyConfig
default:
return KnobConfig
}
},
},
actions: {
selectProfile(id) {
@@ -110,6 +129,9 @@ export const useStore = defineStore('main', {
}
return id
},
setCurrentConfigPage(page) {
this.currentConfigPage = page
},
},
})