sim creation wired to DB with ownership

This commit is contained in:
STEINNI
2026-06-05 20:27:57 +00:00
parent b122cf153e
commit d172e06611
4 changed files with 62 additions and 15 deletions
+8 -4
View File
@@ -8,8 +8,8 @@ class CreateSimView extends WindozDomContent {
async DOMContentLoaded(options) {
this.models = options.models
const components = ui.eicfy(this.el)
this.setupTriggers(components)
this.setupRefs(components)
this.models.keyframes.list('', null).then(data => data.payload).then(kflist => {
this.outputs.keyframesSelector.fillOptions(kflist.map(item => {
return({
@@ -18,12 +18,16 @@ class CreateSimView extends WindozDomContent {
})
}))
})
this.outputs.keyframesSelector.addEventListener('change', this.onChangeKeyframe.bind(this))
}
onChangeKeyframe(event) {
onCreateSim(comp, event) {
if(!this.outputs.keyframesSelector.value) return
// TODO: use selected keyframe for simulation creation
if(!this.outputs.simName.value) return
this.models.sims.create({
kfId: this.outputs.keyframesSelector.value,
simName: this.outputs.simName.value
}).then(data => ui.growl.append('Simulation created!','success',3000))
this.unload()
}
}