From 5a77c70a7e36ec50866a883077ca64c0a3d73306 Mon Sep 17 00:00:00 2001 From: Jukka Lampikoski Date: Wed, 11 Mar 2026 09:29:15 +0200 Subject: [PATCH] =?UTF-8?q?IPAM:=20VLAN-kentt=C3=A4=20takaisin=20vapaaksi?= =?UTF-8?q?=20numerokent=C3=A4ksi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropdown oli liian rajoittava — nyt VLAN-numeron voi kirjoittaa vapaasti lomakkeeseen verkkojen ja IP:iden kohdalla. Co-Authored-By: Claude Opus 4.6 --- index.html | 4 +--- script.js | 12 +----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 2adf6a7..18b2acc 100644 --- a/index.html +++ b/index.html @@ -1017,9 +1017,7 @@
- +
diff --git a/script.js b/script.js index 3079539..1485e9f 100644 --- a/script.js +++ b/script.js @@ -3209,14 +3209,6 @@ function vlanRefHtml(vlanId) { return `${vlanId}${label ? ` ${label}` : ''}`; } -// --- VLAN-dropdown populointi --- -function populateVlanDropdown(selectedVlanId) { - const sel = document.getElementById('ipam-form-vlan'); - const vlans = ipamData.filter(e => e.tyyppi === 'vlan').sort((a, b) => (a.vlan_id || 0) - (b.vlan_id || 0)); - sel.innerHTML = '' + - vlans.map(v => ``).join(''); -} - // --- Asiakas-dropdown populointi --- async function populateIpamCustomerDropdown(selectedName) { if (!customers || customers.length === 0) { @@ -3267,7 +3259,7 @@ async function editIpam(id) { document.getElementById('ipam-form-nimi').value = e.nimi || ''; document.getElementById('ipam-form-tila').value = e.tila || 'vapaa'; document.getElementById('ipam-form-lisatiedot').value = e.lisatiedot || ''; - populateVlanDropdown(e.vlan_id || ''); + document.getElementById('ipam-form-vlan').value = e.vlan_id || ''; await populateIpamCustomerDropdown(e.asiakas || ''); await loadIpamSitesDropdown(); document.getElementById('ipam-form-site').value = e.site_id || ''; @@ -3287,7 +3279,6 @@ document.getElementById('btn-add-ipam')?.addEventListener('click', async () => { document.getElementById('ipam-form-id').value = ''; document.getElementById('ipam-form').reset(); document.getElementById('ipam-form-tyyppi').value = 'subnet'; - populateVlanDropdown(''); await populateIpamCustomerDropdown(''); await loadIpamSitesDropdown(); document.getElementById('ipam-modal-title').textContent = 'Lisää verkko / IP'; @@ -3298,7 +3289,6 @@ document.getElementById('btn-add-vlan')?.addEventListener('click', async () => { document.getElementById('ipam-form-id').value = ''; document.getElementById('ipam-form').reset(); document.getElementById('ipam-form-tyyppi').value = 'vlan'; - populateVlanDropdown(''); await populateIpamCustomerDropdown(''); await loadIpamSitesDropdown(); document.getElementById('ipam-modal-title').textContent = 'Lisää VLAN';