Changeset 163


Ignore:
Timestamp:
Jun 10, 2016, 12:00:07 AM (8 years ago)
Author:
g7moreau
Message:
  • Change arrow in html table
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r162 r163  
    12431243   <th scope="col" class="klask-footer-left">Switch</th>
    12441244   <th scope="col" class="fklask-port">Port</th>
    1245    <th scope="col" class="fklask-link">Link</th>
     1245   <th scope="col" class="fklask-link" colspan="2">Link</th>
    12461246   <th scope="col" class="fklask-hostname">Hostname-FQ</th>
    12471247   <th scope="col" class="fklask-ipv4">IPv4-Address</th>
     
    12811281      $typerow = $typerow eq 'even' ? 'odd' : 'even';
    12821282
     1283      my $arrow ='&#8592;';
     1284         $arrow ='&#8656;' if $computerdb->{$ip}{switch_port_hr} =~ m/^(Trk|Br|Po)/;
     1285
    12831286      my $switch_hostname = $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description} || 'unkown';
    12841287      chomp $switch_hostname;
     
    12981301   <td sorttable_customkey="$switch_hostname_sort">$switch_hostname</td>
    12991302   <td class="bklask-port">$computerdb->{$ip}{switch_port_hr}</td>
    1300    <td><-------</td>
     1303   <td colspan="2">$arrow</td>
    13011304   <td sorttable_customkey="$host_short">$computerdb->{$ip}{hostname_fq}</td>
    13021305   <td sorttable_customkey="$ip_sort">$ip</td>
     
    13211324      $typerow = $typerow eq 'even' ? 'odd' : 'even';
    13221325
     1326      my $arrow ='&#8702;';
     1327         $arrow ='&#8680;' if $db_switch_output_port{$sw} =~ m/^(Trk|Br|Po)/;
     1328
    13231329      if (exists $db_switch_parent{$sw}) {
    1324 
    1325       my $mac_address = $db_switch{$db_switch_parent{$sw}->{switch}}->{mac_address};
    1326       my $ipv4_address = $db_switch{$db_switch_parent{$sw}->{switch}}->{ipv4_address};
    1327       my $timestamp = $db_switch{$db_switch_parent{$sw}->{switch}}->{timestamp};
    1328 
    1329       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
    1330       $year += 1900;
    1331       $mon++;
    1332       my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
    1333 
    1334       my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ipv4_address;
    1335 
    1336       my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
    1337 
    1338       my ( $host_short ) = sprintf '%s %3s' , split(m/ \. /xms, $db_switch_parent{$sw}->{switch}, 1), $db_switch_parent{$sw}->{port_hr};
    1339 
    1340       print <<"END_HTML";
     1330         my $mac_address = $db_switch{$db_switch_parent{$sw}->{switch}}->{mac_address};
     1331         my $ipv4_address = $db_switch{$db_switch_parent{$sw}->{switch}}->{ipv4_address};
     1332         my $timestamp = $db_switch{$db_switch_parent{$sw}->{switch}}->{timestamp};
     1333
     1334         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
     1335         $year += 1900;
     1336         $mon++;
     1337         my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
     1338
     1339         my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ipv4_address;
     1340
     1341         my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
     1342
     1343         my ( $host_short ) = sprintf '%s %3s' , split(m/ \. /xms, $db_switch_parent{$sw}->{switch}, 1), $db_switch_parent{$sw}->{port_hr};
     1344
     1345         print <<"END_HTML";
    13411346  <tr class="$typerow">
    13421347   <td sorttable_customkey="$switch_hostname_sort">$sw</td>
    13431348   <td class="bklask-port">$db_switch_output_port{$sw}</td>
    1344    <td>+--> $db_switch_parent{$sw}->{port_hr}</td>
     1349   <td>$arrow</td></td>$db_switch_parent{$sw}->{port_hr}</td>
    13451350   <td sorttable_customkey="$host_short">$db_switch_parent{$sw}->{switch}</td>
    13461351   <td sorttable_customkey="$ip_sort">$ipv4_address</td>
     
    13561361   <td sorttable_customkey="$switch_hostname_sort">$sw</td>
    13571362   <td class="bklask-port">$db_switch_output_port{$sw}</td>
    1358    <td>+--></td>
     1363   <td>$arrow</td></td></td>
    13591364   <td sorttable_customkey="router">router</td>
    13601365   <td sorttable_customkey="999999999999"></td>
     
    13731378         my $switch_hostname_sort = sprintf '%s %3s' ,$sw_connect, $port_connect;
    13741379
    1375       my $mac_address = $db_switch{$sw}->{mac_address};
    1376       my $ipv4_address = $db_switch{$sw}->{ipv4_address};
    1377       my $timestamp = $db_switch{$sw}->{timestamp};
    1378 
    1379       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
    1380       $year += 1900;
    1381       $mon++;
    1382       my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year,$mon,$mday,$hour,$min;
    1383 
    1384       my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ipv4_address;
    1385 
    1386       my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
    1387 
    1388       $typerow = $typerow eq 'even' ? 'odd' : 'even';
     1380         my $mac_address = $db_switch{$sw}->{mac_address};
     1381         my $ipv4_address = $db_switch{$sw}->{ipv4_address};
     1382         my $timestamp = $db_switch{$sw}->{timestamp};
     1383
     1384         my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp;
     1385         $year += 1900;
     1386         $mon++;
     1387         my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year,$mon,$mday,$hour,$min;
     1388
     1389         my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ipv4_address;
     1390
     1391         my $mac_sort = sprintf '%04i-%s', 9999, $mac_address;
     1392
     1393         $typerow = $typerow eq 'even' ? 'odd' : 'even';
     1394
     1395         my $arrow ='&#8701;';
     1396            $arrow ='&#8678;' if $port_connect =~ m/^(Trk|Br|Po)/;
    13891397
    13901398         if (exists $db_switch_output_port{$sw}) {
     
    13961404   <td sorttable_customkey="$switch_hostname_sort">$sw_connect</td>
    13971405   <td class="bklask-port">$port_connect</td>
    1398    <td>&lt;--+ $db_switch_output_port{$sw}</td>
     1406   <td>$arrow</td><td>$db_switch_output_port{$sw}</td>
    13991407   <td sorttable_customkey="$host_short">$sw</td>
    14001408   <td sorttable_customkey="$ip_sort">$ipv4_address</td>
     
    14101418   <td sorttable_customkey="$switch_hostname_sort">$sw_connect</td>
    14111419   <td class="bklask-port">$port_connect</td>
    1412    <td>&lt;--+</td>
     1420   <td>$arrow</td><td></td>
    14131421   <td sorttable_customkey="$sw">$sw</td>
    14141422   <td sorttable_customkey="">$ipv4_address</td>
Note: See TracChangeset for help on using the changeset viewer.