| 1 | <template> |
| 2 | <ConfigSection title="Transport" collapsible :readonly="readonly" |
| 3 | :has-value="form.useEncryption || form.useCompression || !!form.bandwidthLimit || (!!form.bandwidthLimitMode && form.bandwidthLimitMode !== 'client') || !!form.proxyProtocolVersion"> |
| 4 | <div class="field-row two-col"> |
| 5 | <ConfigField label="Use Encryption" type="switch" v-model="form.useEncryption" :readonly="readonly" /> |
| 6 | <ConfigField label="Use Compression" type="switch" v-model="form.useCompression" :readonly="readonly" /> |
| 7 | </div> |
| 8 | <div class="field-row three-col"> |
| 9 | <ConfigField label="Bandwidth Limit" type="text" v-model="form.bandwidthLimit" placeholder="1MB" tip="e.g., 1MB, 500KB" :readonly="readonly" /> |
| 10 | <ConfigField label="Bandwidth Limit Mode" type="select" v-model="form.bandwidthLimitMode" |
| 11 | :options="[{ label: 'Client', value: 'client' }, { label: 'Server', value: 'server' }]" :readonly="readonly" /> |
| 12 | <ConfigField label="Proxy Protocol Version" type="select" v-model="form.proxyProtocolVersion" |
| 13 | :options="[{ label: 'None', value: '' }, { label: 'v1', value: 'v1' }, { label: 'v2', value: 'v2' }]" :readonly="readonly" /> |
| 14 | </div> |
| 15 | </ConfigSection> |
| 16 | </template> |
| 17 | |
| 18 | <script setup lang="ts"> |
| 19 | import { computed } from 'vue' |
| 20 | import type { ProxyFormData } from '../../types' |
| 21 | import ConfigSection from '../ConfigSection.vue' |
| 22 | import ConfigField from '../ConfigField.vue' |
| 23 | |
| 24 | const props = withDefaults(defineProps<{ |
| 25 | modelValue: ProxyFormData |
| 26 | readonly?: boolean |
| 27 | }>(), { readonly: false }) |
| 28 | |
| 29 | const emit = defineEmits<{ 'update:modelValue': [value: ProxyFormData] }>() |
| 30 | |
| 31 | const form = computed({ |
| 32 | get: () => props.modelValue, |
| 33 | set: (val) => emit('update:modelValue', val), |
| 34 | }) |
| 35 | </script> |
| 36 | |
| 37 | <style scoped lang="scss"> |
| 38 | @use '@/assets/css/form-layout'; |
| 39 | </style> |