Allow editing existing records on admin/dns_records.php

admin/dns_records.php should include an edit button, rather than requiring me to delete and re-add to fix/update records

(also a duplicate button for faster entry, once edit is there!)

Quick hack to copy the domain and IP back to the input fields if a row is clicked.

This would be easier/cleaner if there was a way to distinguish a header row from a data row.

var domainInput = document.querySelector('#domain');
var addressInput = document.querySelector('#ip');
document.querySelectorAll("tr[role=row]").forEach(
    row => {
        if (row.children[0].tagName == "TH") {
            console.log("skipped header");
            return;
        }
        console.log("got tr");
        row.addEventListener('click', 
            function(e) {
                domainInput.value = row.children[0].textContent;
                addressInput.value = row.children[1].textContent;
            })
    });

While this is not really fulfilling your request, let me mention that in the new Pi-hole v6.0 (currently in late beta phase), you have an option to modify DNS records directly in a HOSTS-like format (All settings menu):


Screenshot from 2024-01-28 22-14-48

The latter - at the very least - allows easy copy-paste mass editing of records.