Windows 0.3.1 clean monitor source delta; no private history or other platform changes

This commit is contained in:
2026-10-27 02:00:33 +00:00
parent 366b3c5c9a
commit 1cf54a46e4
40 changed files with 983 additions and 206 deletions
+13 -7
View File
@@ -94,7 +94,8 @@ internal sealed partial class MainForm
_routeReadOnly.Visible = false;
_modeCard.Controls.AddRange([_modeIcon, _routeHeading, _routeCombo, _routeReadOnly]);
ConfigureLabel(_trafficHeading, "代理实时速度", Brand.Font(9.5f, FontStyle.Bold), Brand.Text);
ConfigureLabel(_trafficHeading, "公网入口速度", Brand.Font(9.5f, FontStyle.Bold), Brand.Text);
_trafficCard.AccessibleDescription = "仅当前纵横家使用域名或公网入口的代理速度;Tailscale 入口速度另列,非整机流量。";
ConfigureLabel(_dailyHeading, "速度与累计", Brand.Font(9.5f, FontStyle.Bold), Brand.Text);
ConfigureLabel(_sampleLabel, "仅代理流量 · 近 5 分钟", Brand.Font(7.5f), Brand.Muted);
_sampleLabel.TextAlign = ContentAlignment.MiddleRight;
@@ -139,7 +140,7 @@ internal sealed partial class MainForm
_footerPoem.TextAlign = ContentAlignment.MiddleRight;
_footerCompanyLogo.Image = LoadCompanyLogo();
_footerCompanyLogo.SizeMode = PictureBoxSizeMode.Zoom;
ConfigureLabel(_footerCompanySite, "vpn.toplc.cn", Brand.Font(8), Brand.Muted);
ConfigureLabel(_footerCompanySite, "vpn.example.invalid", Brand.Font(8), Brand.Muted);
_footerCompanyLogo.BackColor = Color.Transparent;
_footer.Controls.AddRange([_planLabel, _expiryLabel, _footerHint, _footerPoem, _footerCompanyLogo, _footerCompanySite]);
foreach (var card in new CardPanel[] { _statusCard, _nodeCard, _modeCard, _trafficCard, _dailyCard })
@@ -151,6 +152,7 @@ internal sealed partial class MainForm
_trafficCard.Controls.AddRange([_uploadMetric, _downloadMetric]);
_dailyCard.Controls.AddRange([_usageMetric, _sessionMetric]);
BuildTailnetTrafficCard();
BuildNodeTrafficMonitor();
_dashboardBody.Controls.Add(_footer);
foreach (var label in new[] { _welcomeLabel, _accountLabel, _statusTitle, _statusDetail, _currentNodeLabel, _planLabel, _expiryLabel })
{
@@ -166,8 +168,11 @@ internal sealed partial class MainForm
private void DisplayTraffic(double? upload, double? download, string sampling)
{
_uploadMetric.SetBytes(upload, speed: true, hint: "");
_downloadMetric.SetBytes(download, speed: true, hint: "");
var publicUpload = _currentNodeUsesTailnet ? null : upload;
var publicDownload = _currentNodeUsesTailnet ? null : download;
var hint = _currentNodeUsesTailnet ? "未使用公网入口" : "";
_uploadMetric.SetBytes(publicUpload, speed: true, hint: hint);
_downloadMetric.SetBytes(publicDownload, speed: true, hint: hint);
_sampleLabel.Text = sampling;
_uploadLegend.Text = upload.HasValue ? $"● 上传 {FormatBytes((long)upload.Value)}/s" : "● 上传 —";
_downloadLegend.Text = download.HasValue ? $"● 下载 {FormatBytes((long)download.Value)}/s" : "● 下载 —";
@@ -180,12 +185,12 @@ internal sealed partial class MainForm
{
if (_layingOutDashboard || _dashboardView.ClientSize.Width <= 0) return;
_layingOutDashboard = true;
Control[] layoutContainers = [_dashboardView, _dashboardBody, _statusCard, _nodeCard, _modeCard, _trafficCard, _tailnetTrafficCard, _dailyCard, _footer];
Control[] layoutContainers = [_dashboardView, _dashboardBody, _statusCard, _nodeCard, _modeCard, _trafficCard, _tailnetTrafficCard, _dailyCard, _nodeTrafficPanel, _footer];
foreach (var container in layoutContainers) container.SuspendLayout();
try
{
var viewport = _dashboardView.ClientSize;
var layout = DashboardLayout.Calculate(viewport, DeviceDpi, _tailnetTrafficVisible);
var layout = DashboardLayout.Calculate(viewport, DeviceDpi, _tailnetTrafficVisible, _canViewNodeTraffic);
var titleSize = 17f * Math.Max(.7f, layout.VerticalScale);
if (Math.Abs(_statusTitle.Font.Size - titleSize) > .1f)
{
@@ -205,6 +210,7 @@ internal sealed partial class MainForm
var metrics = new[] { _usageMetric, _uploadMetric, _downloadMetric, _sessionMetric };
for (var i = 0; i < 4; i++) Place(metrics[i], layout.Metrics[i]);
Place(_trafficCard, layout.TrafficCard); Place(_dailyCard, layout.DailyCard); Place(_footer, layout.Footer);
Place(_nodeTrafficPanel, layout.ServerTrafficCard);
LayoutTailnetTrafficCard(layout.TailnetTrafficCard, layout.VerticalScale);
_statusDot.Bounds = R(24, 15, 42, 46);
@@ -226,7 +232,7 @@ internal sealed partial class MainForm
_routeCombo.Bounds = new(ScaleLogical(54), Y(33), _modeCard.Width - ScaleLogical(70), Y(28));
_routeReadOnly.Bounds = new(_routeCombo.Left, _routeCombo.Top, _routeCombo.Width, Y(28));
_trafficIcon.Bounds = R(15, 10, 20, 20); _dailyIcon.Bounds = R(15, 10, 20, 20);
_trafficHeading.Bounds = R(42, 8, 92, 26);
_trafficHeading.Bounds = R(42, 8, 150, 26);
_dailyHeading.Bounds = new(ScaleLogical(42), Y(8), Math.Max(1, _dailyCard.Width - ScaleLogical(166)), Y(26));
_historyRangeCombo.Bounds = new(_dailyCard.Width - ScaleLogical(120), Y(8), ScaleLogical(106), Y(26));
_trafficChart.Bounds = new(ScaleLogical(10), Y(127), _dailyCard.Width - ScaleLogical(20), Y(105));