| 1 | <template> |
| 2 | <ConfigSection title="Authentication" :readonly="readonly"> |
| 3 | <template v-if="['http', 'tcpmux'].includes(form.type)"> |
| 4 | <div class="field-row three-col"> |
| 5 | <ConfigField label="HTTP User" type="text" v-model="form.httpUser" :readonly="readonly" /> |
| 6 | <ConfigField label="HTTP Password" type="password" v-model="form.httpPassword" :readonly="readonly" /> |
| 7 | <ConfigField label="Route By HTTP User" type="text" v-model="form.routeByHTTPUser" :readonly="readonly" /> |
| 8 | </div> |
| 9 | </template> |
| 10 | <template v-if="['stcp', 'sudp', 'xtcp'].includes(form.type)"> |
| 11 | <div class="field-row two-col"> |
| 12 | <ConfigField label="Secret Key" type="password" v-model="form.secretKey" prop="secretKey" :readonly="readonly" /> |
| 13 | <ConfigField label="Allow Users" type="tags" v-model="form.allowUsers" placeholder="username" :readonly="readonly" /> |
| 14 | </div> |
| 15 | </template> |
| 16 | </ConfigSection> |
| 17 | </template> |
| 18 | |
| 19 | <script setup lang="ts"> |
| 20 | import { computed } from 'vue' |
| 21 | import type { ProxyFormData } from '../../types' |
| 22 | import ConfigSection from '../ConfigSection.vue' |
| 23 | import ConfigField from '../ConfigField.vue' |
| 24 | |
| 25 | const props = withDefaults(defineProps<{ |
| 26 | modelValue: ProxyFormData |
| 27 | readonly?: boolean |
| 28 | }>(), { readonly: false }) |
| 29 | |
| 30 | const emit = defineEmits<{ 'update:modelValue': [value: ProxyFormData] }>() |
| 31 | |
| 32 | const form = computed({ |
| 33 | get: () => props.modelValue, |
| 34 | set: (val) => emit('update:modelValue', val), |
| 35 | }) |
| 36 | </script> |
| 37 | |
| 38 | <style scoped lang="scss"> |
| 39 | @use '@/assets/css/form-layout'; |
| 40 | </style> |