From 91014a8420da16fb35e41d6498215983a95fcbbe Mon Sep 17 00:00:00 2001 From: heaven Date: Tue, 16 Jun 2026 22:00:12 +0300 Subject: [PATCH] =?UTF-8?q?feat(ui):=20show=20the=20active=20routing=20sco?= =?UTF-8?q?pe=20under=20the=20server=20card=20so=20the=20=D0=A1=D0=B0?= =?UTF-8?q?=D0=B9=D1=82=D1=8B=20split=20is=20never=20invisible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/vojo/proxy/ui/ConnectionScreen.kt | 29 +++++++++++++++++++ app/src/main/res/values-ru/strings.xml | 4 +++ app/src/main/res/values/strings.xml | 4 +++ 3 files changed, 37 insertions(+) diff --git a/app/src/main/java/chat/vojo/proxy/ui/ConnectionScreen.kt b/app/src/main/java/chat/vojo/proxy/ui/ConnectionScreen.kt index f07b7de..32dc334 100644 --- a/app/src/main/java/chat/vojo/proxy/ui/ConnectionScreen.kt +++ b/app/src/main/java/chat/vojo/proxy/ui/ConnectionScreen.kt @@ -54,6 +54,7 @@ import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.graphics.StrokeJoin import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringArrayResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight @@ -66,6 +67,7 @@ import chat.vojo.proxy.R import chat.vojo.proxy.core.AppSettings import chat.vojo.proxy.core.ProxyConfig import chat.vojo.proxy.core.ProxyType +import chat.vojo.proxy.core.RoutingMode import chat.vojo.proxy.core.formatClock import chat.vojo.proxy.core.formatRate import chat.vojo.proxy.service.VpnState @@ -136,6 +138,11 @@ fun ConnectionScreen( onDisconnect = onDisconnect, ) + if (activeConfig != null) { + Spacer(Modifier.height(10.dp)) + RoutingScopeLine(settings, Modifier.padding(start = 4.dp)) + } + val stale = connected && applied != null && (applied.configId != activeConfig?.id || applied.settings != settings) if (stale) { @@ -302,6 +309,28 @@ private fun ConnToggle( } } +/** + * Subtle line under the server card stating what the proxy actually carries — so the + * "Сайты" split is never invisible (an empty list is now a full tunnel; a non-empty list + * shows how much is proxied vs direct). + */ +@Composable +private fun RoutingScopeLine(settings: AppSettings, modifier: Modifier = Modifier) { + val n = settings.routedSites.size + val text = when { + n == 0 -> stringResource(R.string.route_scope_all) + settings.routingMode == RoutingMode.DIRECT_ALL -> + stringResource(R.string.route_scope_only, pluralStringResource(R.plurals.route_rules, n, n)) + else -> + stringResource(R.string.route_scope_except, pluralStringResource(R.plurals.route_rules, n, n)) + } + Row(modifier, verticalAlignment = Alignment.CenterVertically) { + Box(Modifier.size(5.dp).clip(CircleShape).background(Vojo.fleetSoft.copy(alpha = 0.55f))) + Spacer(Modifier.width(8.dp)) + Text(text, color = Vojo.muted, fontSize = 12.5.sp, maxLines = 1, overflow = TextOverflow.Ellipsis) + } +} + @OptIn(ExperimentalMaterial3Api::class) @Composable private fun ServerPickerSheet( diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index a3a51a3..b3859a1 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -47,6 +47,10 @@ Пик + + Весь трафик через прокси + Через прокси: %1$s + Через прокси, кроме %1$s Добавить сервер diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4f746ed..91f7166 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -54,6 +54,10 @@ Peak /s + + All traffic through the proxy + Through the proxy: %1$s + Through the proxy, except %1$s Add server