forked from KNEMC/KLALB
KLALB2.3
This commit is contained in:
@@ -8,6 +8,8 @@ import java.awt.Color;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.LineBorder;
|
||||
|
||||
import org.kne.cloud.network.monitor.MonitorData;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -50,11 +52,7 @@ public class TPanel extends JPanel {
|
||||
setLayout(new BorderLayout(0, 0));
|
||||
|
||||
tname = new JLabel();
|
||||
if(t.getSocketAddress()!=null) {
|
||||
tname.setText(t.getSocketAddress().toString());
|
||||
}else {
|
||||
tname.setText(t.getKplink().toString());
|
||||
}
|
||||
tname.setText(t.getMonitor().getName());
|
||||
tname.setFont(new Font("宋体", Font.BOLD, 16));
|
||||
add(tname, BorderLayout.WEST);
|
||||
|
||||
@@ -108,13 +106,13 @@ public class TPanel extends JPanel {
|
||||
|
||||
public void updateTraffic() {
|
||||
switch (tunnel.getMonitor().getState()) {
|
||||
case Monitor.OFFLINE:
|
||||
case MonitorData.OFFLINE:
|
||||
tname.setForeground(Color.RED);
|
||||
break;
|
||||
case Monitor.CONNECTING:
|
||||
case MonitorData.CONNECTING:
|
||||
tname.setForeground(Color.YELLOW);
|
||||
break;
|
||||
case Monitor.ONLINE:
|
||||
case MonitorData.ONLINE:
|
||||
tname.setForeground(Color.GREEN);
|
||||
break;
|
||||
default:
|
||||
@@ -124,7 +122,7 @@ public class TPanel extends JPanel {
|
||||
down = tunnel.getMonitor().getInTraffic();
|
||||
this.ups = tunnel.getMonitor().getOutSpeed();
|
||||
this.downs = tunnel.getMonitor().getInSpeed();
|
||||
this.delay = tunnel.getMonitor().getLatencyAvg();
|
||||
this.delay = tunnel.getMonitor().getLatency();
|
||||
//System.out.println(delay);
|
||||
updateText();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user