[racktables-users] Feature request

  • From: Rob Ruma <rruma@xxxxxxxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Wed, 05 Aug 2009 20:35:01 -0400

Hello Racktables Developers,

        I have used Racktables for about a year and have found it to be very
useful to track production server and network infrastructure. I have
noticed along the way that it is extremely simple to delete ports or
unlink connections inadvertently. To prevent this I slipped in some
javascript code in interface.php to present a confirmation before an
operation is committed. I would like to see this (or something similar)
in future releases if possible.

Here are the changes I have made to interface.php from v16.3. I figured
a diff patch wouldn't make sense at this point. I hope it's possible to
have these incorporated:

                        echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=clearSticker&object_id=${object_id}&attr_id=${record['id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<tr><td><a
href='${root}process.php?op=delPort&page=${pageno}&tab=${tabno}&port_id=${port['id']}&object_id=$object_id&port_name=${port['name']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo
"&remote_port_name=${port['remote_name']}&remote_object_name=${port['remote_object_name']}'
'javascript:;' onClick=\"return confirm('Confirm unlink?');\">";
                echo "<tr class='$class' valign=top><td><a
href='${root}process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=${dottedquad}&object_id=$object_id'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<tr valign=top><td><a
href='${root}process.php?op=delIPv4Prefix&page=${pageno}&tab=${tabno}&id=${netinfo['id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<td><a
href='${root}process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=${dottedquad}&object_id=${bond['object_id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<td><a
href='${root}process.php?op=delNATv4Rule&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=$object_id&page=${pageno}&tab=${tabno}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<tr><td><a
href='${root}process.php?op=delNATv4Rule&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=${pf['object_id']}&page=${pageno}&tab=${tabno}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<a
href='${root}process.php?op=disableUser&page=${pageno}&tab=${tabno}&user_id=${account['user_id']}'
'javascript:;' onClick=\"return confirm('Confirm disable account?');\">";
                        echo "<a
href='${root}process.php?op=enableUser&page=${pageno}&tab=${tabno}&user_id=${account['user_id']}'
'javascript:;' onClick=\"return confirm('Confirm enable acount?');\">";
                                echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=del&chapter_no=${chapter['no']}&dict_key=${key}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=del&chapter_no=${chapter['no']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<td><a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=del&attr_id=${attr['id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo 
"attr_id=${attr['id']}&objtype_id=${app['objtype_id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "&op=delRS&pool_id=${pool_id}&id=${rsid}' 
'javascript:;'
onClick=\"return confirm('Confirm delete?');\">";
                                echo "<tr valign=top class=row_${order}><td><a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=delLB&pool_id=${pool_id}&object_id=${object_id}&vs_id=${vs_id}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                                echo "<tr valign=top class=row_${order}><td><a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=delLB&pool_id=${pool_id}&object_id=${object_id}&vs_id=${vs_id}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=del&vs_id=${vsid}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=del&pool_id=${pool_id}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                echo "<a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=destroyTag&tag_id=${taginfo['id']}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";
                        echo "<tr valign=top class=row_${order}><td><a
href='${root}process.php?page=${pageno}&tab=${tabno}&op=delLB&pool_id=${vsinfo['pool_id']}&object_id=${object_id}&vs_id=${vs_id}'
'javascript:;' onClick=\"return confirm('Confirm delete?');\">";

Thanks for such a great product!

-- 

Rob Ruma
Harvard University
Faculty of Arts and Sciences (FAS)
UNIX IT Systems

Other related posts: