Changeset 266
- Timestamp:
- Sep 15, 2017, 9:27:56 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r265 r266 1483 1483 #my $arrow ='←'; 1484 1484 # $arrow ='⇐' if $computerdb->{$ip}{'switch_port_hr'} =~ m/^(Trk|Br|Po)/; 1485 my $arrow ='&# 8636;';1486 $arrow ='
 602;' if $computerdb->{$ip}{'switch_port_hr'} =~ m/^(Trk|Br|Po)/;1485 my $arrow ='⟵'; 1486 $arrow ='⟸' if $computerdb->{$ip}{'switch_port_hr'} =~ m/^(Trk|Br|Po)/; 1487 1487 1488 1488 my $switch_hostname = $computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'} || 'unkown'; … … 1506 1506 <td sorttable_customkey="$switch_hostname_sort">$switch_hostname</td> 1507 1507 <td class="bklask-port">$parent_port_hr</td> 1508 <td colspan="2">$arrow</td>1508 <td>$arrow</td><td></td> 1509 1509 <td sorttable_customkey="$host_short">$computerdb->{$ip}{'hostname_fq'}</td> 1510 1510 <td sorttable_customkey="$ip_sort">$ip</td> … … 1514 1514 </tr> 1515 1515 END_HTML 1516 # <td colspan="2">$arrow</td> 1516 1517 } 1517 1518 … … 1523 1524 my %db_switch = %{$switch_connection->{'switch_db'}}; 1524 1525 1526 # Output switch connection 1527 LOOP_ON_OUTPUT_SWITCH: 1525 1528 for my $sw (sort keys %db_switch_output_port) { 1526 1529 … … 1535 1538 1536 1539 if (exists $db_switch_parent{$sw}) { 1540 # Link to uplink switch 1541 next LOOP_ON_OUTPUT_SWITCH; 1542 1543 # Do not print anymore 1537 1544 my $mac_address = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'mac_address'}; 1538 1545 my $ipv4_address = $db_switch{$db_switch_parent{$sw}->{'switch'}}->{'ipv4_address'}; … … 1570 1577 } 1571 1578 else { 1579 # Router 1572 1580 my $parent_port_hr = format_aggregator4html($db_switch_output_port{$sw}); 1573 1581 1582 my $host_short = sprintf '%s %3s' ,$sw, $db_switch_output_port{$sw}; 1583 1584 my $mac_address = $db_switch{$sw}->{'mac_address'}; 1585 my $ipv4_address = $db_switch{$sw}->{'ipv4_address'}; 1586 my $timestamp = $db_switch{$sw}->{'timestamp'}; 1587 1588 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $timestamp; 1589 $year += 1900; 1590 $mon++; 1591 my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min; 1592 1593 my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ [\.\*] /xms, $ipv4_address; # \* for fake-ip 1594 1595 my $mac_sort = sprintf '%04i-%s', 9999, $mac_address; 1596 1597 my $vlan = $db_switch{$sw}->{'network'}; 1598 $vlan .= ' ('.get_current_vlan_id($db_switch{$sw}->{'network'}).')' if $db_switch{$sw}->{'network'}; 1599 1600 my $arrow ='⟻'; 1601 $arrow ='⟽' if $db_switch_output_port{$sw} =~ m/^(Trk|Br|Po)/; 1602 1603 print <<"END_HTML"; 1604 <tr class="$typerow"> 1605 <td sorttable_customkey="router">router</td> 1606 <td class="bklask-port"></td> 1607 <td>$arrow</td><td>$parent_port_hr</td> 1608 <td sorttable_customkey="$host_short">$sw</td> 1609 <td sorttable_customkey="$ip_sort">$ipv4_address</td> 1610 <td sorttable_customkey="$mac_sort">$mac_address</td> 1611 <td>$vlan</td> 1612 <td>$date</td> 1613 </tr> 1614 END_HTML 1615 1616 next LOOP_ON_OUTPUT_SWITCH; 1617 1618 # Old print 1574 1619 print <<"END_HTML"; 1575 1620 <tr class="$typerow"> … … 1587 1632 } 1588 1633 1634 # Child switch connection : parent <- child 1589 1635 for my $swport (sort keys %db_switch_connected_on_port) { 1590 1636 my ($sw_connect, $port_connect) = split m/ $SEP_SWITCH_PORT /xms, $swport, 2;
Note: See TracChangeset
for help on using the changeset viewer.