1
1
<script setup>
2
- import Dropdown from " primevue/dropdown" ;
3
- import InputNumber from " primevue/inputnumber" ;
4
- import InputSlider from " @/components/InputSlider.vue" ;
5
- import InputSwitch from " primevue/inputswitch" ;
6
- import InputText from " primevue/inputtext" ;
2
+ import ModelParameter from " @/components/ModelParameter.vue" ;
3
+ import LayoutComponent from " @/components/LayoutComponent.vue" ;
7
4
import { useBackendStore } from " @/stores/backend" ;
8
5
9
6
const backend = useBackendStore ();
10
7
</script >
11
8
12
9
<template lang="pug">
13
10
template( v-if ="backend.current" )
14
- template( v-for ="input in backend.current.inputs" )
15
- .field.grid ( v-if ="input.visible!==false && input.id !== 'prompt' && input.id !== 'access_code' && input.type!=='image' && input.type!=='image_mask'" , :key ="input.id" : title= "input.description" class ="justify-content-center" )
16
- template( v-if ="input.type === 'int' || input.type === 'float'" )
17
- label( :for ="'input_' + input.id" class ="col-10 lg:col-4 justify-content-center lg:justify-content-end" )
18
- | {{ input.label }}
19
- span( class ="inline lg:hidden" ) : {{input.value}}
20
- label( class ="col-1 col-offset-1 hidden lg:block" )
21
- | {{input.value}}
22
- div( class ="col-12 lg:col-5" )
23
- InputSlider( :label ="input.label" v-model ="input.value" : min= "input.validation.min" : max= "input.validation.max" : step= "input.step ? input.step: 1" : title= "input.description" )
24
- template( v-if ="input.type == 'text' || input.type == 'choice' || input.type == 'bigint'" )
25
- label( :for ="'input_' + input.id" class ="col-12 lg:col-4 justify-content-center lg:justify-content-end" )
26
- | {{ input.label }}
27
- div( class ="col-12 lg:col-6 lg:col-offset-1" )
28
- template( v-if ="input.type == 'text'" )
29
- InputText.min-w-full ( type ="text" , :id ="'input_' + input.id" , v-model ="input.value" )
30
- template( v-if ="input.type == 'choice'" )
31
- Dropdown( v-model ="input.value" : options= "input.validation.options" class ="w-full lg:w-min" )
32
- template( v-if ="input.type == 'bigint'" )
33
- InputNumber.flex ( mode ="decimal" showButtons v-model ="input.value" : min= "input.validation.min" : max= "input.validation.max" : step= "input.step ? input.step: 1" : title= "input.description" : useGrouping= "false" )
34
- template( v-if ="input.type == 'boolean'" )
35
- label( :for ="'input_' + input.id" class ="col-6 lg:col-4 justify-content-center lg:justify-content-end" )
36
- | {{ input.label }}
37
- div( class ="col-6 lg:col-6 lg:col-offset-1" )
38
- template( v-if ="input.type == 'boolean'" )
39
- InputSwitch( v-model ="input.value" )
11
+ template( v-if ="backend.current.layout" )
12
+ template( v-for ="component in backend.current.layout" : key= "component.id" )
13
+ LayoutComponent( :component ="component" )
14
+ template( v-else )
15
+ template( v-for ="input in backend.current.inputs" : key= "input.id" )
16
+ ModelParameter( :input ="input" )
40
17
</template >
41
18
42
19
<style scoped>
@@ -49,10 +26,4 @@ template(v-if="backend.current")
49
26
:deep() .p-inputnumber-input {
50
27
padding : 0.15rem 0.75rem ;
51
28
}
52
- .field {
53
- margin-bottom : 0.5rem ;
54
- }
55
- .field > label {
56
- margin-bottom : 0 ;
57
- }
58
29
</style >
0 commit comments