Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Add Edit buttons to DHCP Leases page

    Scheduled Pinned Locked Moved 2.2 Snapshot Feedback and Problems - RETIRED
    5 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jeremy11one
      last edited by

      On the Status > DHCP Leases page, I can currently see my dynamic and static mappings, but I cannot edit them.  On the Services > DHCP Server page, there is an Edit button next to each Static Mapping.  I'd like for the DHCP Leases page to also have that button.

      Is there a reason that you leave a red "+" button next to the static mappings on the DHCP Leases page?  On the "firewall_rules.php?if=lan" page, disabled buttons are grayed out.  Not red.  Also, the tooltip doesn't work on the red buttons.

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        That is something I have also thought would be useful. I changed the non-functional red button to an Edit button and made it open the services_dhcp_edit page for the static entry concerned. It looks like the screen shot attached.
        Pull request is https://github.com/pfsense/pfsense/pull/1310
        This seems easy enough and minimal risk.
        I thought about putting the delete button there also - but that needs a bit of thinking about and opinions from others, since delete is a more dangerous thing, and the existing delete button on status_dhcp_leases is just for dynamic leases and just deletes a real-time entry - it does not make config changes.

        I guess this is similar in the IPv6 code, so if it is accepted I am also happy to make a matching change to status_dhcpv6_leases also.

        IMHO the management of static mappings from Services->DHCP needs to stay. Thousands of users will expect it find it in/through the Services menu.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • M
          mikeisfly
          last edited by

          Just my two cents,

          If we think about user management. Will putting and edit button on a page that is only meant for read only be an issue? I'm thinking of junior level engineers, I suspect not since it will only direct to the edit page and if you don't have access to that page then you will not be able to cause any harm. Just wanted to see what y'all think.

          1 Reply Last reply Reply Quote 0
          • P
            phil.davis
            last edited by

            I just tested that - added a user "junior" with Dashboard and Status DHCP Leases privs. They get the edit button for the lease, but when it is pressed they just get taken to their default page (in this case the Dashboard) because the code tried to go to the services_dhcp_edit page, but the user has no priv for that, so the code redirects to their default page.
            It works the same as it has been working when using the "+" to add a static mapping for one of the dynamic entries - I tried that also.
            So I think that is the way it is generally being designed to work for the few places on status pages that let you click to perform a change action. There could be a lot of extra coding effort put in to determine, when drawing up the status page, whether the user has enough priv to do the relevant change action, and only display the button if they have enough priv. If someone cared enough they might do it  :-\

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

            1 Reply Last reply Reply Quote 0
            • M
              mikeisfly
              last edited by

              I think as long as the redirecting to dashboard that works for me. Maybe in version 2.2.1 someone with the skill or will add the extra code. Thanks for checking.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.