|
@@ -13580,17 +13580,19 @@ function renderDHCPNetworks() {
|
|
|
tr.className = 'hover:bg-slate-800/40 transition text-xs';
|
|
tr.className = 'hover:bg-slate-800/40 transition text-xs';
|
|
|
|
|
|
|
|
const dnsStr = (n.dns_servers || []).join(', ') || '-';
|
|
const dnsStr = (n.dns_servers || []).join(', ') || '-';
|
|
|
- const ntpStr = (n.ntp_servers || []).join(', ') || '-';
|
|
|
|
|
|
|
+ const optionsChips = (n.dhcp_options || []).map(optId => {
|
|
|
|
|
+ const opt = (state.dhcpOptions || []).find(o => o.id === optId);
|
|
|
|
|
+ if (!opt) return '';
|
|
|
|
|
+ return `<span class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-cyan-300 border border-slate-700 inline-block mr-1 mb-0.5" title="${escapeHtml(opt.name)}: ${escapeHtml(opt.value)}">#${opt.code} ${escapeHtml(opt.name)}</span>`;
|
|
|
|
|
+ }).filter(Boolean).join('');
|
|
|
|
|
|
|
|
tr.innerHTML = `
|
|
tr.innerHTML = `
|
|
|
<td class="py-2.5 px-3 font-bold text-emerald-400 font-mono">${escapeHtml(n.address)}</td>
|
|
<td class="py-2.5 px-3 font-bold text-emerald-400 font-mono">${escapeHtml(n.address)}</td>
|
|
|
<td class="py-2.5 px-3 font-mono text-cyan-300 font-semibold">${escapeHtml(n.gateway || '-')}</td>
|
|
<td class="py-2.5 px-3 font-mono text-cyan-300 font-semibold">${escapeHtml(n.gateway || '-')}</td>
|
|
|
<td class="py-2.5 px-3 font-mono text-slate-300">${escapeHtml(n.netmask || '-')}</td>
|
|
<td class="py-2.5 px-3 font-mono text-slate-300">${escapeHtml(n.netmask || '-')}</td>
|
|
|
- <td class="py-2.5 px-3 font-mono text-slate-300 truncate max-w-[120px]" title="${escapeHtml(dnsStr)}">${escapeHtml(dnsStr)}</td>
|
|
|
|
|
|
|
+ <td class="py-2.5 px-3 font-mono text-slate-300 truncate max-w-[140px]" title="${escapeHtml(dnsStr)}">${escapeHtml(dnsStr)}</td>
|
|
|
<td class="py-2.5 px-3 font-mono text-slate-400">${escapeHtml(n.domain || '-')}</td>
|
|
<td class="py-2.5 px-3 font-mono text-slate-400">${escapeHtml(n.domain || '-')}</td>
|
|
|
- <td class="py-2.5 px-3 font-mono text-purple-300 truncate max-w-[120px]" title="${escapeHtml(ntpStr)}">${escapeHtml(ntpStr)}</td>
|
|
|
|
|
- <td class="py-2.5 px-3 font-mono text-amber-300">${escapeHtml(n.next_server || '-')}</td>
|
|
|
|
|
- <td class="py-2.5 px-3 font-mono text-slate-300">${escapeHtml(n.boot_file_name || '-')}</td>
|
|
|
|
|
|
|
+ <td class="py-2.5 px-3 font-mono">${optionsChips || '<span class="text-slate-600 font-sans">-</span>'}</td>
|
|
|
<td class="py-2.5 px-3 text-slate-400 italic truncate max-w-[120px]" title="${escapeHtml(n.comment || '')}">${escapeHtml(n.comment || '-')}</td>
|
|
<td class="py-2.5 px-3 text-slate-400 italic truncate max-w-[120px]" title="${escapeHtml(n.comment || '')}">${escapeHtml(n.comment || '-')}</td>
|
|
|
<td class="py-2.5 px-3 text-right space-x-1.5 font-sans whitespace-nowrap">
|
|
<td class="py-2.5 px-3 text-right space-x-1.5 font-sans whitespace-nowrap">
|
|
|
<button onclick="openEditDHCPNetworkModal('${n.id}')" class="text-xs text-slate-400 hover:text-white">Edit</button>
|
|
<button onclick="openEditDHCPNetworkModal('${n.id}')" class="text-xs text-slate-400 hover:text-white">Edit</button>
|
|
@@ -13838,10 +13840,6 @@ function openAddDHCPNetworkModal() {
|
|
|
document.getElementById('dhcp-network-modal-gateway').value = '192.168.88.1';
|
|
document.getElementById('dhcp-network-modal-gateway').value = '192.168.88.1';
|
|
|
document.getElementById('dhcp-network-modal-dns').value = '192.168.88.1, 1.1.1.1, 8.8.8.8';
|
|
document.getElementById('dhcp-network-modal-dns').value = '192.168.88.1, 1.1.1.1, 8.8.8.8';
|
|
|
document.getElementById('dhcp-network-modal-domain').value = 'lan';
|
|
document.getElementById('dhcp-network-modal-domain').value = 'lan';
|
|
|
- document.getElementById('dhcp-network-modal-ntp').value = '192.168.88.1, time.cloudflare.com';
|
|
|
|
|
- document.getElementById('dhcp-network-modal-tftp').value = '';
|
|
|
|
|
- document.getElementById('dhcp-network-modal-bootfile').value = '';
|
|
|
|
|
- document.getElementById('dhcp-network-modal-wins').value = '';
|
|
|
|
|
document.getElementById('dhcp-network-modal-netmask').value = '';
|
|
document.getElementById('dhcp-network-modal-netmask').value = '';
|
|
|
document.getElementById('dhcp-network-modal-comment').value = '';
|
|
document.getElementById('dhcp-network-modal-comment').value = '';
|
|
|
|
|
|
|
@@ -13859,10 +13857,6 @@ function openEditDHCPNetworkModal(id) {
|
|
|
document.getElementById('dhcp-network-modal-gateway').value = n.gateway || '';
|
|
document.getElementById('dhcp-network-modal-gateway').value = n.gateway || '';
|
|
|
document.getElementById('dhcp-network-modal-dns').value = (n.dns_servers || []).join(', ');
|
|
document.getElementById('dhcp-network-modal-dns').value = (n.dns_servers || []).join(', ');
|
|
|
document.getElementById('dhcp-network-modal-domain').value = n.domain || '';
|
|
document.getElementById('dhcp-network-modal-domain').value = n.domain || '';
|
|
|
- document.getElementById('dhcp-network-modal-ntp').value = (n.ntp_servers || []).join(', ');
|
|
|
|
|
- document.getElementById('dhcp-network-modal-tftp').value = n.next_server || '';
|
|
|
|
|
- document.getElementById('dhcp-network-modal-bootfile').value = n.boot_file_name || '';
|
|
|
|
|
- document.getElementById('dhcp-network-modal-wins').value = (n.wins_servers || []).join(', ');
|
|
|
|
|
document.getElementById('dhcp-network-modal-netmask').value = n.netmask || '';
|
|
document.getElementById('dhcp-network-modal-netmask').value = n.netmask || '';
|
|
|
document.getElementById('dhcp-network-modal-comment').value = n.comment || '';
|
|
document.getElementById('dhcp-network-modal-comment').value = n.comment || '';
|
|
|
|
|
|
|
@@ -13904,10 +13898,6 @@ async function submitSaveDHCPNetwork(e) {
|
|
|
const gateway = document.getElementById('dhcp-network-modal-gateway').value.trim();
|
|
const gateway = document.getElementById('dhcp-network-modal-gateway').value.trim();
|
|
|
const dnsStr = document.getElementById('dhcp-network-modal-dns').value.trim();
|
|
const dnsStr = document.getElementById('dhcp-network-modal-dns').value.trim();
|
|
|
const domain = document.getElementById('dhcp-network-modal-domain').value.trim();
|
|
const domain = document.getElementById('dhcp-network-modal-domain').value.trim();
|
|
|
- const ntpStr = document.getElementById('dhcp-network-modal-ntp').value.trim();
|
|
|
|
|
- const tftp = document.getElementById('dhcp-network-modal-tftp').value.trim();
|
|
|
|
|
- const bootfile = document.getElementById('dhcp-network-modal-bootfile').value.trim();
|
|
|
|
|
- const winsStr = document.getElementById('dhcp-network-modal-wins').value.trim();
|
|
|
|
|
const netmask = document.getElementById('dhcp-network-modal-netmask').value.trim();
|
|
const netmask = document.getElementById('dhcp-network-modal-netmask').value.trim();
|
|
|
const comment = document.getElementById('dhcp-network-modal-comment').value.trim();
|
|
const comment = document.getElementById('dhcp-network-modal-comment').value.trim();
|
|
|
|
|
|
|
@@ -13915,8 +13905,6 @@ async function submitSaveDHCPNetwork(e) {
|
|
|
document.querySelectorAll('input[name="dhcp-net-opt"]:checked').forEach(cb => selectedOpts.push(cb.value));
|
|
document.querySelectorAll('input[name="dhcp-net-opt"]:checked').forEach(cb => selectedOpts.push(cb.value));
|
|
|
|
|
|
|
|
const dnsServers = dnsStr ? dnsStr.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
const dnsServers = dnsStr ? dnsStr.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
|
- const ntpServers = ntpStr ? ntpStr.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
|
|
|
- const winsServers = winsStr ? winsStr.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
const res = await fetch(`${API_BASE}/dhcp-server/networks`, {
|
|
const res = await fetch(`${API_BASE}/dhcp-server/networks`, {
|
|
@@ -13929,10 +13917,6 @@ async function submitSaveDHCPNetwork(e) {
|
|
|
netmask,
|
|
netmask,
|
|
|
dns_servers: dnsServers,
|
|
dns_servers: dnsServers,
|
|
|
domain,
|
|
domain,
|
|
|
- ntp_servers: ntpServers,
|
|
|
|
|
- next_server: tftp,
|
|
|
|
|
- boot_file_name: bootfile,
|
|
|
|
|
- wins_servers: winsServers,
|
|
|
|
|
dhcp_options: selectedOpts,
|
|
dhcp_options: selectedOpts,
|
|
|
comment
|
|
comment
|
|
|
})
|
|
})
|