diff --git a/PUBLICATION-AUDIT.json b/PUBLICATION-AUDIT.json index 1adcc7a..33bd265 100644 --- a/PUBLICATION-AUDIT.json +++ b/PUBLICATION-AUDIT.json @@ -910,5 +910,150 @@ ], "SourceOnly": true, "Version": "0.3.4" + }, + "Windows035TrafficTrendsDelta": { + "CandidateSha256": "cd804728119ed9919898d14cd0fc0f0e36e027fa0afcac0e1f6ef6eff6afc41f", + "ExampleEndpointChanges": [ + { + "Count": 4, + "Path": "windows/KnownTailnetEndpoints.cs" + }, + { + "Count": 3, + "Path": "windows/LearningSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/LearningTransportSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/NetworkHandoverSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/PlatformBootstrapTransport.cs" + }, + { + "Count": 5, + "Path": "windows/PlatformBootstrapTransportSelfTest.cs" + }, + { + "Count": 4, + "Path": "windows/PrivateAuxiliaryRouting.cs" + }, + { + "Count": 25, + "Path": "windows/PrivateAuxiliaryRoutingSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/PublicTailnetSelectionSelfTest.cs" + }, + { + "Count": 65, + "Path": "windows/TailnetTransportSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/TransportPlanSelfTest.cs" + }, + { + "Count": 1, + "Path": "windows/ConnectionSelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/GitReleasePolicySelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/InstallationIntegration.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 2, + "Path": "windows/LearningSelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/MainForm.Dashboard.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 2, + "Path": "windows/MainForm.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/PlatformBootstrapTransport.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 6, + "Path": "windows/PlatformBootstrapTransportSelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/PrivateAuxiliaryRouting.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 7, + "Path": "windows/PrivateAuxiliaryRoutingSelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 2, + "Path": "windows/TailnetTransportProbe.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/TailnetTransportSelfTest.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 2, + "Path": "windows/TunConfigBuilder.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/VpnApiClient.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/XrayManager.cs", + "RuleSet": "windows-monitor-20261027" + }, + { + "Count": 1, + "Path": "windows/installer/VPNPlus.nsi", + "RuleSet": "windows-monitor-20261027" + } + ], + "FrozenSha256": "436f20672b19ec5ef64629ccfe41101515f110ff5bd218f279841b4718e7fdc9", + "Omitted": [ + "windows/assets/login-cloud-scene-v1.jpg" + ], + "OptionalUnlicensedSceneRemainsOmitted": true, + "OriginalAcceptanceTransferred": false, + "OriginalSourceManifestSha256": "574f523befd28991f8f98da25cbb3efbcd035080953b286d40958683593afdcb", + "OtherComponentsModified": false, + "PrivateHistoryIncluded": false, + "ProductionAccepted": false, + "PublicBaseCommit": "991b029b371ce42804bd4d7c689a6f756128e8ac", + "PublicDownloadDomainsRetained": [ + "pro.ucvl.cn" + ], + "SourceOnly": true, + "Version": "0.3.5" } } diff --git a/README.md b/README.md index 512c435..5c3f4b3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 纵横家开源源码 -此仓库是无私有 Git 历史的清洁源码快照:Windows 0.3.4、Django 后台及 iPhone/iPad 1.0.2。公司自有代码按 MIT 开源;第三方组件遵守原许可,公司商标及 Logo 不在 MIT 授权范围。Android 保留原 GPL-3.0 公开仓库,不重复拷贝或改换许可。 +此仓库是无私有 Git 历史的清洁源码快照:Windows 0.3.5、Django 后台及 iPhone/iPad 1.0.2。公司自有代码按 MIT 开源;第三方组件遵守原许可,公司商标及 Logo 不在 MIT 授权范围。Android 保留原 GPL-3.0 公开仓库,不重复拷贝或改换许可。 | 目录 | 内容与状态 | | --- | --- | diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index 9005440..8662f8c 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -4,7 +4,7 @@ "ExportDiffersFromOriginalCandidates": true, "FilesBeforeProvenanceAndAudit": { "LICENSE": "b7e94910b8dc377b0a05ccde3c6e5941838dfc15c9dd790078d11728205b524e", - "README.md": "daaf98fb434c1565ed967a48fbf1494e5df8b2fef1377bf5dafb878a6a798679", + "README.md": "0a94bef78ae64402abf281075d68dcba5aafca466d284bb5dd88c492f9924834", "SECURITY.md": "34e56cd9b8f6aa5fee45921c6eb831a542e05e76e41850fc31c44e09de088b3c", "THIRD_PARTY_NOTICES.md": "8c862f2f6b71440616a887e6deb7444a1262cf7d9f144208cc04041c3f9a3371", "android/README.md": "bb4387da9a055e97f33bb29a883c543e0938fa858df3fd744abc80553a5ec65c", @@ -197,9 +197,9 @@ "windows/DailyTrafficChart.cs": "4af8d8a91559e6a3fc1dd56db11f3534606aeb486ff918b2b301db0b82e4c716", "windows/DashboardComboSelfTest.cs": "f1149225e373936f0e90f3f2a5b4fa29179398bba641051fceba1b1cda78b998", "windows/DashboardControls.cs": "55af71aac386053d05a14cb3205083654aff4f00d49b2fa3427e0c81eb57a97b", - "windows/DashboardInteractionSelfTest.cs": "401ca89225426627e10a8d0559daf7aa5f530fbb9e7485feda6affab64ddb255", - "windows/DashboardLayout.cs": "37d24ed2c88d8e81b43d90372147c259ff64be18b962a73e713c84e539ac0fdc", - "windows/DashboardTailnetLayoutSelfTest.cs": "bc4f51bae884e135a183caa7f389a0065d523a52078d7c69b33201996606bd43", + "windows/DashboardInteractionSelfTest.cs": "4fc5d158ad7ec85b9327439c37a7a720a86d6b96ff9aaafe764d31eb035392ea", + "windows/DashboardLayout.cs": "9f49a378af4f81424c0ce3f75e684691ab06f6e1a004fc6c9ab6d982e345c6ef", + "windows/DashboardTailnetLayoutSelfTest.cs": "4a84f4954a0d3075217958f884a45178cff893938a9d3cec0d5d0479a471655f", "windows/DashboardWheelRouter.cs": "d903097a5febbff296febb65855dc10b4e056ea5bb54d2df71b5d1f0297dcc1f", "windows/GitReleasePolicySelfTest.cs": "9e49ba957ab15a5c23d889004b171856c3d523f98cecf10088df4fcd8b577c61", "windows/GitReleaseUpdater.cs": "dcd00a0feca6801aad4e346c7565d8bcd80b3fd24a4accbe5cd4643d04264b9b", @@ -223,14 +223,14 @@ "windows/LearningSyncCoordinatorSelfTest.cs": "471ec344130fe74d892c1115637bd98c517084fc309e982d4d11d3f0ee19403c", "windows/LearningTransportSelfTest.cs": "05dcfd3fcfc6f25e20612c020583eb6c36934c1b251e50e70fcd29501ad0efe7", "windows/MainForm.Chrome.cs": "30dc6520a44a5120c78c472c9fb053e2e4dea8e254b5531d04a5342964969c7a", - "windows/MainForm.Compact.cs": "314157977adfe088c7452322045b718afc9caeb2913bdfa17af756842298027c", - "windows/MainForm.Dashboard.cs": "6b757b2187533fba1dfdc5c012e09d68757049175e026537ffc07ae596b78d3c", + "windows/MainForm.Compact.cs": "2e2835ce952be24fdbe711032aebfe7f046e7c0d1967204d2e9981d9e694d6e1", + "windows/MainForm.Dashboard.cs": "46edae6d3412cee5369287ce67e1951867f728ee0a8f469879287e4c5ebd064b", "windows/MainForm.Handover.cs": "4a914f4de335331f1f9d2397407328f17ae372e9119329e534af218555dc92e6", "windows/MainForm.NextGeneration.cs": "5a1c21e02e304a5135b66160855aba5961d5da7da68041ff1b79be9de4a41916", "windows/MainForm.Selection.cs": "71d3884eb6535b1c8095379585a7479c5d7dd35d00e59da4dabfa673557f17fa", - "windows/MainForm.TailnetTraffic.cs": "432ea16a7f5fe66006530b5b90af6eab59362a2b02685ec2130dadfd43c1652b", + "windows/MainForm.TailnetTraffic.cs": "bc48728563f163cc8553b288bcccd71e7d756f8beb11c13cb486652024c4b8d4", "windows/MainForm.TransportSelection.cs": "7e7bf74f16cb902b71da5a13117db06e9cdf4ea6121511a5ebceaf017bd1f919", - "windows/MainForm.cs": "ce95f896536ea84b2ccab09b8b16c2af0d19497cd27dae136183cd5e36b160b8", + "windows/MainForm.cs": "d515ae6f05f992789b63132a91141dbb6ea50e3d794b86c8174da1396b746687", "windows/NOTICE.md": "8c862f2f6b71440616a887e6deb7444a1262cf7d9f144208cc04041c3f9a3371", "windows/NetworkHandover.cs": "b43548be0051cf92dfd332e537951e4b5083f2a123be8021994513bbc3748d46", "windows/NetworkHandoverSelfTest.cs": "681d0154dc0aa5f49d7ce1f3088b465eea3ed82571b464951df8d4c89cecdf73", @@ -245,8 +245,11 @@ "windows/NodeHealthProbeSelfTest.cs": "512dd9f91ef8c1d645908300b3f1a08c18905caaf7a1174b230b17e963603c62", "windows/NodeMatrixSelfTest.cs": "eed8e56036d300fdffd82b83cca87ea6b2806e8598b2c4fc916aded15197f20d", "windows/NodePresentation.cs": "c70a8be06cce937f309fd10531d97b02b675a72509fff2419e412fbdf84977c0", - "windows/NodeTrafficMonitor.cs": "03bdbb748fee521a6e0d9b08edbf60c5699ae1ebf98ae719d9c45a5cf0962a5a", - "windows/NodeTrafficSelfTest.cs": "fc9a3e318c7b560c96b6e829990cc4b97c25d8283876a0239085db23c17ae34b", + "windows/NodeTrafficBackendFixtures.cs": "e2e2c72e64716f0b6d2e464b6746b33fee8675d05159eb46a377c83cf312403b", + "windows/NodeTrafficMonitor.cs": "8ad43107d2f27d6308500456ecdbc22dc79be08b5f23191044f23591f05783ad", + "windows/NodeTrafficOneSecondSelfTest.cs": "640dc4091dbd0ac3d0b900b49e44d2876b8b1250461a652f50dbfbe4e007f78d", + "windows/NodeTrafficRepaintSelfTest.cs": "06f359e55cc35c73cf53443ff452d57c585c7214ced8f84a9b9e385c2e699bf3", + "windows/NodeTrafficSelfTest.cs": "284086275fbb7f81dbcbff2c7267379402c84cb2e4325658946520cf9b9b518d", "windows/NodeTransportConnector.cs": "91d53471f35470fc9a4578e2819863e56a790cda62a7dbfe891a71149d2386e1", "windows/PhysicalUplink.cs": "b0a0eca6b9f724972d0e445c2dc352326ea4d7357317b98639972d60dadc2e63", "windows/PlatformBootstrapTransport.cs": "0eef4a4272449c0e2adfac2e4652bd9cff9c1b2bc11011ca2049dde2f97e4e2b", @@ -260,7 +263,7 @@ "windows/ProxyProbe.cs": "5d27b5a6c6b192a0c0f3ec4637c5a876a71130497af57f7cb4a04ab4735ca1ec", "windows/PublicTailnetSelection.cs": "68b6dd3d5c77c3253046f9b90e22742c1f2852e07d07157daa296512370fada7", "windows/PublicTailnetSelectionSelfTest.cs": "7b5e7352fe4529e01ce537d488a5cfcc8f5259f98bbe307846cb36a7144cacac", - "windows/README.md": "d422c224a9138709bb5881afb195f2c74b4a288541ae986e19c010621f45be34", + "windows/README.md": "336e690f3b013f36baaca67bcbb70e4eab1c72b38e6084941230e582d7c58be2", "windows/ReplacementContinuitySelfTest.cs": "107878ab2b367f1812377c0b209f6d620da390091c3882e4be53a48e517d86a1", "windows/RouteLeaseSelfTest.cs": "6189c66b9f66c58bed26de4441c58a9ec02b67257bfa04ed66d702acfcd054d9", "windows/RoutingRuleBatches.cs": "9997bfa766fffe7bed7352f307c1f6f118a9be9aa86653eaefae3b2bdaa26c1e", @@ -292,8 +295,8 @@ "windows/UpdateSelfTest.cs": "453165bb611efb8db0d8a8c9ea13f3553e0047aa22b838c43096e3d83fe18771", "windows/UpdateStreamSelfTest.cs": "ad059016c0197f33582b1969ab3280c5b9589a28d659613b3e97ce4a357d38c1", "windows/UsageHistorySeries.cs": "9e7515ceede1899e06116352de79edd6252c921048bcae9958bf9358d93b3069", - "windows/VPNPlus.csproj": "3680b9ce415be4e022ed4786f9f04b8173dbeda96ca1988b39a768dc915094db", - "windows/VpnApiClient.cs": "187829698d9f26b896dbfef596bc71b12a9ed4e014261abde0497e6763e40ae3", + "windows/VPNPlus.csproj": "c81156e80e7d5ceac088c8e167ce3e3f33cc8cdf61a125b905a6761ef2e43221", + "windows/VpnApiClient.cs": "5bb824cd89d4d8fa251f10a66f4c284c58118b773f877aa07c9700fe271216a8", "windows/WindowChrome.cs": "0eceea0879e792b8ae83a74eaf5658d4a7be6a798fbdb026ff8d19fa9aa6af2c", "windows/WindowChromeSelfTest.cs": "c17dd805a0102d12b71a3e32c77ceeb45e303e08612de5d3c5259c78327532be", "windows/XrayManager.cs": "8c87c1d84e42f00528da52ecbe9a0a4ecded445ac50e83442c187536af9555a5", @@ -339,7 +342,8 @@ "windows/release/RELEASE-NOTES-0.3.1.md": "e28a99d049842adc34f593e39bbc33484dd4dfc9e31568cbcb1aef1f3bcd4132", "windows/release/RELEASE-NOTES-0.3.2.md": "29f2030b0be583a541dc0289ee9916d42156cf3bbd823bd5cf7867f097fb2abd", "windows/release/RELEASE-NOTES-0.3.3.md": "18e1f04a925b82668813cb7bde18d29790fa6218d6726887b0ad3cabec253dea", - "windows/release/RELEASE-NOTES-0.3.4.md": "10f0a3edd111932ea92e25581208ac527990b515ee1c73bbd7bd4acba734936f" + "windows/release/RELEASE-NOTES-0.3.4.md": "10f0a3edd111932ea92e25581208ac527990b515ee1c73bbd7bd4acba734936f", + "windows/release/RELEASE-NOTES-0.3.5.md": "4b92799fbd145660732a1748828d03f0defe179709bc77b7e13e9de693ccc304" }, "IosSourceCommit": "b07d085413b1b6370245866fd82271b76590b6d6", "Kind": "clean-history-free-open-source-export", @@ -613,5 +617,18 @@ "SourceOnly": true, "Version": "0.3.4" }, + "Windows035TrafficTrendsDelta": { + "CandidateSha256": "cd804728119ed9919898d14cd0fc0f0e36e027fa0afcac0e1f6ef6eff6afc41f", + "FrozenSha256": "436f20672b19ec5ef64629ccfe41101515f110ff5bd218f279841b4718e7fdc9", + "OptionalUnlicensedSceneRemainsOmitted": true, + "OriginalAcceptanceTransferred": false, + "OriginalSourceManifestSha256": "574f523befd28991f8f98da25cbb3efbcd035080953b286d40958683593afdcb", + "OtherComponentsModified": false, + "PrivateHistoryIncluded": false, + "ProductionAccepted": false, + "PublicBaseCommit": "991b029b371ce42804bd4d7c689a6f756128e8ac", + "SourceOnly": true, + "Version": "0.3.5" + }, "WindowsSourceCommit": "0d463e6af91a3802c564b06dabb6bf86ebff5a38" } diff --git a/windows/DashboardInteractionSelfTest.cs b/windows/DashboardInteractionSelfTest.cs index c46cd62..397070b 100644 --- a/windows/DashboardInteractionSelfTest.cs +++ b/windows/DashboardInteractionSelfTest.cs @@ -114,7 +114,7 @@ internal sealed partial class MainForm && !rows.Rows[0].IntersectsWith(rows.Rows[1]); } checks["monitor_stays_below_speed_without_resizing_window"] = ClientSize == monitorSize - && _nodeTrafficPanel.Top > _dailyCard.Bottom && _nodeTrafficPanel.Bottom < _footer.Top + && _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); diff --git a/windows/DashboardLayout.cs b/windows/DashboardLayout.cs index 9100cac..f29259d 100644 --- a/windows/DashboardLayout.cs +++ b/windows/DashboardLayout.cs @@ -6,8 +6,8 @@ internal readonly record struct DashboardGeometry( Rectangle[] Metrics, Rectangle TrafficCard, Rectangle TailnetTrafficCard, Rectangle SpeedTrendCard, Rectangle DailyCard, Rectangle ServerTrafficCard, Rectangle Footer, int ContentHeight, bool Compact, float VerticalScale); -// All measurements are logical pixels converted exactly once. Every data row -// spans the canvas; the optional transport row borrows height from the plot. +// One fitted page: local proxy trend, per-server trends, then numeric totals. +// Transport selection changes the local chart caption, never the page geometry. internal static class DashboardLayout { internal static DashboardGeometry Calculate(Size viewport, int dpi, bool showTailnet = false, bool showServerTraffic = false, bool preferCompact = false) @@ -27,16 +27,18 @@ internal static class DashboardLayout // The right hand actual-state panel is embedded in the same surface. var actualLeft = width / 2 + S(4); var actual = new Rectangle(actualLeft, 0, width - actualLeft - S(8), configuration.Height); - var traffic = new Rectangle(margin, configuration.Bottom + gap, width, S(24)); - var tailnet = showTailnet ? new Rectangle(margin, traffic.Bottom + gap, width, S(24)) : Rectangle.Empty; - var daily = new Rectangle(margin, (showTailnet ? tailnet.Bottom : traffic.Bottom) + gap, width, S(22)); + var traffic = Rectangle.Empty; + var tailnet = Rectangle.Empty; var footer = new Rectangle(margin, viewport.Height - margin - S(18), width, S(18)); - var servers = showServerTraffic ? new Rectangle(margin, footer.Top - gap - S(38), width, S(38)) : Rectangle.Empty; - var trendTop = daily.Bottom + gap; - var trend = new Rectangle(margin, trendTop, width, Math.Max(S(28), (showServerTraffic ? servers.Top : footer.Top) - gap - trendTop)); + var daily = new Rectangle(margin, footer.Top - gap - S(22), width, S(22)); + var trendTop = configuration.Bottom + gap; + var graphHeight = Math.Max(S(72), daily.Top - gap - trendTop); + var serverHeight = showServerTraffic ? Math.Min(S(100), (int)Math.Round((graphHeight-gap)*.52)) : 0; + var trend = new Rectangle(margin, trendTop, width, graphHeight - (showServerTraffic ? serverHeight+gap : 0)); + var servers = showServerTraffic ? new Rectangle(margin, trend.Bottom+gap, width, serverHeight) : Rectangle.Empty; var headingWidth = S(120); var speedWidth = (width - headingWidth - S(10)) / 2; - Rectangle Speed(int column) => new(headingWidth + column * speedWidth, 0, speedWidth, traffic.Height - S(2)); + Rectangle Speed(int column) => new(headingWidth + column * speedWidth, 0, speedWidth, S(22)); Rectangle Total(int column) => new(headingWidth + column * speedWidth, 0, speedWidth, daily.Height - S(2)); Rectangle[] metrics = [Total(0), Speed(0), Speed(1), Total(1)]; return new(welcome, account, identity, logout, status, configuration, actual, metrics, @@ -53,8 +55,7 @@ internal static class DashboardLayout { var viewport = new Size(width * dpi / 96, height * dpi / 96); var p = Calculate(viewport, dpi, showTailnet, showServers); - Rectangle[] cards = [p.StatusCard,p.NodeCard,p.TrafficCard,p.SpeedTrendCard,p.DailyCard,p.Footer]; - if(showTailnet)cards=[..cards,p.TailnetTrafficCard]; + Rectangle[] cards = [p.StatusCard,p.NodeCard,p.SpeedTrendCard,p.DailyCard,p.Footer]; if(showServers)cards=[..cards,p.ServerTrafficCard]; if (cards.Any(c => c.Left < 0 || c.Right > viewport.Width || c.Bottom > p.ContentHeight || c.Width <= 0 || c.Height<=0)) return false; for (var i = 0; i < cards.Length; i++) @@ -65,19 +66,19 @@ internal static class DashboardLayout if (p.Metrics[0].IntersectsWith(p.Metrics[3]) || p.Metrics[1].IntersectsWith(p.Metrics[2])) return false; for (var i = 0; i < p.Metrics.Length; i++) { - var parent=i==0||i==3?p.DailyCard:p.TrafficCard; + var parent=p.DailyCard; if(!new Rectangle(Point.Empty,parent.Size).Contains(p.Metrics[i]))return false; } - if (!showTailnet && p.TailnetTrafficCard != Rectangle.Empty) return false; + if (p.TrafficCard != Rectangle.Empty || p.TailnetTrafficCard != Rectangle.Empty) return false; if (p.ContentHeight > viewport.Height || p.Footer.Bottom > viewport.Height) return false; var baseline = Calculate(viewport, dpi, false, showServers); if (p.Footer != baseline.Footer || p.ContentHeight != baseline.ContentHeight || p.TrafficCard != baseline.TrafficCard) return false; - if (showTailnet && (p.TailnetTrafficCard.Top <= p.TrafficCard.Bottom || p.DailyCard.Top<=p.TailnetTrafficCard.Bottom)) return false; - if(p.TrafficCard.Width!=p.SpeedTrendCard.Width || p.DailyCard.Height>Sized(40))return false; + if(p.SpeedTrendCard.Width!=p.DailyCard.Width || p.DailyCard.Height>Sized(24))return false; if (p.Metrics[0].Left != p.Metrics[1].Left || p.Metrics[3].Left != p.Metrics[2].Left || p.Metrics[0].Width != p.Metrics[1].Width || p.Metrics[3].Width != p.Metrics[2].Width) return false; if(p.SpeedTrendCard.Height= p.Footer.Top)) return false; + if (p.SpeedTrendCard.Top <= p.NodeCard.Bottom || p.DailyCard.Top<=p.SpeedTrendCard.Bottom) return false; + if (showServers && (p.ServerTrafficCard.Top <= p.SpeedTrendCard.Bottom || p.ServerTrafficCard.Bottom >= p.DailyCard.Top)) return false; int Sized(int n)=>(int)Math.Round(n*Math.Max(1f,dpi/96f)); } return true; diff --git a/windows/DashboardTailnetLayoutSelfTest.cs b/windows/DashboardTailnetLayoutSelfTest.cs index b184323..adfd53c 100644 --- a/windows/DashboardTailnetLayoutSelfTest.cs +++ b/windows/DashboardTailnetLayoutSelfTest.cs @@ -11,8 +11,8 @@ internal sealed partial class MainForm SetTailnetTrafficVisibility(true); SetNodeTrafficPermission(true); LayoutDashboard(); - checks["proxy_speed_row_spans_dashboard"] = _trafficCard.Left == _statusCard.Left - && _trafficCard.Width == _statusCard.Width; + checks["local_speed_trend_spans_dashboard"] = _speedTrendCard.Left == _statusCard.Left + && _speedTrendCard.Width == _statusCard.Width && !_trafficCard.Visible; checks["cumulative_strip_keeps_plot_space"] = _dailyCard.Height <= ScaleLogical(40) && _trafficChart.Width >= ScaleLogical(340) && _speedTrendCard.Height >= ScaleLogical(45); UpdateConnectedTransportPresentation(true); @@ -25,12 +25,11 @@ internal sealed partial class MainForm ClientSize = new Size(ScaleLogical(size.Width), ScaleLogical(size.Height)); SetTailnetTrafficVisibility(false); LayoutDashboard(); var baseline = (_trafficCard.Bounds, _dailyCard.Bounds, _footer.Bounds, _dashboardBody.Size); - checks[$"no_tailnet_single_left_{size.Width}"] = !_tailnetTrafficCard.Visible - && _trafficCard.Width == _statusCard.Width && _speedTrendCard.Top > _dailyCard.Bottom; + checks[$"no_tailnet_one_local_chart_{size.Width}"] = !_tailnetTrafficCard.Visible + && _speedTrendCard.Width == _statusCard.Width && _dailyCard.Top > _speedTrendCard.Bottom; SetTailnetTrafficVisibility(true); - checks[$"tailnet_only_subdivides_left_{size.Width}"] = _tailnetTrafficCard.Left == _trafficCard.Left - && _tailnetTrafficCard.Width == _trafficCard.Width && _tailnetTrafficCard.Top > _trafficCard.Bottom - && _dailyCard.Top > _tailnetTrafficCard.Bottom && _speedTrendCard.Top > _dailyCard.Bottom; + checks[$"tailnet_does_not_duplicate_local_chart_{size.Width}"] = !_tailnetTrafficCard.Visible && !_trafficCard.Visible + && _dailyCard.Top > _speedTrendCard.Bottom; checks[$"tailnet_never_increases_page_{size.Width}"] = _footer.Bounds == baseline.Item3 && _dashboardBody.Size == baseline.Item4 && !_dashboardScrollBar.Visible && _dashboardBody.Location == Point.Empty; checks[$"all_card_controls_fit_{size.Width}"] = DashboardControlsFit(); @@ -79,7 +78,8 @@ internal sealed partial class MainForm checks["tailnet_sample_remains_in_overall_proxy_total"] = _uploadMetric.ValueText == "1.0" && _downloadMetric.ValueText == "2.0" && _tailnetUploadMetric.ValueText == "1.0" && _tailnetDownloadMetric.ValueText == "2.0" && session == (_sessionUp, _sessionDown); - checks["actual_tailnet_transport_shows_section"] = _currentNodeUsesTailnet && _tailnetTrafficVisible; + checks["actual_tailnet_transport_is_identified_without_repeated_row"] = _currentNodeUsesTailnet && _tailnetTrafficVisible + && !_tailnetTrafficCard.Visible; UpdateConnectedTransportPresentation(false); DisplayTraffic(3072, 4096, "公网样本"); checks["public_sample_uses_only_public_speed_section"] = _uploadMetric.ValueText == "3.0" && _downloadMetric.ValueText == "4.0"; diff --git a/windows/MainForm.Compact.cs b/windows/MainForm.Compact.cs index bc05326..57b3af7 100644 --- a/windows/MainForm.Compact.cs +++ b/windows/MainForm.Compact.cs @@ -141,6 +141,7 @@ internal sealed partial class MainForm _routeReadOnly.Bounds=new(S(39),S(23),_modeCard.Width-S(41),S(20)); foreach(var label in new[]{_selectionHeading,_routeHeading,_nodeHeading,_actualModeHeading,_currentNodeLabel}) { label.TextAlign=ContentAlignment.MiddleLeft; label.Padding=Padding.Empty; } + _trafficCard.Visible=_tailnetTrafficCard.Visible=false; _trafficIcon.Visible=_dailyIcon.Visible=_tailnetTrafficIcon.Visible=false; _trafficHeading.Bounds=new(S(10),0,S(106),_trafficCard.Height-S(2)); _dailyHeading.Bounds=new(S(10),0,S(106),_dailyCard.Height-S(2)); @@ -153,12 +154,17 @@ internal sealed partial class MainForm _tailnetUploadMetric.Bounds=_uploadMetric.Bounds; _tailnetDownloadMetric.Bounds=_downloadMetric.Bounds; } - _trendHeading.Bounds=new(S(10),S(2),_speedTrendCard.Width-S(120),S(20)); + _trendHeading.Text="本机代理趋势 · "+(_selectionUiConnected?(_currentNodeUsesTailnet?"Tailscale":"域名入口"):"未连接"); + _trendHeading.Bounds=new(S(10),S(2),_speedTrendCard.Width-S(120),S(18)); _trendHeading.TextAlign=ContentAlignment.MiddleLeft; - _historyRangeCombo.Bounds=new(_speedTrendCard.Width-S(98),S(2),S(88),S(20)); + _historyRangeCombo.Bounds=new(_speedTrendCard.Width-S(98),S(2),S(88),S(18)); + _uploadLegend.Bounds=new(S(10),S(20),(_speedTrendCard.Width-S(20))/2,S(16)); + _downloadLegend.Bounds=new(_uploadLegend.Right,S(20),(_speedTrendCard.Width-S(20))/2,S(16)); + _uploadLegend.TextAlign=_downloadLegend.TextAlign=ContentAlignment.MiddleLeft; + _uploadLegend.Visible=_downloadLegend.Visible=true; _trafficChart.Font=_compactChartFont; - _trafficChart.Bounds=new(S(8),S(24),_speedTrendCard.Width-S(16),Math.Max(S(22),_speedTrendCard.Height-S(28))); - _uploadLegend.Visible=_downloadLegend.Visible=_historyStatus.Visible=false; + _trafficChart.Bounds=new(S(8),S(36),_speedTrendCard.Width-S(16),Math.Max(S(22),_speedTrendCard.Height-S(40))); + _historyStatus.Visible=false; _sampleLabel.Visible=false; _planLabel.Visible=false; _expiryLabel.Bounds=new(0,0,S(96),S(17)); diff --git a/windows/MainForm.Dashboard.cs b/windows/MainForm.Dashboard.cs index 23dce09..51275c7 100644 --- a/windows/MainForm.Dashboard.cs +++ b/windows/MainForm.Dashboard.cs @@ -132,7 +132,11 @@ internal sealed partial class MainForm _historyRangeCombo.SelectedItem = SpeedHistoryPeriod.All[1]; _historyRangeCombo.SelectedIndexChanged += (_, _) => { - if (_historyRangeCombo.SelectedItem is SpeedHistoryPeriod period) _trafficChart.SetPeriodMinutes(period.Minutes); + if (_historyRangeCombo.SelectedItem is SpeedHistoryPeriod period) + { + _trafficChart.SetPeriodMinutes(period.Minutes); + _nodeTrafficPanel.SetPeriodMinutes(period.Minutes); + } }; _speedTrendCard.Controls.AddRange([_historyRangeCombo, _historyStatus]); ConfigureLabel(_planLabel, "", Brand.Font(8.5f), Brand.Muted); @@ -206,7 +210,7 @@ internal sealed partial class MainForm Place(_trafficCard, layout.TrafficCard); Place(_speedTrendCard, layout.SpeedTrendCard); Place(_dailyCard, layout.DailyCard); Place(_footer, layout.Footer); Place(_nodeTrafficPanel, layout.ServerTrafficCard); _tailnetTrafficCard.Bounds=layout.TailnetTrafficCard; - _tailnetTrafficCard.Visible=_tailnetTrafficVisible; + _trafficCard.Visible=_tailnetTrafficCard.Visible=false; _tailnetSampleLabel.Visible=false; LayoutCompactDashboard(layout); } @@ -217,222 +221,132 @@ internal sealed partial class MainForm } } - // Isolated synthetic fixture: no stored account, core, system proxy, update query or installation. + // Isolated synthetic presentation fixture; it never starts a proxy or reads credentials. internal static void RenderPreview() { using var form = new MainForm(preview: true) { Opacity = 0, ShowInTaskbar = false }; form.Show(); form.ShowDashboard(new Profile { - DisplayName = "示例用户", Email = "demo@example.com", IdentityType = "employee", - Subscription = new SubscriptionInfo { Plan = "员工福利", UsedBytes = 17480516895, DeviceLimit = 3 }, - Nodes = [new NodeInfo { Name = "VPN003", Slug = "preview", Status = "online" }], - RouteModes = [new RouteModeInfo { Id = "smart", Name = "AI 智能代理" }], - UsageHistory = Enumerable.Range(0, 7).Select(i => new DailyUsage { Day = DateTime.Today.AddDays(i - 6).ToString("yyyy-MM-dd"), UploadBytes = new long[] { 14000000, 0, 0, 0, 3000000, 35000000, 196000000 }[i], DownloadBytes = new long[] { 28000000, 0, 0, 0, 26000000, 158000000, 126000000 }[i] }).ToList() + DisplayName="示例用户",Email="demo@example.com",IdentityType="employee", + Subscription=new SubscriptionInfo {Plan="员工福利",UsedBytes=276L*1024*1024*1024,DeviceLimit=10}, + Nodes=[new NodeInfo {Name="VPN002",Slug="aliyun-tokyo-002",Status="online"}], + RouteModes=[new RouteModeInfo {Id="smart",Name="AI 智能代理"}] }); form._refreshTimer.Stop(); - var fixtureRanges = UsageHistoryPeriod.All.ToDictionary(p => p.Key, p => new UsageHistorySeries + form.ClientSize=new Size(form.ScaleLogical(480),form.ScaleLogical(360)); + form._currentNodeBaseName="VPN002"; + form.UpdateConnectedTransportPresentation(true); + form.SetConnectionState(true,"已安全连接","VPN002 + Tailscale · AI 智能代理"); + form.DisplayTraffic(1_153_433,64_614,"演示样本 · 近 5 分钟"); + form._sessionMetric.SetBytes(1_883_750_912,hint:"本次连接累计"); + var now=DateTimeOffset.UtcNow; + var serverClock=now; + using var previewServers=new NodeTrafficPanel(()=>serverClock) {Visible=false}; + form._dashboardBody.Controls.Add(previewServers); + var showServerFixture=false; + for(var i=0;i<61;i++) form._trafficChart.Add((1500+Math.Sin(i*.8)*500)*1024, + (i%9==0?1900:80+Math.Sin(i*.4)*35)*1024,now.AddSeconds((i-60)*5)); + form.DisplayTraffic((1500+Math.Sin(60*.8)*500)*1024,(80+Math.Sin(60*.4)*35)*1024,"演示样本 · 近 5 分钟"); + form.LayoutDashboard(); + var checks=new Dictionary { - Bucket = p.Bucket, Note = p.Bucket == "hour" ? "演示数据 · 按上报入账小时;缺口为无明细" : "演示数据 · 月筛选为近30个自然日", - Points = Enumerable.Range(0, p.Count).Select(i => new UsageHistoryPoint - { - Time = p.Bucket == "hour" ? new DateTimeOffset(2026, 9, 9, 21, 0, 0, TimeSpan.FromHours(8)).AddHours(i - p.Count + 1).ToString("O") - : new DateOnly(2026, 9, 9).AddDays(i - p.Count + 1).ToString("yyyy-MM-dd"), - UploadBytes = p.Bucket == "hour" && i == 3 ? null : (long)((Math.Sin(i * .72) + 1.1) * 60_000_000), - DownloadBytes = p.Bucket == "hour" && i == 3 ? null : (long)((Math.Cos(i * .81) + 1.1) * 84_000_000) - }).ToList() - }); - form._currentNodeLabel.Text = "VPN003"; - form.SetConnectionState(true, "已安全连接", "VPN003 · AI 智能代理"); - form.DisplayTraffic(91975, 23357, "21:13:00 · 近 5 分钟"); - form._sessionMetric.SetBytes(130180710, hint: "本次连接累计"); - for (var i = 0; i < 60; i++) form._trafficChart.Add((i % 13 == 0 ? 72 : 8 + Math.Sin(i * 1.8) * 4) * 1024, - (i % 9 == 2 ? 130 : 10 + Math.Sin(i * 2.4) * 8) * 1024, DateTimeOffset.Now.AddSeconds((i - 59) * 5)); - form.LayoutBrandHeader(); form.LayoutDashboard(); - var checks = new Dictionary { ["geometry_112_viewport_dpi_cases"] = DashboardLayout.SelfTest() }; - foreach (var check in UsageHistorySeries.SelfTest()) checks[check.Key] = check.Value; + ["geometry_all_viewport_and_dpi_cases"]=DashboardLayout.SelfTest(), + ["fixed_half_size_window"]=form.ClientSize==new Size(form.ScaleLogical(480),form.ScaleLogical(360)), + ["repeated_proxy_and_tailnet_rows_hidden"]=!form._trafficCard.Visible&&!form._tailnetTrafficCard.Visible, + ["local_graph_caption_identifies_tailnet"]=form._trendHeading.Text.Contains("Tailscale"), + ["local_graph_has_actual_upload_download_values"]=form._uploadLegend.Visible&&form._downloadLegend.Visible + &&form._uploadLegend.Text.Contains("MB/s")&&form._downloadLegend.Text.Contains("KB/s"), + ["totals_numeric_only"]=!form._dailyCard.Controls.OfType().Any(), + ["configuration_actual_state_aligned"]=form._connectionModeCombo.PointToScreen(Point.Empty).Y==form._currentNodeLabel.PointToScreen(Point.Empty).Y, + ["no_dashboard_scroll"]=!form._dashboardScrollBar.Visible&&form._dashboardBody.Location==Point.Empty, + ["controls_fit"]=form.DashboardControlsFit(), + ["half_transparent_surfaces"]=CardPanel.SurfaceAlpha==128 + }; void Capture(string suffix) { - form.PerformLayout(); form.LayoutDashboard(); Application.DoEvents(); - using var image = new Bitmap(form.Width, form.Height); - form.DrawToBitmap(image, new Rectangle(Point.Empty, image.Size)); - image.Save(Path.Combine(AppContext.BaseDirectory, $"preview-{GetDisplayVersion()}-{form.DeviceDpi}dpi-{suffix}.png")); - } - Capture("dashboard"); - checks["default_window_width_and_height_halved"] = form.ClientSize==new Size(form.ScaleLogical(480),form.ScaleLogical(360)); - checks["cumulative_card_has_only_numeric_metrics"] = !form._dailyCard.Controls.OfType().Any() - && form._usageMetric.Parent==form._dailyCard && form._sessionMetric.Parent==form._dailyCard; - checks["proxy_speed_has_independent_trend_card"] = form._trafficChart.Parent==form._speedTrendCard - && form._speedTrendCard.Left==form._trafficCard.Left && form._speedTrendCard.Top>form._trafficCard.Bottom; - - form._currentNodeName = NodePresentation.JinanName; - form._currentNodeLabel.Text = form._currentNodeName; - form.SetConnectionState(true, "已安全连接", form._currentNodeName + " · AI 智能代理"); - Capture("zero3-connected"); - checks["zero3_connected_name_fits"] = TextRenderer.MeasureText(form._currentNodeName, form._currentNodeLabel.Font).Width <= form._currentNodeLabel.Width; - checks["dashboard_controls_within_cards"] = form.DashboardControlsFit(); - checks["footer_slogan_displays_without_company_brand"] = !form._brandHeader.Controls.Contains(form._footerCompanyLogo) - && form._footerCompanyLogo.Parent == form._footer && !form._footerCompanyLogo.Visible; - checks["footer_slogan_text_has_no_url"] = form._footerCompanySite.Visible && form._footerCompanySite.Text == "智能连接 · 高效办公" - && !form._footerCompanySite.Text.Contains("vpn.", StringComparison.OrdinalIgnoreCase) - && !form._footerCompanySite.Text.Contains("://", StringComparison.OrdinalIgnoreCase); - checks["official_header_logo_preserved"] = form._brandHeader.Controls.OfType().Any(logo => logo.Visible && logo.Image is not null - && logo.SizeMode == PictureBoxSizeMode.Zoom && form._brandHeader.ClientRectangle.Contains(logo.Bounds) - && logo.Width >= form.ScaleLogical(30) && logo.Right < form._windowChrome!.MinimizeButton.Left); - checks["product_header_named_zonghengjia"] = form.Text == "纵横家" && form._brandHeader.Controls.OfType