| 1 | <template> |
| 2 | <ConfigSection title="Metadata" collapsible :readonly="readonly" :has-value="form.metadatas.length > 0 || form.annotations.length > 0"> |
| 3 | <ConfigField label="Metadatas" type="kv" v-model="form.metadatas" :readonly="readonly" /> |
| 4 | <ConfigField label="Annotations" type="kv" v-model="form.annotations" :readonly="readonly" /> |
| 5 | </ConfigSection> |
| 6 | </template> |
| 7 | |
| 8 | <script setup lang="ts"> |
| 9 | import { computed } from 'vue' |
| 10 | import type { ProxyFormData } from '../../types' |
| 11 | import ConfigSection from '../ConfigSection.vue' |
| 12 | import ConfigField from '../ConfigField.vue' |
| 13 | |
| 14 | const props = withDefaults(defineProps<{ |
| 15 | modelValue: ProxyFormData |
| 16 | readonly?: boolean |
| 17 | }>(), { readonly: false }) |
| 18 | |
| 19 | const emit = defineEmits<{ 'update:modelValue': [value: ProxyFormData] }>() |
| 20 | |
| 21 | const form = computed({ |
| 22 | get: () => props.modelValue, |
| 23 | set: (val) => emit('update:modelValue', val), |
| 24 | }) |
| 25 | </script> |
| 26 | |
| 27 | <style scoped lang="scss"> |
| 28 | @use '@/assets/css/form-layout'; |
| 29 | </style> |