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

    DHCP Leases sorting

    Scheduled Pinned Locked Moved 2.3-RC Snapshot Feedback and Issues - ARCHIVED
    12 Posts 5 Posters 3.6k 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.
    • A
      asterix
      last edited by

      On DHCP leases page ascending or desending sorting is not working correctly. None of the columns behaving correctly when sorted.

      1 Reply Last reply Reply Quote 0
      • S
        Steve_B Netgate
        last edited by

        Are you saying that they do not sort in the correct order? Just ran a quick test and it appeared to work correctly for me. Can you provide an example?

        Als ik kan

        1 Reply Last reply Reply Quote 0
        • A
          asterix
          last edited by

          Yup they do not sort in correct order. If I click the online column it will sort a couple of top rows and ignore the rest. Desending doesn't work either.

          Just checked the host name column. Ascending works but desending fails. It will try to refresh and then shows in ascending order.

          For ip address column it's the opp, desending works ascending fails.

          When clicked second time all columns show the reversed order for about half a second and then turn to the previous order.

          1 Reply Last reply Reply Quote 0
          • C
            cmb
            last edited by

            Every field sorts as you'd expect with the the exception of "online", it's sorting by something there, but it's not by online/offline status. Seems like clicking that's sorting by start or end maybe (though it's not exactly the same as sorting the start/end columns).

            1 Reply Last reply Reply Quote 0
            • S
              Steve_B Netgate
              last edited by

              All fields sort as I would expect.

              I have disabled sorting on the last three columns since they tend to produce unpredictable results. I need to research the secondary sort (how is the table sorted if all the entries in a column are the same?)

              Would it be possible to get a screen shot, or better yet View page source, copy all and paste into an email? That way I can attempt to replicate this with your data. Perhaps there are "special" characters in your hostnames or some other peculiarity that this would reveal.

              Als ik kan

              1 Reply Last reply Reply Quote 0
              • A
                asterix
                last edited by

                @Steve_B:

                All fields sort as I would expect.

                I have disabled sorting on the last three columns since they tend to produce unpredictable results. I need to research the secondary sort (how is the table sorted if all the entries in a column are the same?)

                Would it be possible to get a screen shot, or better yet View page source, copy all and paste into an email? That way I can attempt to replicate this with your data. Perhaps there are "special" characters in your hostnames or some other peculiarity that this would reveal.

                So I just cleared the browser cache and it seems to be working fine. The Online column used to work in 2.2.x Comes in handy when you need a quick glance of all your online devices.
                Tried the same from my android tablet (Samsung Galaxy Note Pro) and it seems to behave like before .. not sorting properly.

                1 Reply Last reply Reply Quote 0
                • N
                  NOYB
                  last edited by

                  Customarily secondary sorting would be by most recent previously sorted by column(s).
                  But that is not the problem here.

                  The problem here is that the sort routine is not honoring the colspan attribute.
                  So when clicking the online header to sort, it is really sorting by the lease type column.

                  PR #2583 submitted.
                  Adding a description column instead of spanning the start and end columns is one way to resolve.
                  Another would be to include an empty second column with the description instead of spanning.  This would not be very display/sort friendly because it would be sharing the start column for the description.
                  Another would be to just display two empty cells when lease type is static, instead of the description.  This is the way status DHCPv6 leases currently works.

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

                    Another would be to just display two empty cells when lease type is static, instead of the description.

                    It used to have "N/A" in those columns for static leases. Someone mentioned that it would be nice to see the description for static leases, as in some organisations they put something useful in the description that is more human-friendly than the host name. It was something that I could use also, so I did that change to re-use those 2 columns for description in the static lease case.

                    If there is a nicer solution so that the description can still appear in that unused column space, but not interfere with the sorting, then great.

                    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
                    • S
                      Steve_B Netgate
                      last edited by

                      Thanks. I have merged NOYB's PR but retained non-sortable Actions column.

                      Als ik kan

                      1 Reply Last reply Reply Quote 0
                      • A
                        asterix
                        last edited by

                        feeling awesome contributing to the 2.3 build  :)

                        Can this updated code be named after me… lol  ;D

                        1 Reply Last reply Reply Quote 0
                        • S
                          Steve_B Netgate
                          last edited by

                          Absolutely. It will henceforth be known as "The Asterix table bug"

                          Als ik kan

                          1 Reply Last reply Reply Quote 0
                          • N
                            NOYB
                            last edited by

                            Phil,
                            The start and end columns could be used for the description so long as it's 2 actual columns (no colspan attribute).  The second column being empty is all it takes.

                            The caveats I see with that approach are:

                            1. The column title "Start" becomes a little confusing when there are descriptions in there instead of times.
                            2. Sorting.  Depending on the contents of the start column the descriptions could be interspersed or at top/bottom.

                            Another possibility may be to put the description on a second line.  Like one of the options in firewall rules for displaying rule descriptions.

                            Yet another option may be to have a separate collapsible panels for static lease and other types.

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