feat: DNS_SERVER env var — pre-fills discovery UI, optional for scan

- DNS_SERVER env var configures the default DNS server for PTR lookups
- GET /api/discovery/config exposes it to the frontend
- DiscoveryModal fetches it on mount and pre-fills the field (editable)
- dns_server is now optional in ScanRequest (default empty string)
- PTR lookup is skipped when dns_server is empty — scan still proceeds
- Validator only runs when dns_server is non-empty
- .env.example, docker-compose.yml, READMEs (fr/en/es) updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 12:22:05 +02:00
parent c8607831a4
commit 806fe1caec
9 changed files with 43 additions and 16 deletions
+8 -5
View File
@@ -173,7 +173,7 @@
</template>
<script setup>
import { ref, computed } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { devicesApi, discoveryApi } from '../api.js'
import { t } from '../i18n.js'
@@ -194,6 +194,13 @@ const configError = ref('')
const importError = ref('')
const importing = ref(false)
onMounted(async () => {
try {
const resp = await discoveryApi.config()
dnsServer.value = resp.data.dns_server || ''
} catch { /* ignore — field stays empty */ }
})
const scanableVlans = computed(() => props.vlans.filter(v => v.cidr))
const existingIps = computed(() => {
@@ -246,10 +253,6 @@ function toggleAll(e) {
async function startScan() {
configError.value = ''
if (!dnsServer.value.trim()) {
configError.value = t('dnsRequired')
return
}
if (selectedVlanIds.value.length === 0) {
configError.value = t('selectVlan')
return