CVE-2019-15810 (Other, published 2019-09-30T17:15Z)
Description: value: Insufficient sanitization during device search in Netdisco 2.042010 allows for reflected XSS via manipulation of a URL parameter.
Severity: MEDIUM (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/netdisco/netdisco
Files changed:
Build.PL
share/config.yml
share/views/admintask.tt
share/views/ajax/admintask/duplicatedevices.tt
share/views/ajax/admintask/jobqueue.tt
share/views/ajax/admintask/nodemonitor.tt
share/views/ajax/admintask/orphaned.tt
share/views/ajax/admintask/pseudodevice.tt
share/views/ajax/admintask/slowdevices.tt
share/views/ajax/admintask/timedoutdevices.tt
share/views/ajax/admintask/topology.tt
share/views/ajax/admintask/undiscoveredneighbors.tt
share/views/ajax/admintask/userlog.tt
share/views/ajax/admintask/users.tt
share/views/ajax/datatabledefaults.tt
share/views/ajax/device/addresses.tt
share/views/ajax/device/details.tt
share/views/ajax/device/modules.tt
share/views/ajax/device/netmap.tt
share/views/ajax/device/ports.tt
share/views/ajax/device/vlans.tt
share/views/ajax/report/apchanneldist.tt
share/views/ajax/report/apclients.tt
share/views/ajax/report/apradiochannelpower.tt
share/views/ajax/report/deviceaddrnodns.tt
share/views/ajax/report/devicebylocation.tt
share/views/ajax/report/devicednsmismatch.tt
share/views/ajax/report/devicepoestatus.tt
share/views/ajax/report/duplexmismatch.tt
share/views/ajax/report/halfduplex.tt
share/views/ajax/report/inventorybymodelbyos.tt
share/views/ajax/report/ipinventory.tt
share/views/ajax/report/moduleinventory.tt
share/views/ajax/report/netbios.tt
share/views/ajax/report/nodemultiips.tt
share/views/ajax/report/nodesdiscovered.tt
share/views/ajax/report/nodevendor.tt
share/views/ajax/report/portadmindown.tt
share/views/ajax/report/portblocking.tt
share/views/ajax/report/portmultinodes.tt
share/views/ajax/report/portssid.tt
share/views/ajax/report/portutilization.tt
share/views/ajax/report/portvlanmismatch.tt
share/views/ajax/report/subnets.tt
share/views/ajax/report/vlaninventory.tt
share/views/ajax/search/device.tt
share/views/ajax/search/node_by_ip.tt
share/views/ajax/search/node_by_mac.tt
share/views/ajax/search/port.tt
share/views/ajax/search/vlan.tt
share/views/ajax/statistics.tt
share/views/device.tt
share/views/index.tt
share/views/inventory.tt
share/views/js/admintask.js
share/views/js/common.js
share/views/js/device.js
share/views/js/report.js
share/views/js/search.js
share/views/layouts/main.tt
share/views/password.tt
share/views/report.tt
share/views/search.tt
share/views/sidebar/device/netmap.tt
share/views/sidebar/device/ports.tt
share/views/sidebar/report/ipinventory.tt
share/views/sidebar/report/moduleinventory.tt
share/views/sidebar/report/netbios.tt
share/views/sidebar/report/nodesdiscovered.tt
share/views/sidebar/report/nodevendor.tt
share/views/sidebar/report/portmultinodes.tt
share/views/sidebar/report/portssid.tt
share/views/sidebar/report/portutilization.tt
share/views/sidebar/report/subnets.tt
share/views/sidebar/search/device.tt
share/views/sidebar/search/node.tt
share/views/sidebar/search/port.tt
Commit message: Enforce escaping on all template content


Vulnerable code:
        <div id="[% task.tag %]_search" class="tab-pane active">
          <form id="[% task.tag %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/admin') %]">
            <script type="text/javascript">has_sidebar["[% task.tag %]"] = 1;</script>
            <script type="text/javascript">has_sidebar["[% task.tag %]"] = 0;</script>
      <li class="active"><a id="[% task.tag %]_link" class="nd_single-tab"
        href="#[% task.tag %]_pane">[% task.label %]</a></li>
      <div class="tab-pane active" id="[% task.tag %]_pane"></div>
        href="[% uri_for('/device') %]?tab=details&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
          data-toggle="modal" data-target="#nd_devdel-[% count %]" type="button">
        <div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count %]">Confirm Delete: [% row.ip || row.dns | html_entity %]</h3>
        <a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
        <a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.target.dns || row.device | html_entity %]</a>
          data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
            <td><a href="[% uri_for('/device') %]?q=[% row.ip | uri %]">
                <a href="[% search_device %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
          <a class="accordion-toggle" data-toggle="collapse" data-target="#collapse-[% count %]" href="#collapse-[% count %]">
    <div id="collapse-[% count %]" class="accordion-body collapse">
            <td><a href="[% uri_for('/device') %]?tab=netmap&q=[% row.ip | uri %]&firstsearch=on">
                <a href="[% search_device %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
        href="[% uri_for('/device') %]?q=[% row.ip | uri %]">[% row.dns | html_entity %]</a></td>
          data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
        href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
        href="[% uri_for('/search') %]?tab=node&q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
      <td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') %]?q=[% row.device1.ip | uri %]">
      <td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') %]?q=[% row.device2.ip | uri %]">
          data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
      <td nowrap><a href="[% device_ports %]&q=[% row.ip | uri %]">
          <a href="[% device_ports %]&q=[% row.ip | uri %]&f=[% row.port | uri %]">
      <td nowrap><a href="[% search_node %]&q=[% row.remote_ip | uri %]">
    "ajax": "[% uri_for('/ajax/control/admin/userlog/data') %]",
          data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
    ,"pageLength": [% settings.table_pagesize %]
    ,"lengthMenu": [% table_showrecordsmenu %]
    "data": [% results %],
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
          return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
      <td>[% d.name %]</td>
        data-field="location" data-for-device="[% d.ip %]">
        href="[% search_device %]&q=[% d.location | uri %]&location=[% d.location | uri %]">[% d.location | html_entity %]</a>
        href="[% search_device %]&q=[% d.vendor | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor | html_entity %]</a>
        href="[% search_device %]&q=[% d.model | uri %]&model=[% d.model | uri %]">[% d.model | html_entity %]</a>
        href="[% search_device %]&q=[% d.os | uri %]&os=[% d.os | uri %]">[% d.os | html_entity %]</a>
        href="[% search_device %]&q=[% d.os_ver | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver | html_entity %]</a>
          [% config.label %]
        [% d.layers.substr(7,1) ? '<span class="badge badge-success">1</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(6,1) ? '<span class="badge badge-success">2</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(5,1) ? '<span class="badge badge-success">3</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(4,1) ? '<span class="badge badge-success">4</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(3,1) ? '<span class="badge badge-success">5</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(2,1) ? '<span class="badge badge-success">6</span>' : '<span class="badge">&nbsp;</span>' %]
        [% d.layers.substr(1,1) ? '<span class="badge badge-success">7</span>' : '<span class="badge">&nbsp;</span>' %]
        Module [% m.module %]: [% m.status | html_entity %], [% m.poe_capable_ports %] power-capable ports, [% m.poe_powered_ports %] powered ([% m.poe_disabled_ports %] admin disabled, [% m.poe_errored_ports %] errors), [% m.poe_power_committed %]/[% m.power %] watts committed.
    <tr data-for-device="[% d.ip %]">
        <input type="hidden" data-form="discover" value="[% d.ip %]" name="device"/>
        <input type="hidden" data-form="arpnip" value="[% d.ip %]" name="device"/>
        <input type="hidden" data-form="macsuck" value="[% d.ip %]" name="device"/>
        <input type="hidden" data-form="nbtstat" value="[% d.ip %]" name="device"/>
            <input type="hidden" data-form="delete" value="[% d.ip %]" name="device"/>
 <a href="[% uri_for('/report/moduleinventory') %]?description=[% nodes.$item.module.description | uri %]">[% nodes.$item.module.description -%]</a>
 <a href="[% uri_for('/report/moduleinventory') %]?name=[% nodes.$item.module.name | uri %]">([% nodes.$item.module.name %])</a>
 <a href="[% uri_for('/report/moduleinventory') %]?serial=[% nodes.$item.module.serial | uri %]">[serial: [% nodes.$item.module.serial %]]</a>
 / <a href="[% uri_for('/report/moduleinventory') %]?type=[% nodes.$item.module.type | uri %]">[% nodes.$item.module.type %]</a>
 / <a href="[% uri_for('/report/moduleinventory') %]?model=[% nodes.$item.module.model | uri %]">[% nodes.$item.module.model %]</a>
$.getJSON('[% uri_for('/ajax/data/device/netmap') %]?[% my_query %]', function(mapdata) {
      //  (mapdata['newnodes'] && ('[% params.mapshow %]' == 'neighbors'))
    if ('[% params.mapshow %]' == 'neighbors') {
        //if ('[% params.dynamicsize %]' == 'on') {
    '[% uri_for('/ajax/data/device/netmappositions') %]'
        <th[% th_class %]>
          href="[% uri_for('/report/portlog') %]?q=[% device.ip | uri %]&f=[% row.port | uri %]">
        <a class="nd_this-port-only nd_port-only-first" href="[% device_ports %]&q=[% params.q | uri %]&f=[% row.port | uri %]&prefer=port">
          <a class="nd_this-port-only" href="[% device_ports %]&q=[% params.q | uri %]&f=[% row.slave_of | uri %]&prefer=port">
          href="[% uri_for('/search') %]?tab=vlan&q=[% row.vlan | uri %]">
          [% output %]
            <a href="[% device_ports %]&q=[% row.get_column('neighbor_ip') | uri %]">
                <a href="[% device_ports %]&q=[% row.get_column('neighbor_ip') | uri %]&f=[% row.remote_port | uri %]&prefer=port">
              [% row.remote_inventory %]<br/>
            <a href="[% search_node %]&q=[% row.remote_ip | uri %]">
              [% row.remote_inventory %]<br/>
          <a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
              <a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>
              <a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
            <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Nodes in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
            <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
          href="[% uri_for('/admin/topology') %]?dev1=[% device.ip | uri %]&port1=[% row.port | uri %]">
    "data": [% results %],
          return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results %],
    "data": [% results %],
            '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
    "ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') %]",
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
    "data": [% results %],
          return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
        "data": [% results %],
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
                    return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results %],
            return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
      <td>[% row.ip %]</td>
      <td>[% row.dns %]</td>
      <td>[% row.name %]</td>
      <td>[% row.model %]</td>
      <td>[% row.location %]</td>
      <td>[% row.module %]</td>
      <td class="nd_center-cell">[% row.power %]</td>
      <td class="nd_center-cell">[% row.status %]</td>
      <td class="nd_center-cell">[% row.poe_capable_ports %]</td>
      <td class="nd_center-cell">[% row.poe_powered_ports %]</td>
      <td class="nd_center-cell">[% row.poe_disabled_ports %]</td>
      <td class="nd_center-cell">[% row.poe_errored_ports %]</td>
      <td class="nd_center-cell">[% row.poe_power_committed %]</td>
      <td class="nd_center-cell">[% row.poe_power_delivering %]</td>
    s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
    "ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') %]",
    "data": [% results %],
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.left_dns || row.left_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.right_dns || row.right_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
    "data": [% results %],
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
        <a href="[% search_device %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
          href="[% search_device %]&q=[% row.os_ver | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]&os=[% row.os | uri %]&os_ver=[% row.os_ver | uri %]&matchall=on">
    "data": [% results %],
              cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
              cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
            cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
    "ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') %]?[% url(params('query').hash) %]",
        return '<a href="[% uri_for('/device') %]?tab=modules&q=' + encodeURIComponent(data) + '">' + he.encode(row.device.dns || row.device.name || row.ip) + '</a>';
          return '<a href="[% report_moduleinventory %]&description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory %]&name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
          return '<a href="[% report_moduleinventory %]&type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory %]&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory %]&serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results %],
          return '<a href="[% report_moduleinventory %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
    "ajax": "[% uri_for('/ajax/content/report/netbios/data') %]?[% url(params('query').hash) %]",
          return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
          return he.encode(prefix) + '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
    "data": [% results %],
          return '<a href="[% uri_for('/report/netbios') %]?domain=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data || '(Blank Domain)') + '</a>';
    "data": [% results %],
          return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
          return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(row.dns || row.name || row.switch) + '(' + he.encode(data) + ')</a>';
    "data": [% results %],
            '<a href="[% device_ports %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
          return '<a href="[% search_node %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
    "ajax": "[% uri_for('/ajax/content/report/nodevendor/data') %]?[% url(params('query').hash) %]",
          return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + icon + '</a>';
          return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(row.oui.abbrev || 'blank') + '">' + he.encode(row.oui.company ||'(Unknown Vendor)') + '</a>';
          return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.switch) + '(' + he.encode(data) + ')</a>';
    "data": [% results %],
          return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(row.abbrev || 'blank') + '">' + he.encode(row.vendor ||'(Unknown Vendor)') + '</a>';
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results %],
    "data": [% results %],
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results %],
            '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results %],
        return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '&f=' + encodeURIComponent(row.port.port) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.ip) + '(' + he.encode(row.port.port) + ')</a>';
          return '<a href="[% uri_for('/report/portssid') %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
        "data": [% results %],
                    return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
        "data": [% results %],
                    return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
                  '<a href="[% device_ports %]&q=' + encodeURIComponent(row.left_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
                    return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
                  '<a href="[% device_ports %]&q=' + encodeURIComponent(row.right_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
      <td class="nd_center-cell"><a href="[% uri_for('/report/ipinventory') %]?subnet=[% row.subnet | uri %]&daterange=[% params.daterange | uri %]&age_invert=[% params.age_invert | uri %]&limit=[% row.subnet_size | uri %]">
    "data": [% results %],
          return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results %],
          return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
      <td>MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
      <td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% row.domain | uri %]" title="Devices in this Domain">[% row.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% row.nbname | uri %]">[% row.nbname | html_entity %]</a>
        <br>[% row.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
        <a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node %]&q=[% nbt.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nbt.oui.abbrev | uri %]">
      <td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
        <br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node %]&q=[% ni.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% ni.oui.abbrev | uri %]">
        <a href="[% search_node %]&q=[% ni.ip | uri %]">[% ni.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% node.oui.abbrev | uri %]">
          href="[% device_ports %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
            on vlan [% node.vlan %]
        <td>MAC: <a href="[% search_node %]&q=[% wlan.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% wlan.oui.abbrev | uri %]">
      <td>MAC: <a href="[% search_node %]&q=[% nodeip.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nodeip.oui.abbrev | uri %]">
        <a href="[% search_node %]&q=[% nodeip.ip | uri %]">[% nodeip.ip | html_entity %]</a>
          MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
      <td class="nd_center-cell"><a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
        MAC: <a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% node.oui.abbrev | uri %]">
            <a href="[% device_ports %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
            on vlan [% node.vlan %]
        MAC: <a href="[% search_node %]&q=[% port.net_mac.$mac_format_call | uri %]">[% port.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% port.oui.abbrev | uri %]">
            <a href="[% device_ports %]&q=[% port.ip | uri %]&f=[% port.port | uri %]&c_mac=on&c_nodes=on&c_neighbors=on">
        MAC: <a href="[% search_node %]&q=[% nbt.net_mac.$mac_format_call | uri %]">[% nbt.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nbt.oui.abbrev | uri %]">
      <td class="nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
        <br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
        MAC: <a href="[% search_node %]&q=[% wlan.net_mac.$mac_format_call | uri %]">[% wlan.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% wlan.oui.abbrev | uri %]">
    "data": [% results %],
          return '<a href="[% device_ports %]&q=' + encodeURIComponent(data)
    "data": [% results %],
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(row.dns || row.ip) + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
              <th>Statistics last generated on [% stats.day %]</th>
        <div id="[% tab.tag %]_search" class="tab-pane [% 'active' IF params.tab == tab.tag %]">
          <form id="[% tab.tag %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/device') %]">
            <input name="tab" value="[% tab.tag %]" type="hidden"/>
            <script type="text/javascript">has_sidebar["[% tab.tag %]"] = 1;</script>
            <!-- no "[% tab.tag %]" search options -->
            <script type="text/javascript">has_sidebar["[% tab.tag %]"] = 0;</script>
      <li[% ' class="active"' IF params.tab == tab.tag %]><a id="[% tab.tag %]_link" href="#[% tab.tag %]_pane">[% tab.label %]</a></li>
      <div class="tab-pane[% ' active' IF params.tab == tab.tag %]" id="[% tab.tag %]_pane"></div>
        <form class="nd_login-form" method="post" action="[% uri_for('/login') %]">
            <img src="[% settings.login_logo %]" alt="Login Logo" />
          <form class="" method="get" action="[% uri_for('/search') %]">
          <form class="nd_login-form" method="post" action="[% uri_for('/admin/discover') %]">
              <input placeholder="Device hostname or IP" class="span4" name="device" value="[% params.device %]" type="text"/>
      $('#nd_stats').load("[% uri_for('/ajax/content/statistics') %]", function(r,s,x) {
                href="[% search_device %]&q=[% platform.vendor | uri %]&vendor=[% platform.vendor | uri %]">
                href="[% search_device %]&q=[% platform.model | uri %]&model=[% platform.model | uri %]">
                href="[% search_device %]&q=[% release.os | uri %]&os=[% release.os | uri %]">
                href="[% search_device %]&q=[% release.os_ver | uri %]&os_ver=[% release.os_ver | uri %]">
    var tab = '[% task.tag %]'
      var pgtitle = update_page_title('[% tab.tag %]');
      copy_navbar_to_sidebar('[% tab.tag %]');
      update_browser_history('[% tab.tag %]', pgtitle, '');
      update_csv_download_link('search', '[% tab.tag %]', '[% tab.provides_csv %]');
      do_search(event, '[% tab.tag %]');
      var pgtitle = update_page_title('[% tab.tag %]');
      copy_navbar_to_sidebar('[% tab.tag %]');
      update_browser_history('[% tab.tag %]', pgtitle, '');
      update_csv_download_link('device', '[% tab.tag %]', '[% tab.provides_csv %]');
      $('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag %]&reset=on&firstsearch=on&' +
      $('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag %]&reset=on&firstsearch=on&' +
      do_search(event, '[% tab.tag %]');
      var pgtitle = update_page_title('[% report.tag %]');
      update_browser_history('[% report.tag %]', pgtitle, '1');
      update_csv_download_link('report', '[% report.tag %]', '1');
      do_search(event, '[% report.tag %]');
      update_page_title('[% task.tag %]');
      update_csv_download_link('admin', '[% task.tag %]', '1');
      do_search(event, '[% task.tag %]');
      $('#[% params.tab %]_submit').click();
      $('#[% params.tab %]_form').trigger("submit");
    var tab = '[% tab.tag %]'
    var tab = '[% report.tag %]'
    var tab = '[% tab.tag %]'
  <link rel="shortcut icon" href="[% uri_base %]/images/favicon.ico" type="image/x-icon">
  <link rel="icon" href="[% uri_base %]/images/favicon.ico" type="image/x-icon">
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery-latest.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery-ui.custom.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery-history.js"></script>
<!--  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery.cookie.js"></script> -->
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery-deserialize.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/bootstrap.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/bootstrap2-toggle.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/underscore.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery.qtip.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/d3-3.5.17.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/d3-force-network-chart.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/toastr.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery.floatThead.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/daterangepicker.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/moment.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/jquery.dataTables.min.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.bootstrap.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.ip-address-detect.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.ip-address-sort.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/he.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/natural.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/portsort.js"></script>
    var uri_base = '[% uri_base %]';
    var nd_check_userlog = '[% settings.check_userlog %]';
  <script type="text/javascript" src="[% uri_base %]/javascripts/netdisco.js"></script>
  <script type="text/javascript" src="[% uri_base %]/javascripts/netdisco_portcontrol.js"></script>
  <script type="text/javascript" src="[% uri_base %]/plugin/[% add_js %]/[% add_js %].js"></script>
  <link rel="stylesheet" href="[% uri_base %]/css/bootstrap.min.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/bootstrap2-toggle.min.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/awesome-bootstrap-checkbox.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/jquery.qtip.min.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/smoothness/jquery-ui.custom.min.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/font-awesome.min.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/toastr.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/d3-force-network-chart.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/netdisco.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/bootstrap-tree.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/daterangepicker-bs2.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/dataTables.bootstrap.css"/>
  <link rel="stylesheet" href="[% uri_base %]/css/nd_print.css" media="print"/>
  <link rel="stylesheet" href="[% uri_base %]/plugin/[% add_css %]/[% add_css %].css"/>
      <a class="brand" href="[% uri_for('/') %]">Netdisco</a>
          <a href="[% uri_for(ni.path) %]">[% ni.label | html_entity %]</a>
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/discoverall') %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/arpwalk') %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/macwalk') %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/nbtwalk') %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/expire') %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/stats') %]">
      <form class="navbar-search pull-left" method="get" action="[% uri_for('/search') %]">
          id="nq" name="q" value="[% display_name %]" type="text" autocomplete="off"/>
            <li><a href="[% uri_for('/password') %]">Change Password</a></li>
            <li><a href="[% uri_for('/logout') %]">Log Out</a></li>
[% content %]
        <form class="nd_login-form" method="post" action="[% uri_for('/password') %]">
        <div id="[% report.tag %]_search" class="tab-pane active">
          <form id="[% report.tag %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/report') %]">
            <script type="text/javascript">has_sidebar["[% report.tag %]"] = 1;</script>
            <script type="text/javascript">has_sidebar["[% report.tag %]"] = 0;</script>
      <li class="active"><a id="[% report.tag %]_link" class="nd_single-tab"
        href="#[% report.tag %]_pane">[% report.label %]</a></li>
        <a href="[% device_ports %]&q=[% params.q | uri %]">[% params.q %]</a>
        <a href="[% device_ports %]&q=[% params.q | uri %]&f=[% params.f | uri %]">[% params.f %]</a>
      <div class="tab-pane active" id="[% report.tag %]_pane"></div>
        <div id="[% tab.tag %]_search" class="tab-pane [% 'active' IF params.tab == tab.tag %]">
          <form id="[% tab.tag %]_form" class="nd_sidebar-form form-stacked" method="get" action="[% uri_for('/search') %]">
            <input name="tab" value="[% tab.tag %]" type="hidden"/>
            <script type="text/javascript">has_sidebar["[% tab.tag %]"] = 1;</script>
            <!-- no "[% tab.tag %]" search options -->
            <script type="text/javascript">has_sidebar["[% tab.tag %]"] = 0;</script>
      <li[% ' class="active"' IF params.tab == tab.tag %]><a id="[% tab.tag %]_link" href="#[% tab.tag %]_pane">[% tab.label %]</a></li>
      <div class="tab-pane[% ' active' IF params.tab == tab.tag %]" id="[% tab.tag %]_pane"></div>
                value="[% opt.key %]">[% opt.value | html_entity %]</option>
                value="[% loc %]">[% loc | html_entity %]</option>
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.mac_format == format %]>[% format %]</option>
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.age_num == count %]>[% count %]</option>
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.age_unit == unit %]>[% unit %]</option>
              <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info nd_sidebar-btn-drop">
                        [% size %]</option>
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
                <option[% ' selected="selected"' IF vars.sidebar_defaults.report_portutilization.age_num == count %]>[% count %]</option>
                <option[% ' selected="selected"' IF vars.sidebar_defaults.report_portutilization.age_unit == unit %]>[% unit %]</option>
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
                <option[% ' selected="selected"' IF vars.sidebar_defaults.search_node.mac_format == format %]>[% format %]</option>
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag %]_submit" type="submit" class="btn btn-info">

Fixed code:
    'Template::AutoFilter' => '0',
    subclass: 'Template::AutoFilter'
    ANYCASE: 1
    ABSOLUTE: 1
    AUTO_FILTER: 'html_entity'
        <div id="[% task.tag | html_entity %]_search" class="tab-pane active">
          <form id="[% task.tag | html_entity %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/admin') | none %]">
            <script type="text/javascript">has_sidebar["[% task.tag | html_entity %]"] = 1;</script>
            <script type="text/javascript">has_sidebar["[% task.tag | html_entity %]"] = 0;</script>
      <li class="active"><a id="[% task.tag | html_entity %]_link" class="nd_single-tab"
        href="#[% task.tag | html_entity %]_pane">[% task.label | html_entity %]</a></li>
      <div class="tab-pane active" id="[% task.tag | html_entity %]_pane"></div>
        href="[% uri_for('/device') | none %]?tab=details&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
          data-toggle="modal" data-target="#nd_devdel-[% count | html_entity %]" type="button">
        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count | html_entity %]">Confirm Delete: [% row.ip || row.dns | html_entity %]</h3>
        <a href="[% uri_for('/') | none %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
        <a href="[% uri_for('/device') | none %]?q=[% row.device | uri %]">[% row.target.dns || row.device | html_entity %]</a>
          data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3>
            <td><a href="[% uri_for('/device') | none %]?q=[% row.ip | uri %]">
                <a href="[% search_device | none %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
          <a class="accordion-toggle" data-toggle="collapse" data-target="#collapse-[% count | html_entity %]" href="#collapse-[% count | html_entity %]">
    <div id="collapse-[% count | html_entity %]" class="accordion-body collapse">
            <td><a href="[% uri_for('/device') | none %]?tab=netmap&q=[% row.ip | uri %]&firstsearch=on">
                <a href="[% search_device | none %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
        href="[% uri_for('/device') | none %]?q=[% row.ip | uri %]">[% row.dns | html_entity %]</a></td>
          data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3>
        href="[% uri_for('/device') | none %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
        href="[% uri_for('/search') | none %]?tab=node&q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
      <td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') | none %]?q=[% row.device1.ip | uri %]">
      <td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') | none %]?q=[% row.device2.ip | uri %]">
          data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3>
      <td nowrap><a href="[% device_ports | none %]&q=[% row.ip | uri %]">
          <a href="[% device_ports | none %]&q=[% row.ip | uri %]&f=[% row.port | uri %]">
      <td nowrap><a href="[% search_node | none %]&q=[% row.remote_ip | uri %]">
    "ajax": "[% uri_for('/ajax/control/admin/userlog/data') | none %]",
          data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button>
        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
            <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3>
    ,"pageLength": [% settings.table_pagesize | none %]
    ,"lengthMenu": [% table_showrecordsmenu | none %]
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
          return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
      <td>[% d.name | html_entity %]</td>
        data-field="location" data-for-device="[% d.ip | html_entity %]">
        href="[% search_device | none %]&q=[% d.location | uri %]&location=[% d.location | uri %]">[% d.location | html_entity %]</a>
        href="[% search_device | none %]&q=[% d.vendor | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor | html_entity %]</a>
        href="[% search_device | none %]&q=[% d.model | uri %]&model=[% d.model | uri %]">[% d.model | html_entity %]</a>
        href="[% search_device | none %]&q=[% d.os | uri %]&os=[% d.os | uri %]">[% d.os | html_entity %]</a>
        href="[% search_device | none %]&q=[% d.os_ver | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver | html_entity %]</a>
          [% config.label | html_entity %]
        [% (d.layers.substr(7,1) ? '<span class="badge badge-success">1</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(6,1) ? '<span class="badge badge-success">2</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(5,1) ? '<span class="badge badge-success">3</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(4,1) ? '<span class="badge badge-success">4</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(3,1) ? '<span class="badge badge-success">5</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(2,1) ? '<span class="badge badge-success">6</span>' : '<span class="badge">&nbsp;</span>') | none %]
        [% (d.layers.substr(1,1) ? '<span class="badge badge-success">7</span>' : '<span class="badge">&nbsp;</span>') | none %]
        Module [% m.module | html_entity %]: [% m.status | html_entity %], [% m.poe_capable_ports | html_entity %] power-capable ports, [% m.poe_powered_ports | html_entity %] powered ([% m.poe_disabled_ports | html_entity %] admin disabled, [% m.poe_errored_ports | html_entity %] errors), [% m.poe_power_committed | html_entity %]/[% m.power | html_entity %] watts committed.
    <tr data-for-device="[% d.ip | html_entity %]">
        <input type="hidden" data-form="discover" value="[% d.ip | html_entity %]" name="device"/>
        <input type="hidden" data-form="arpnip" value="[% d.ip | html_entity %]" name="device"/>
        <input type="hidden" data-form="macsuck" value="[% d.ip | html_entity %]" name="device"/>
        <input type="hidden" data-form="nbtstat" value="[% d.ip | html_entity %]" name="device"/>
            <input type="hidden" data-form="delete" value="[% d.ip | html_entity %]" name="device"/>
 <a href="[% uri_for('/report/moduleinventory') | none %]?description=[% nodes.$item.module.description | uri %]">[% nodes.$item.module.description -%]</a>
 <a href="[% uri_for('/report/moduleinventory') | none %]?name=[% nodes.$item.module.name | uri %]">([% nodes.$item.module.name %])</a>
 <a href="[% uri_for('/report/moduleinventory') | none %]?serial=[% nodes.$item.module.serial | uri %]">[serial: [% nodes.$item.module.serial %]]</a>
 / <a href="[% uri_for('/report/moduleinventory') | none %]?type=[% nodes.$item.module.type | uri %]">[% nodes.$item.module.type %]</a>
 / <a href="[% uri_for('/report/moduleinventory') | none %]?model=[% nodes.$item.module.model | uri %]">[% nodes.$item.module.model %]</a>
$.getJSON('[% uri_for('/ajax/data/device/netmap') | none %]?[% my_query | none %]', function(mapdata) {
      //  (mapdata['newnodes'] && ('[% params.mapshow | html_entity %]' == 'neighbors'))
    if ('[% params.mapshow | html_entity %]' == 'neighbors') {
        //if ('[% params.dynamicsize | html_entity %]' == 'on') {
    '[% uri_for('/ajax/data/device/netmappositions') | none %]'
        <th[% th_class | html_entity %]>
          href="[% uri_for('/report/portlog') | none %]?q=[% device.ip | uri %]&f=[% row.port | uri %]">
        <a class="nd_this-port-only nd_port-only-first" href="[% device_ports | none %]&q=[% params.q | uri %]&f=[% row.port | uri %]&prefer=port">
          <a class="nd_this-port-only" href="[% device_ports | none %]&q=[% params.q | uri %]&f=[% row.slave_of | uri %]&prefer=port">
          href="[% uri_for('/search') | none %]?tab=vlan&q=[% row.vlan | uri %]">
          [% output | none %]
            <a href="[% device_ports | none %]&q=[% row.get_column('neighbor_ip') | uri %]">
                <a href="[% device_ports | none %]&q=[% row.get_column('neighbor_ip') | uri %]&f=[% row.remote_port | uri %]&prefer=port">
              [% row.remote_inventory | html_entity %]<br/>
            <a href="[% search_node | none %]&q=[% row.remote_ip | uri %]">
              [% row.remote_inventory | html_entity %]<br/>
          <a href="[% search_node | none %]&q=[% node.net_mac.$mac_format_call | uri %]">
              <a href="[% search_node | none %]&q=[% ip.ip | uri %]">[% dns | html_entity %] ([% ip.ip | html_entity %])</a>
              <a href="[% search_node | none %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
            <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\<a href="[% uri_for('/report/netbios') | none %]?domain=[% nbt.domain | uri %]" title="Nodes in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node | none %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
            <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node | none %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
          href="[% uri_for('/admin/topology') | none %]?dev1=[% device.ip | uri %]&port1=[% row.port | uri %]">
    "data": [% results | none %],
          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results | none %],
    "data": [% results | none %],
            '<a href="[% uri_for('/device') | none %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    s = s + '<a href="[% uri_for('/device') | none %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
    "ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') | none %]",
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
    "data": [% results | none %],
          return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
        "data": [% results | none %],
                    return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
                    return '<a href="[% uri_for('/device') | none %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
                    return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                    return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                    return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results | none %],
            return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
      <td>[% row.ip | html_entity %]</td>
      <td>[% row.dns | html_entity %]</td>
      <td>[% row.name | html_entity %]</td>
      <td>[% row.model | html_entity %]</td>
      <td>[% row.location | html_entity %]</td>
      <td>[% row.module | html_entity %]</td>
      <td class="nd_center-cell">[% row.power | html_entity %]</td>
      <td class="nd_center-cell">[% row.status | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_capable_ports | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_powered_ports | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_disabled_ports | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_errored_ports | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_power_committed | html_entity %]</td>
      <td class="nd_center-cell">[% row.poe_power_delivering | html_entity %]</td>
    s = s + '<a href="[% uri_for('/device') | none %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
    "ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') | none %]",
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.left_dns || row.left_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.right_dns || row.right_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
        <a href="[% search_device | none %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
          href="[% search_device | none %]&q=[% row.os_ver | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]&os=[% row.os | uri %]&os_ver=[% row.os_ver | uri %]&matchall=on">
    "data": [% results | none %],
              cell_str = '<a href="[% search_node | none %]&q=' + encodeURIComponent(data)
              cell_str = '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
            cell_str = '<a href="[% search_node | none %]&q=' + encodeURIComponent(data)
    "ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') | none %]?[% url(params('query').hash) | none %]",
        return '<a href="[% uri_for('/device') | none %]?tab=modules&q=' + encodeURIComponent(data) + '">' + he.encode(row.device.dns || row.device.name || row.ip) + '</a>';
          return '<a href="[% report_moduleinventory | none %]&description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory | none %]&name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory | none %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
          return '<a href="[% report_moduleinventory | none %]&type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory | none %]&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
          return '<a href="[% report_moduleinventory | none %]&serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results | none %],
          return '<a href="[% report_moduleinventory | none %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
    "ajax": "[% uri_for('/ajax/content/report/netbios/data') | none %]?[% url(params('query').hash) | none %]",
          return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
          return he.encode(prefix) + '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
    "data": [% results | none %],
          return '<a href="[% uri_for('/report/netbios') | none %]?domain=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data || '(Blank Domain)') + '</a>';
    "data": [% results | none %],
          return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(row.dns || row.name || row.switch) + '(' + he.encode(data) + ')</a>';
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
          return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
    "ajax": "[% uri_for('/ajax/content/report/nodevendor/data') | none %]?[% url(params('query').hash) | none %]",
          return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + icon + '</a>';
          return '<a href="[% uri_for('/report/nodevendor') | none %]?vendor=' + encodeURIComponent(row.oui.abbrev || 'blank') + '">' + he.encode(row.oui.company ||'(Unknown Vendor)') + '</a>';
          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.switch) + '(' + he.encode(data) + ')</a>';
    "data": [% results | none %],
          return '<a href="[% uri_for('/report/nodevendor') | none %]?vendor=' + encodeURIComponent(row.abbrev || 'blank') + '">' + he.encode(row.vendor ||'(Unknown Vendor)') + '</a>';
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results | none %],
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results | none %],
            '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
    "data": [% results | none %],
        return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '&f=' + encodeURIComponent(row.port.port) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.ip) + '(' + he.encode(row.port.port) + ')</a>';
          return '<a href="[% uri_for('/report/portssid') | none %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
        "data": [% results | none %],
                    return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
        "data": [% results | none %],
                    return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
                  '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.left_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
                    return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
                  '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.right_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
      <td class="nd_center-cell"><a href="[% uri_for('/report/ipinventory') | none %]?subnet=[% row.subnet | uri %]&daterange=[% params.daterange | uri %]&age_invert=[% params.age_invert | uri %]&limit=[% row.subnet_size | uri %]">
    "data": [% results | none %],
          return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
    "data": [% results | none %],
          return '<a href="[% uri_for('/device') | none %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
      <td>MAC: <a href="[% search_node | none %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% row.oui.abbrev | uri %]">
      <td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') | none %]?domain=[% row.domain | uri %]" title="Devices in this Domain">[% row.domain | html_entity %]</a>\<a href="[% search_node | none %]&q=[% row.nbname | uri %]">[% row.nbname | html_entity %]</a>
        <br>[% row.nbuser || '[No User]' | html_entity %]@<a href="[% search_node | none %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node | none %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% row.oui.abbrev | uri %]">
        <a href="[% search_node | none %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node | none %]&q=[% nbt.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% nbt.oui.abbrev | uri %]">
      <td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') | none %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node | none %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
        <br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node | none %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node | none %]&q=[% ni.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% ni.oui.abbrev | uri %]">
        <a href="[% search_node | none %]&q=[% ni.ip | uri %]">[% ni.ip | html_entity %]</a>
      <td>MAC: <a href="[% search_node | none %]&q=[% node.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% node.oui.abbrev | uri %]">
          href="[% device_ports | none %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
            on vlan [% node.vlan | html_entity %]
        <td>MAC: <a href="[% search_node | none %]&q=[% wlan.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% wlan.oui.abbrev | uri %]">
      <td>MAC: <a href="[% search_node | none %]&q=[% nodeip.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% nodeip.oui.abbrev | uri %]">
        <a href="[% search_node | none %]&q=[% nodeip.ip | uri %]">[% nodeip.ip | html_entity %]</a>
          MAC: <a href="[% search_node | none %]&q=[% row.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% row.oui.abbrev | uri %]">
      <td class="nd_center-cell"><a href="[% search_node | none %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
        MAC: <a href="[% search_node | none %]&q=[% node.net_mac.$mac_format_call | uri %]">
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% node.oui.abbrev | uri %]">
            <a href="[% device_ports | none %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
            on vlan [% node.vlan | html_entity %]
        MAC: <a href="[% search_node | none %]&q=[% port.net_mac.$mac_format_call | uri %]">[% port.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% port.oui.abbrev | uri %]">
            <a href="[% device_ports | none %]&q=[% port.ip | uri %]&f=[% port.port | uri %]&c_mac=on&c_nodes=on&c_neighbors=on">
        MAC: <a href="[% search_node | none %]&q=[% nbt.net_mac.$mac_format_call | uri %]">[% nbt.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% nbt.oui.abbrev | uri %]">
      <td class="nd_center-cell">\\<a href="[% uri_for('/report/netbios') | none %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node | none %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
        <br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node | none %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
        MAC: <a href="[% search_node | none %]&q=[% wlan.net_mac.$mac_format_call | uri %]">[% wlan.net_mac.$mac_format_call | html_entity %]</a>
        ( <a href="[% uri_for('/report/nodevendor') | none %]?vendor=[% wlan.oui.abbrev | uri %]">
    "data": [% results | none %],
          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data)
    "data": [% results | none %],
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>';
          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(row.dns || row.ip) + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
          return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
              <th>Statistics last generated on [% stats.day | html_entity %]</th>
        <div id="[% tab.tag | html_entity %]_search" class="tab-pane [% 'active' IF params.tab == tab.tag %]">
          <form id="[% tab.tag | html_entity %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/device') | none %]">
            <input name="tab" value="[% tab.tag | html_entity %]" type="hidden"/>
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 1;</script>
            <!-- no "[% tab.tag | html_entity %]" search options -->
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 0;</script>
      <li[% ' class="active"' IF params.tab == tab.tag %]><a id="[% tab.tag | html_entity %]_link" href="#[% tab.tag | html_entity %]_pane">[% tab.label | html_entity %]</a></li>
      <div class="tab-pane[% ' active' IF params.tab == tab.tag %]" id="[% tab.tag | html_entity %]_pane"></div>
        <form class="nd_login-form" method="post" action="[% uri_for('/login') | none %]">
            <img src="[% settings.login_logo | none %]" alt="Login Logo" />
          <form class="" method="get" action="[% uri_for('/search') | none %]">
          <form class="nd_login-form" method="post" action="[% uri_for('/admin/discover') | none %]">
              <input placeholder="Device hostname or IP" class="span4" name="device" value="[% params.device | html_entity %]" type="text"/>
      $('#nd_stats').load("[% uri_for('/ajax/content/statistics') | none %]", function(r,s,x) {
                href="[% search_device | none %]&q=[% platform.vendor | uri %]&vendor=[% platform.vendor | uri %]">
                href="[% search_device | none %]&q=[% platform.model | uri %]&model=[% platform.model | uri %]">
                href="[% search_device | none %]&q=[% release.os | uri %]&os=[% release.os | uri %]">
                href="[% search_device | none %]&q=[% release.os_ver | uri %]&os_ver=[% release.os_ver | uri %]">
    var tab = '[% task.tag | html_entity %]'
      var pgtitle = update_page_title('[% tab.tag | html_entity %]');
      copy_navbar_to_sidebar('[% tab.tag | html_entity %]');
      update_browser_history('[% tab.tag | html_entity %]', pgtitle, '');
      update_csv_download_link('search', '[% tab.tag | html_entity %]', '[% tab.provides_csv | html_entity %]');
      do_search(event, '[% tab.tag | html_entity %]');
      var pgtitle = update_page_title('[% tab.tag | html_entity %]');
      copy_navbar_to_sidebar('[% tab.tag | html_entity %]');
      update_browser_history('[% tab.tag | html_entity %]', pgtitle, '');
      update_csv_download_link('device', '[% tab.tag | html_entity %]', '[% tab.provides_csv | html_entity %]');
      $('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag | html_entity %]&reset=on&firstsearch=on&' +
      $('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag | html_entity %]&reset=on&firstsearch=on&' +
      do_search(event, '[% tab.tag | html_entity %]');
      var pgtitle = update_page_title('[% report.tag | html_entity %]');
      update_browser_history('[% report.tag | html_entity %]', pgtitle, '1');
      update_csv_download_link('report', '[% report.tag | html_entity %]', '1');
      do_search(event, '[% report.tag | html_entity %]');
      update_page_title('[% task.tag | html_entity %]');
      update_csv_download_link('admin', '[% task.tag | html_entity %]', '1');
      do_search(event, '[% task.tag | html_entity %]');
      $('#[% params.tab | html_entity %]_submit').click();
      $('#[% params.tab | html_entity %]_form').trigger("submit");
    var tab = '[% tab.tag | html_entity %]'
    var tab = '[% report.tag | html_entity %]'
    var tab = '[% tab.tag | html_entity %]'
  <link rel="shortcut icon" href="[% uri_base | none %]/images/favicon.ico" type="image/x-icon">
  <link rel="icon" href="[% uri_base | none %]/images/favicon.ico" type="image/x-icon">
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery-latest.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery-ui.custom.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery-history.js"></script>
<!--  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery.cookie.js"></script> -->
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery-deserialize.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/bootstrap.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/bootstrap2-toggle.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/underscore.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery.qtip.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/d3-3.5.17.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/d3-force-network-chart.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/toastr.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery.floatThead.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/daterangepicker.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/moment.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/jquery.dataTables.min.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/dataTables.bootstrap.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/dataTables.ip-address-detect.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/dataTables.ip-address-sort.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/he.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/natural.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/portsort.js"></script>
    var uri_base = '[% uri_base | none %]';
    var nd_check_userlog = '[% settings.check_userlog | html_entity %]';
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/netdisco.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/javascripts/netdisco_portcontrol.js"></script>
  <script type="text/javascript" src="[% uri_base | none %]/plugin/[% add_js | none %]/[% add_js | none %].js"></script>
  <link rel="stylesheet" href="[% uri_base | none %]/css/bootstrap.min.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/bootstrap2-toggle.min.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/awesome-bootstrap-checkbox.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/jquery.qtip.min.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/smoothness/jquery-ui.custom.min.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/font-awesome.min.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/toastr.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/d3-force-network-chart.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/netdisco.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/bootstrap-tree.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/daterangepicker-bs2.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/dataTables.bootstrap.css"/>
  <link rel="stylesheet" href="[% uri_base | none %]/css/nd_print.css" media="print"/>
  <link rel="stylesheet" href="[% uri_base | none %]/plugin/[% add_css | none %]/[% add_css | none %].css"/>
      <a class="brand" href="[% uri_for('/') | none %]">Netdisco</a>
          <a href="[% uri_for(ni.path) | none %]">[% ni.label | html_entity %]</a>
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/discoverall') | none %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/arpwalk') | none %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/macwalk') | none %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/nbtwalk') | none %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/expire') | none %]">
            <form method="post" class="nd_inline-form" action="[% uri_for('/admin/stats') | none %]">
      <form class="navbar-search pull-left" method="get" action="[% uri_for('/search') | none %]">
          id="nq" name="q" value="[% display_name | html_entity %]" type="text" autocomplete="off"/>
            <li><a href="[% uri_for('/password') | none %]">Change Password</a></li>
            <li><a href="[% uri_for('/logout') | none %]">Log Out</a></li>
[% content | none %]
        <form class="nd_login-form" method="post" action="[% uri_for('/password') | none %]">
        <div id="[% report.tag | html_entity %]_search" class="tab-pane active">
          <form id="[% report.tag | html_entity %]_form" class="nd_sidebar-form form-stacked"
              method="get" action="[% uri_for('/report') | none %]">
            <script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 1;</script>
            <script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 0;</script>
      <li class="active"><a id="[% report.tag | html_entity %]_link" class="nd_single-tab"
        href="#[% report.tag | html_entity %]_pane">[% report.label | html_entity %]</a></li>
        <a href="[% device_ports | none %]&q=[% params.q | uri %]">[% params.q | html_entity %]</a>
        <a href="[% device_ports | none %]&q=[% params.q | uri %]&f=[% params.f | uri %]">[% params.f | html_entity %]</a>
      <div class="tab-pane active" id="[% report.tag | html_entity %]_pane"></div>
        <div id="[% tab.tag | html_entity %]_search" class="tab-pane [% 'active' IF params.tab == tab.tag %]">
          <form id="[% tab.tag | html_entity %]_form" class="nd_sidebar-form form-stacked" method="get" action="[% uri_for('/search') | none %]">
            <input name="tab" value="[% tab.tag | html_entity %]" type="hidden"/>
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 1;</script>
            <!-- no "[% tab.tag | html_entity %]" search options -->
            <script type="text/javascript">has_sidebar["[% tab.tag | html_entity %]"] = 0;</script>
      <li[% ' class="active"' IF params.tab == tab.tag %]><a id="[% tab.tag | html_entity %]_link" href="#[% tab.tag | html_entity %]_pane">[% tab.label | html_entity %]</a></li>
      <div class="tab-pane[% ' active' IF params.tab == tab.tag %]" id="[% tab.tag | html_entity %]_pane"></div>
                value="[% opt.key | html_entity %]">[% opt.value | html_entity %]</option>
                value="[% loc | html_entity %]">[% loc | html_entity %]</option>
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.mac_format == format %]>[% format | html_entity %]</option>
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.age_num == count %]>[% count | html_entity %]</option>
                      <option[% ' selected="selected"' IF vars.sidebar_defaults.device_ports.age_unit == unit %]>[% unit | html_entity %]</option>
              <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info nd_sidebar-btn-drop">
                        [% size | html_entity %]</option>
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
                <option[% ' selected="selected"' IF vars.sidebar_defaults.report_portutilization.age_num == count %]>[% count | html_entity %]</option>
                <option[% ' selected="selected"' IF vars.sidebar_defaults.report_portutilization.age_unit == unit %]>[% unit | html_entity %]</option>
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
                <option[% ' selected="selected"' IF vars.sidebar_defaults.search_node.mac_format == format %]>[% format | html_entity %]</option>
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">
            <button id="[% tab.tag | html_entity %]_submit" type="submit" class="btn btn-info">