rendered paste bodymenu status,channel,query {
-
Connection:stats
}
dialog stats {
size -1 -1 167 116
title "Connections"
text "Address:"1,4 43 40 17
text "Status:",2,4 60 40 17
text "Network:",3,4 26 48 17
text "Uptime:",4,4 76 35 17
text "",5,50 26 114 17
text "",6,50 43 115 17
text "",7,50 60 115 17
text "",8,50 76 117 17
button "Close",9,60 95 45 20, ok
combo 10,3 3 160 60,drop sort
}
on *:DIALOG:stats:init:*:{
loadcon
coninfo
}
on *:DIALOG:stats:Sclick:10:{
coninfo
}
on *:DIALOG:stats:close:*:{
unset %cst*
}
alias stats { if (!$dialog(stats)) { dialog -m stats stats } | else { dialog -x stats stats } }
alias loadcon {
var %a = $scon(0)
var %b = 1
while (%b <= %a) {
did -ca stats 10 $scon(%b).network
set %cst. [ $+ [ $scon(%b).network ] ] %b
inc %b
}
}
alias coninfo {
var %ntwrk = %cst. [ $+ [ $did(stats,10).seltext ] ]
did -ra $dname 6 $scon(%ntwrk) [ $+ [ .server ] ]
did -ra $dname 7 $scon(%ntwrk) [ $+ [ .status ] ]
did -ra $dname 5 $scon(%ntwrk) [ $+ [ .network ] ]
did -ra $dname 8 $duration($scon(%ntwrk) [ $+ [ .uptime ] ])
}