improve adjacency widget lines when moving nodes (fixes bug #265)

added "docker logs" Observer Widget
(Boeing r1898)
This commit is contained in:
ahrenholz 2014-10-31 17:32:32 +00:00
parent f5e3461903
commit 76889d8411

View file

@ -26,10 +26,10 @@ set widgets_obs_quagga {
6 6
{{OSPFv3 neighbors} {vtysh -c {show ipv6 ospf6 neighbor}}} {{OSPFv3 neighbors} {vtysh -c {show ipv6 ospf6 neighbor}}}
12 13
{{OSPFv3 MDR level} {vtysh -c {show ipv6 ospf6 mdrlevel}}} {{OSPFv3 MDR level} {vtysh -c {show ipv6 ospf6 mdrlevel}}}
13 14
{{PIM neighbors} {vtysh -c {show ip pim neighbor}}} {{PIM neighbors} {vtysh -c {show ip pim neighbor}}}
} }
@ -79,6 +79,8 @@ array set widgets_obs_linux {
{ "firewall rules" "/sbin/iptables -L" } { "firewall rules" "/sbin/iptables -L" }
11 11
{ "IPSec policies" "setkey -DP" } { "IPSec policies" "setkey -DP" }
12
{ "docker logs" "bash -c 'docker logs $(docker ps -q) | tail -20'"}
} }
set widget_loop_ID -1 set widget_loop_ID -1
@ -2048,7 +2050,7 @@ proc exec_adjacency_callback { node execnum cmd result status } {
set a [$c create line $x $y [expr {$o + $x + (($x2 - $x)/2) }] \ set a [$c create line $x $y [expr {$o + $x + (($x2 - $x)/2) }] \
[expr {$o + $y + (($y2 - $y)/2) }] \ [expr {$o + $y + (($y2 - $y)/2) }] \
-fill $color -width 3 \ -fill $color -width 3 \
-tags "adjline $node $peer"] -tags "adjline $node $peer peer_$node2"]
$c lower $a "node && $node" $c lower $a "node && $node"
} else {; # update existing half line } else {; # update existing half line
$c itemconfigure $line -fill $color ;# update the color $c itemconfigure $line -fill $color ;# update the color
@ -2127,18 +2129,13 @@ proc widget_adjacency_move { c node done } {
[expr {$o + $y + (($y2 - $y)/2) }] [expr {$o + $y + (($y2 - $y)/2) }]
$c lower $line "node && $n1" $c lower $line "node && $n1"
# move any half line coming from peer to this moved node # move any half line coming from peer to this moved node
foreach peerline [$c find withtag "adjline && $n2"] { foreach peerline [$c find withtag "adjline && $n2 && peer_$n1"] {
set peer2 [lindex [$c gettags $peerline] 2] set peer2 [lindex [$c gettags $peerline] 1]
if { ![info exists adjacency_cache($peer2)] } { continue } $c coords $peerline $x2 $y2 \
if { $adjacency_cache($peer2) == $node } { [expr {$o + $x2 + (($x - $x2)/2) }] \
$c coords $peerline $x2 $y2 \ [expr {$o + $y2 + (($y - $y2)/2) }]
[expr {$o + $x2 + (($x - $x2)/2) }] \ $c lower $peerline "node && $n2"
[expr {$o + $y2 + (($y - $y2)/2) }] }
$c lower $peerline "node && $n2"
break
}
} ;# end foreach peerline
} ;# end foreach line } ;# end foreach line
if { $done } { set adjacency_lock 0 } if { $done } { set adjacency_lock 0 }