diff --git a/html/js/librenms.js b/html/js/librenms.js index b910907618..f103ea29b0 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -223,3 +223,24 @@ $(document).on("click", '.collapse-neighbors', function(event) list.toggle(); continued.toggle(); }); + + +$(document).ready(function() { + var lines = 'on'; + $("#linenumbers").button().click(function() { + if (lines == 'on') { + $($('.config').find('ol').get().reverse()).each(function(){ + $(this).replaceWith($('')) + lines = 'off'; + $('#linenumbers').val('Show line numbers'); + }); + } + else { + $($('.config').find('ul').get().reverse()).each(function(){ + $(this).replaceWith($('
    '+$(this).html()+'
')); + lines = 'on'; + $('#linenumbers').val('Hide line numbers'); + }); + } + }); +}); diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index ed9219cf23..1ba06bbfc4 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -182,7 +182,10 @@ if ($_SESSION['userlevel'] >= '7') { $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); $geshi->set_overall_style('color: black;'); // $geshi->set_line_style('color: #999999'); + echo '
'; + echo ''; echo $geshi->parse_code(); + echo '
'; } }//end if