Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4185

Menu Graphs, Minigraphs, Quick Filters : the "active" class doesn't work

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Ports
    • None

    Description

      On the page "device/device=XXX/tab=ports", the submenu "Menu Graphs", "Minigraphs", or "Quick Filters" don't show the current choice in the drop-down list.

      When we select a choice, or multichoice (for Quick Filters), the submenu doesn't have an active <li> after the page refresh, even if the choice was correctly applied.

      This makes it difficult to know which Quick Filters are activated for example.

       

      After small search, this menu seems be generate by the fuction "navbar_entry()" (print_navbar > navbar_entry). But the navbar_entry() function doesn't handle the "class" option.

       

      html/pages/device/ports.inc.php :

      if ($filters_array[$option])     {      $navbar['options_right']['filters']['class'] .= ' active';           $navbar['options_right']['filters']['suboptions'][$option]['class'] = 'active';
      

       

      We can solve the problem with handle "class" in function navbar_entry()

      includes/print/navbar.inc.php :

         if (isset($entry['title']))
          {
            $entry_text .= $entry['title'];
          } elseif (isset($entry['text'])) {
            $entry_text .= $entry['text'];
          }
      +    if (isset($entry['class'])) {
      +      $entry_class = $entry['class'];
      +    } else {
      +      $entry_class = "";
      +    }
           echo(str_pad('',($level-1)*2) . '                <li class="'.$entry_class.'">' . generate_menu_link_new($entry) . '</li>' . PHP_EOL);
      

       

      I'm not sure it's the correct method with Obserivum implementation, but I hope that's can be help to understand the bug and correct this with correct way

       

      Attachments

        Activity

          [OBS-4185] Menu Graphs, Minigraphs, Quick Filters : the "active" class doesn't work

          Fixed in r12206.

          Thanks!

          adama Adam Armstrong added a comment - Fixed in r12206. Thanks!

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            landy Mike Stupalov
            johann Johann Mallet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: