Minor display issue - RBD Status has next button with empty table

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Minor display issue - RBD Status has next button with empty table

jcalcote
Hi Yaguang,

I have a minor display issue to fix. On the [VSM | Cluster Monitoring | RBD Status] page, even if the table is empty or has very few items init, there is a "next" link in the bottom right corner of the table. When clicked, this link takes you to the next set of data, which is empty if all items were displayed in the first table, and a "back" button becomes visible. Clicking the "back" button takes you back to the "first" page (only page really).

RBD Status Page with unnecessary "next" link

I've dug around the code and found this block at the bottom of the page template that seems somewhat related, but commenting it out and restarting the apache2 service has no effect on the page render:

{% block js %}
    {{ block.super }}
    <script src='{{ STATIC_URL }}dashboard/js/json2.js' type='text/javascript' charset='utf-8'></script>
    <script src='{{ STATIC_URL }}dashboard/js/clustermgmt.js' type='text/javascript' charset='utf-8'></script>
    <script type="text/javascript">
        function searchToObject(){
            var pairs = window.location.search.substring(1).split("&");
            var obj = {};
            var pair, i;
            for(i in pairs){
                if(paris[i] === "")continue;
                pair = pairs[i].split("=");
                obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
            }
            return obj;
        }
        var back = "";
        if(window.location.search){
            //document.body.scrollTop = 9999;
            //var search = searchToObject();
            back = "<a href='javascript:history.back(-1)'>back</a>&nbsp;&nbsp;";
        }
        var marker = $('#rbd_list tbody tr').last().find('td').first().html();
        var next_page_url = location.pathname + "?marker=" + marker;
        $("tfoot tr td").append("<div class='page'>"+back+"<a href='"+next_page_url+"'>next</a></div>");
    </script>

{% endblock %}

I know this seems like a minor issue, but our QA team insists that we fix it. Can you help?

Thanks,
John
Reply | Threaded
Open this post in threaded view
|

Re: Minor display issue - RBD Status has next button with empty table

jcalcote
Additional information: I just realized that I commented out the entire block. If I comment out only the contents within the block, then the [back]/next links disappear. Now, I'm sure these links are there for a reason - rbd lists can apparently get quite large. It's just that the logic for displaying these links and the associated table contents appears to be incomplete or buggy.

I'll continue to work on this and perhaps submit a patch at some later time.

Thanks,
John