|
|
|
|
@ -256,6 +256,10 @@ private fun MemberDetailCard(
|
|
|
|
|
.padding(8.dp) |
|
|
|
|
.heightIn(max = LocalConfiguration.current.screenHeightDp.dp / 2), |
|
|
|
|
shape = RoundedCornerShape(12.dp), |
|
|
|
|
colors = CardDefaults.cardColors( |
|
|
|
|
containerColor = MaterialTheme.colorScheme.surface, |
|
|
|
|
contentColor = MaterialTheme.colorScheme.onSurface |
|
|
|
|
), |
|
|
|
|
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp) |
|
|
|
|
) { |
|
|
|
|
Column(modifier = Modifier.padding(12.dp).verticalScroll(rememberScrollState())) { |
|
|
|
|
@ -299,7 +303,7 @@ private fun MemberDetailCard(
|
|
|
|
|
text = headerParts.joinToString(" · "), |
|
|
|
|
fontFamily = FontFamily.Monospace, |
|
|
|
|
fontSize = 11.sp, |
|
|
|
|
color = Color(0xFFAEBCC8) |
|
|
|
|
color = MaterialTheme.colorScheme.onSurfaceVariant |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if (isSelf) { |
|
|
|
|
@ -315,7 +319,7 @@ private fun MemberDetailCard(
|
|
|
|
|
text = "[${sk.linksUp}/${sk.linksDown}] ${sk.protocol} ${sk.ifName} ${sk.bindIp}:${sk.port}", |
|
|
|
|
fontFamily = FontFamily.Monospace, |
|
|
|
|
fontSize = 13.sp, |
|
|
|
|
color = Color.DarkGray |
|
|
|
|
color = MaterialTheme.colorScheme.onSurface |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -329,7 +333,7 @@ private fun MemberDetailCard(
|
|
|
|
|
text = "[sock${a.socketId}] ${a.protocol} ${a.address}:${a.port} ${a.roleLabel}", |
|
|
|
|
fontFamily = FontFamily.Monospace, |
|
|
|
|
fontSize = 13.sp, |
|
|
|
|
color = Color.DarkGray |
|
|
|
|
color = MaterialTheme.colorScheme.onSurface |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -345,25 +349,26 @@ private fun MemberDetailCard(
|
|
|
|
|
Row(verticalAlignment = Alignment.CenterVertically) { |
|
|
|
|
Box(Modifier.size(8.dp).clip(CircleShape).background(dcol)) |
|
|
|
|
Spacer(Modifier.width(6.dp)) |
|
|
|
|
Text(lk.protocol, fontFamily = FontFamily.Monospace, fontSize = 12.sp, color = Color(0xFFAEBCC8)) |
|
|
|
|
Text(lk.protocol, fontFamily = FontFamily.Monospace, fontSize = 12.sp, |
|
|
|
|
color = MaterialTheme.colorScheme.onSurfaceVariant) |
|
|
|
|
Spacer(Modifier.width(6.dp)) |
|
|
|
|
Text("${formatAddr(lk.localAddr)}:${lk.localPort}", |
|
|
|
|
modifier = Modifier.weight(1f), |
|
|
|
|
textAlign = TextAlign.Start, |
|
|
|
|
fontFamily = FontFamily.Monospace, fontSize = 13.sp, color = Color.DarkGray) |
|
|
|
|
fontFamily = FontFamily.Monospace, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface) |
|
|
|
|
Spacer(Modifier.width(4.dp)) |
|
|
|
|
Text(arrow, fontWeight = FontWeight.Bold, color = arrowColor, fontSize = 16.sp) |
|
|
|
|
Spacer(Modifier.width(4.dp)) |
|
|
|
|
Text("${formatAddr(lk.remoteAddr)}:${lk.remotePort}", |
|
|
|
|
modifier = Modifier.weight(1f), |
|
|
|
|
textAlign = TextAlign.Start, |
|
|
|
|
fontFamily = FontFamily.Monospace, fontSize = 13.sp, color = Color.DarkGray) |
|
|
|
|
fontFamily = FontFamily.Monospace, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface) |
|
|
|
|
} |
|
|
|
|
val cleanSn = com.utun.chat.data.cleanSocketName(lk.socketName) |
|
|
|
|
if (cleanSn.isNotEmpty()) { |
|
|
|
|
Row { |
|
|
|
|
Spacer(Modifier.width(14.dp)) |
|
|
|
|
Text(cleanSn, fontSize = 12.sp, color = Color(0xFFAEBCC8)) |
|
|
|
|
Text(cleanSn, fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -380,7 +385,7 @@ private fun MemberDetailCard(
|
|
|
|
|
Spacer(Modifier.width(6.dp)) |
|
|
|
|
Text("Direct: ${if (detail.directUp) "UP" else "DOWN"}" + |
|
|
|
|
(if (detail.directUp && detail.bestRtt > 0) " ${detail.bestRtt / 10}ms" else ""), |
|
|
|
|
fontSize = 13.sp, color = Color.DarkGray) |
|
|
|
|
fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (detail.indirectPresence) { |
|
|
|
|
@ -389,7 +394,7 @@ private fun MemberDetailCard(
|
|
|
|
|
.background(if (detail.indirectUp) Color(0xFF81C784) else Color(0xFFFFB4AB))) |
|
|
|
|
Spacer(Modifier.width(6.dp)) |
|
|
|
|
Text("Indirect: ${if (detail.indirectUp) "UP" else "DOWN"}", |
|
|
|
|
fontSize = 13.sp, color = Color.DarkGray) |
|
|
|
|
fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (detail.bgpPresence && detail.bgpNodes > 0) { |
|
|
|
|
@ -398,11 +403,11 @@ private fun MemberDetailCard(
|
|
|
|
|
Spacer(Modifier.width(6.dp)) |
|
|
|
|
Text("BGP: ${detail.bgpNodes} nodes" + |
|
|
|
|
(if (detail.bestRtt > 0) " ${detail.bestRtt / 10}ms" else ""), |
|
|
|
|
fontSize = 13.sp, color = Color.DarkGray) |
|
|
|
|
fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!detail.directPresence && !detail.indirectPresence && !detail.bgpPresence) { |
|
|
|
|
Text("offline", fontSize = 13.sp, color = Color(0xFFAEBCC8)) |
|
|
|
|
Text("offline", fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|