Publish Zonghengjia Windows 0.4.0 client source

This commit is contained in:
2026-11-29 23:48:07 +08:00
parent 308d71021e
commit 7a00f97910
37 changed files with 1722 additions and 511 deletions
+8 -22
View File
@@ -15,7 +15,7 @@ internal static class DashboardInteractionSelfTest
foreach (var check in DashboardComboSelfTest.Check()) checks.Add(check.Key, check.Value);
}
catch (Exception exception) { error = exception.ToString(); }
var passed = error is null && checks.Count >= 43 && checks.Values.All(value => value);
var passed = error is null && checks.Count >= 32 && checks.Values.All(value => value);
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dashboard-interaction-self-test.json"),
JsonSerializer.Serialize(new { passed, checks, error, scope = "owned synthetic WinForms fixture; no physical user-input or production acceptance claim",
network_modified = false, installed_client_modified = false, credentials_loaded = false }, new JsonSerializerOptions { WriteIndented = true }));
@@ -31,8 +31,9 @@ internal sealed partial class MainForm
var profile = new Profile
{
DisplayName = "滚动测试", Email = "fixture@example.invalid",
Nodes = [new NodeInfo { Slug = "fixture", Name = "测试节点" }],
RouteModes = [new RouteModeInfo { Id = "smart", Name = "AI 智能代理" }]
Nodes = [new NodeInfo { Slug = SingleNodeClientPolicy.FixedNodeSlug, Name = "默认线路", Status = "online" }],
RouteModes = [new RouteModeInfo { Id = "smart", Name = "AI 智能代理" },
new RouteModeInfo { Id = "global", Name = "全局代理" }]
};
Show();
ShowDashboard(profile);
@@ -114,29 +115,14 @@ internal sealed partial class MainForm
checks["card_surface_is_half_transparent"] = CardPanel.SurfaceAlpha == 128;
checks["whole_content_composition_disabled"] = !_content.ComposeChildren;
checks["metric_dirty_refresh_clears_previous_digits"] = CheckMetricRefreshPaint();
foreach (var check in CheckTailnetTrafficUi()) checks.Add(check.Key, check.Value);
var monitorSize = ClientSize;
var monitorAccounting = (_sessionUp, _sessionDown, _trafficChart.PointCount);
SetNodeTrafficPermission(true);
SetTailnetTrafficVisibility(true);
LayoutDashboard();
Application.DoEvents();
using (var monitorFont = Brand.Font(7.5f))
using (var monitorGraphics = _nodeTrafficPanel.CreateGraphics())
{
var monitorTextHeight = TextRenderer.MeasureText(monitorGraphics, "VPN002 上传", monitorFont).Height;
var rows = NodeTrafficPanel.TextLayout(_nodeTrafficPanel.ClientSize, DeviceDpi, monitorTextHeight);
checks["monitor_two_native_dpi_text_rows_fit"] = rows.Rows.All(row => row.Height >= monitorTextHeight)
&& !rows.Rows[0].IntersectsWith(rows.Rows[1]);
}
checks["monitor_stays_below_speed_without_resizing_window"] = ClientSize == monitorSize
&& _nodeTrafficPanel.Top > _speedTrendCard.Bottom && _nodeTrafficPanel.Bottom < _dailyCard.Top
&& !_dashboardScrollBar.Visible && _dashboardBody.Top == 0;
checks["monitor_does_not_overflow_other_controls"] = DashboardControlsFit();
checks["monitor_does_not_change_personal_proxy_accounting"] = monitorAccounting == (_sessionUp, _sessionDown, _trafficChart.PointCount);
SetNodeTrafficPermission(false);
SetTailnetTrafficVisibility(false);
checks["monitor_revoked_hides_and_stops_timer"] = !_nodeTrafficPanel.Visible && !_nodeTrafficTimer.Enabled;
checks["server_monitor_cannot_be_enabled"] = !_canViewNodeTraffic && !_nodeTrafficPanel.Visible && !_nodeTrafficTimer.Enabled;
checks["tailnet_row_cannot_be_enabled"] = !_tailnetTrafficVisible && !_tailnetTrafficCard.Visible;
checks["single_node_controls_only_show_proxy_mode"] = !_connectionModeCombo.Visible && !_manualNodeCombo.Visible
&& !_currentNodeLabel.Visible && _routeCombo.Visible;
var emptyProfile = new Profile { RouteModes = profile.RouteModes };
_wantConnected = true;