Changeset 349 for trunk


Ignore:
Timestamp:
Nov 1, 2017, 8:26:40 PM (6 years ago)
Author:
g7moreau
Message:
  • validate w3c html. Move tfoot, remove attribute summary for table and add doctype and title to the page...
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r348 r349  
    17551755
    17561756   print <<'END_HTML';
    1757 <table class="sortable" summary="Klask Host Database">
     1757<table class="sortable">
    17581758 <caption>Klask Host Database</caption>
    17591759 <thead>
     
    17691769  </tr>
    17701770 </thead>
    1771  <tfoot>
    1772   <tr>
    1773    <th scope="col" class="klask-footer-left">Switch</th>
    1774    <th scope="col" class="fklask-port">Port</th>
    1775    <th scope="col" class="fklask-link">Link</th>
    1776    <th scope="col" class="fklask-hostname">Hostname-FQ</th>
    1777    <th scope="col" class="fklask-ipv4">IPv4-Address</th>
    1778    <th scope="col" class="fklask-mac">MAC-Address</th>
    1779    <th scope="col" class="fklask-vlan">VLAN</th>
    1780    <th scope="col" class="klask-footer-right">Date</th>
    1781   </tr>
    1782  </tfoot>
    17831771 <tbody>
    17841772END_HTML
     
    20312019   print <<'END_HTML';
    20322020 </tbody>
     2021 <tfoot>
     2022  <tr>
     2023   <th scope="col" class="klask-footer-left">Switch</th>
     2024   <th scope="col" class="fklask-port">Port</th>
     2025   <th scope="col" class="fklask-link">Link</th>
     2026   <th scope="col" class="fklask-hostname">Hostname-FQ</th>
     2027   <th scope="col" class="fklask-ipv4">IPv4-Address</th>
     2028   <th scope="col" class="fklask-mac">MAC-Address</th>
     2029   <th scope="col" class="fklask-vlan">VLAN</th>
     2030   <th scope="col" class="klask-footer-right">Date</th>
     2031  </tr>
     2032 </tfoot>
    20332033</table>
    20342034END_HTML
     
    22012201
    22022202   print <<'END_HTML';
    2203 <table class="sortable" summary="Klask Bad VLAN ID Database">
    2204  <caption>Klask Bad VLAN ID Database</caption>
     2203<table class="sortable">
     2204 <caption>Klask VLAN ID Mismatch Database</caption>
    22052205 <thead>
    22062206  <tr>
     
    22152215  </tr>
    22162216 </thead>
     2217 <tbody>
     2218END_HTML
     2219
     2220   my $typerow = 'even';
     2221
     2222   for my $item (@result) {
     2223
     2224      $typerow = $typerow eq 'even' ? 'odd' : 'even';
     2225
     2226      my $switch_hostname_sort = format_switchport4sort($item->{'switch'}, $item->{'port_hr'});
     2227      my ( $host_short ) = split m/ \. /xms, $item->{'hostname_fq'};
     2228
     2229      my $vlan_nameid = $item->{'vlan_good'} . ' (' . $item->{'vlan_id'} . ')';
     2230
     2231      fqdn_html_breakable(my $hostname_fq_html = $item->{'hostname_fq'});
     2232
     2233      print <<"END_HTML";
     2234  <tr class="$typerow">
     2235   <td sorttable_customkey="$switch_hostname_sort">$item->{'switch'}</td>
     2236   <td class="bklask-port">$item->{'port_hr'}</td>
     2237   <td>!$item->{'vlan_bad'}</td>
     2238   <td>$vlan_nameid</td>
     2239   <td>$item->{'date_last'}</td>
     2240   <td>$item->{'date_good'}</td>
     2241   <td>$item->{'mac_address'}</td>
     2242   <td sorttable_customkey="$host_short">$hostname_fq_html</td>
     2243  </tr>
     2244END_HTML
     2245      }
     2246   print <<'END_HTML';
     2247 </tbody>
    22172248 <tfoot>
    22182249  <tr>
     
    22272258  </tr>
    22282259 </tfoot>
    2229  <tbody>
    2230 END_HTML
    2231 
    2232    my $typerow = 'even';
    2233 
    2234    for my $item (@result) {
    2235 
    2236       $typerow = $typerow eq 'even' ? 'odd' : 'even';
    2237 
    2238       my $switch_hostname_sort = format_switchport4sort($item->{'switch'}, $item->{'port_hr'});
    2239       my ( $host_short ) = split m/ \. /xms, $item->{'hostname_fq'};
    2240 
    2241       my $vlan_nameid = $item->{'vlan_good'} . ' (' . $item->{'vlan_id'} . ')';
    2242 
    2243       fqdn_html_breakable(my $hostname_fq_html = $item->{'hostname_fq'});
    2244 
    2245       print <<"END_HTML";
    2246   <tr class="$typerow">
    2247    <td sorttable_customkey="$switch_hostname_sort">$item->{'switch'}</td>
    2248    <td class="bklask-port">$item->{'port_hr'}</td>
    2249    <td>!$item->{'vlan_bad'}</td>
    2250    <td>$vlan_nameid</td>
    2251    <td>$item->{'date_last'}</td>
    2252    <td>$item->{'date_good'}</td>
    2253    <td>$item->{'mac_address'}</td>
    2254    <td sorttable_customkey="$host_short">$hostname_fq_html</td>
    2255   </tr>
    2256 END_HTML
    2257       }
    2258    print <<'END_HTML';
    2259  </tbody>
    22602260</table>
    22612261END_HTML
     
    27582758
    27592759   print <<'END_HTML';
    2760 <table class="sortable" summary="Klask Free IP Database">
     2760<table class="sortable">
    27612761 <caption>Klask Free IP Database</caption>
    27622762 <thead>
     
    27682768  </tr>
    27692769 </thead>
     2770 <tbody>
     2771END_HTML
     2772
     2773   my $typerow = 'even';
     2774
     2775   LOOP_ON_IP_ADDRESS:
     2776   for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) {
     2777
     2778      $typerow = $typerow eq 'even' ? 'odd' : 'even';
     2779
     2780      my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ip;
     2781      my ( $host_short ) = split m/ \. /xms, $result_ip{$ip}->{'hostname_fq'};
     2782
     2783      my $vlan_nameid = $result_ip{$ip}->{'vlan'}.' ('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')';
     2784
     2785      fqdn_html_breakable(my $hostname_fq_html = $result_ip{$ip}->{'hostname_fq'});
     2786
     2787      print <<"END_HTML";
     2788  <tr class="$typerow">
     2789   <td sorttable_customkey="$ip_sort">$ip</td>
     2790   <td sorttable_customkey="$host_short">$hostname_fq_html</td>
     2791   <td>$vlan_nameid</td>
     2792   <td>$result_ip{$ip}->{'date_last_detection'}</td>
     2793  </tr>
     2794END_HTML
     2795      }
     2796   print <<'END_HTML';
     2797 </tbody>
    27702798 <tfoot>
    27712799  <tr>
     
    27762804  </tr>
    27772805 </tfoot>
    2778  <tbody>
    2779 END_HTML
    2780 
    2781    my $typerow = 'even';
    2782 
    2783    LOOP_ON_IP_ADDRESS:
    2784    for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) {
    2785 
    2786       $typerow = $typerow eq 'even' ? 'odd' : 'even';
    2787 
    2788       my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ip;
    2789       my ( $host_short ) = split m/ \. /xms, $result_ip{$ip}->{'hostname_fq'};
    2790 
    2791       my $vlan_nameid = $result_ip{$ip}->{'vlan'}.' ('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')';
    2792 
    2793       fqdn_html_breakable(my $hostname_fq_html = $result_ip{$ip}->{'hostname_fq'});
    2794 
    2795       print <<"END_HTML";
    2796   <tr class="$typerow">
    2797    <td sorttable_customkey="$ip_sort">$ip</td>
    2798    <td sorttable_customkey="$host_short">$hostname_fq_html</td>
    2799    <td>$vlan_nameid</td>
    2800    <td>$result_ip{$ip}->{'date_last_detection'}</td>
    2801   </tr>
    2802 END_HTML
    2803       }
    2804    print <<'END_HTML';
    2805  </tbody>
    28062806</table>
    28072807END_HTML
  • trunk/push-web

    r344 r349  
    5050
    5151cat <<END > ${TMP}/index.html
     52<!DOCTYPE html>
    5253<html>
    5354<head>
    5455 <link rel="stylesheet" type="text/css" href="style-klask.css" />
    5556 <meta http-equiv="refresh" content="1800">
     57 <title>Klask mapping net-tools</title>
    5658 <noscript>
    5759 </noscript>
Note: See TracChangeset for help on using the changeset viewer.