Windows 0.3.3 dashboard layout and speed presentation source delta; no private history or other platform changes
This commit is contained in:
+18
-16
@@ -56,7 +56,7 @@ internal sealed partial class MainForm : Form
|
||||
private readonly Label _statusDetail = new();
|
||||
private readonly Label _nodeHeading = new();
|
||||
private readonly Label _routeHeading = new();
|
||||
private readonly ComboBox _routeCombo = new();
|
||||
private readonly DashboardCombo _routeCombo = new();
|
||||
private readonly RoundedButton _connectButton = new();
|
||||
private readonly RoundedButton _logoutButton = new();
|
||||
private readonly Label _expiryLabel = new();
|
||||
@@ -167,7 +167,7 @@ internal sealed partial class MainForm : Form
|
||||
_updateTimer.Tick += async (_, _) => await CheckForClientUpdateAsync();
|
||||
_updateTimer.Start();
|
||||
_trafficTimer.Tick += async (_, _) => await RefreshTrafficAsync();
|
||||
_healthTimer.Tick += async (_, _) => await MaintainConnectionAsync();
|
||||
_healthTimer.Tick += async (_, _) => { await CheckTailnetReadinessAsync(); await MaintainConnectionAsync(); };
|
||||
_trafficTimer.Start();
|
||||
_healthTimer.Start();
|
||||
InitializeHandover();
|
||||
@@ -537,13 +537,13 @@ internal sealed partial class MainForm : Form
|
||||
var connectedPrivate = false;
|
||||
var connectedTailnet = false;
|
||||
PrivateAuxiliaryNode? connectedEndpoint = null;
|
||||
foreach (var planned in attempts)
|
||||
await foreach (var planned in ExpandTransportsAsync(attempts, route.Id, connectionToken))
|
||||
{
|
||||
var attempt = planned.Attempt;
|
||||
NodeInfo? candidate = attempt.Auxiliary;
|
||||
NodeInfo? candidate = planned.KnownCandidate;
|
||||
try
|
||||
{
|
||||
var candidateResponse = planned.Cached ?? (attempt.Auxiliary is { } auxiliary
|
||||
var candidateResponse = await ConfirmDispatchedTransportAsync(planned, route.Id, connectionToken) ?? planned.Cached ?? (attempt.Auxiliary is { } auxiliary
|
||||
? await _api.GetPrivateAuxiliaryConfigAsync(_accessToken, auxiliary, route.Id, connectionToken)
|
||||
: await _api.GetConfigAsync(
|
||||
_accessToken,
|
||||
@@ -632,6 +632,8 @@ internal sealed partial class MainForm : Form
|
||||
_handover.Reset();
|
||||
_currentNodeLabel.Text = _currentNodeName;
|
||||
_connectionHealth.BeginCore(Environment.TickCount64);
|
||||
_tailnetReadiness.Reset();
|
||||
_tailnetReadiness.TryBegin(ReadTailnetReadinessContext(), Environment.TickCount64, out _);
|
||||
SetConnectionState(true, "已安全连接", $"{_currentNodeName} · {route.Name}" + (connectedPrivate ? " · 私有辅助(TCP)" : ""));
|
||||
_notifyIcon.Text = "纵横家 · 已连接";
|
||||
_notifyIcon.ShowBalloonTip(1800, "纵横家已连接", $"当前线路:{_currentNodeName}", ToolTipIcon.Info);
|
||||
@@ -739,7 +741,7 @@ internal sealed partial class MainForm : Form
|
||||
DisplayTraffic(up / seconds, down / seconds, $"{now.LocalDateTime:HH:mm:ss} · 近 5 分钟");
|
||||
_sessionMetric.SetBytes(_sessionUp + _sessionDown, hint: "本次连接累计");
|
||||
_trafficChart.Add(up/seconds, down/seconds);
|
||||
_historyStatus.Text = "仅本次运行采样 · B/s";
|
||||
_historyStatus.Text = "仅本次运行采样 · KB/s 起";
|
||||
// This is a view of the SAME proxy sample, not a second counter.
|
||||
// A single connected proxy uses either its Tailnet or public ingress.
|
||||
// Do not read the whole Tailscale adapter or add this subset to usage.
|
||||
@@ -1023,6 +1025,7 @@ internal sealed partial class MainForm : Form
|
||||
_windowChrome?.SetLoginMode(true);
|
||||
CenterCards();
|
||||
_dashboardView.Visible = false;
|
||||
if (_welcomeLabel.Parent==_brandHeader) _welcomeLabel.Visible=_logoutButton.Visible=false;
|
||||
_loginView.Visible = true;
|
||||
_loginView.BringToFront();
|
||||
}
|
||||
@@ -1044,6 +1047,7 @@ internal sealed partial class MainForm : Form
|
||||
LayoutDashboard();
|
||||
_loginView.Visible = false;
|
||||
_dashboardView.Visible = true;
|
||||
if (_welcomeLabel.Parent==_brandHeader) _welcomeLabel.Visible=_logoutButton.Visible=true;
|
||||
_dashboardView.BringToFront();
|
||||
_windowChrome?.SetLoginMode(false);
|
||||
}
|
||||
@@ -1078,7 +1082,7 @@ internal sealed partial class MainForm : Form
|
||||
foreach (var route in profile.RouteModes) _routeCombo.Items.Add(route);
|
||||
_routeCombo.EndUpdate();
|
||||
_routeCombo.SelectedItem = profile.RouteModes.FirstOrDefault(route => route.Id == selectedRoute) ?? profile.RouteModes.FirstOrDefault();
|
||||
_routeReadOnly.Text = _routeCombo.Text;
|
||||
_routeReadOnly.Text = _selectionUiConnected ? _routeCombo.Text : "未生效";
|
||||
|
||||
_connectButton.Enabled = _availableNodeCount > 0 && !_busy;
|
||||
if (_availableNodeCount == 0 && !_wantConnected)
|
||||
@@ -1099,9 +1103,9 @@ internal sealed partial class MainForm : Form
|
||||
_connectButton.BackColor = Brand.RoyalBlue;
|
||||
if (!connected) DisplayTraffic(null, null, "未连接 · 仅代理流量");
|
||||
_routeCombo.Enabled = !connected && !_busy;
|
||||
_routeCombo.Visible = !connected;
|
||||
_routeReadOnly.Text = _routeCombo.Text;
|
||||
_routeReadOnly.Visible = connected;
|
||||
_routeCombo.Visible = true;
|
||||
_routeReadOnly.Text = connected ? _routeCombo.Text : "未生效";
|
||||
_routeReadOnly.Visible = true;
|
||||
RefreshSelectionControls();
|
||||
}
|
||||
|
||||
@@ -1411,14 +1415,12 @@ internal sealed partial class MainForm : Form
|
||||
};
|
||||
}
|
||||
|
||||
private static void ConfigureCombo(ComboBox combo, Point location, Size size)
|
||||
private static void ConfigureCombo(DashboardCombo combo, Point location, Size size)
|
||||
{
|
||||
combo.Location = location;
|
||||
combo.Size = size;
|
||||
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
combo.FlatStyle = FlatStyle.Flat;
|
||||
combo.Font = Brand.Font(10);
|
||||
combo.BackColor = Brand.PaleBlue;
|
||||
combo.BackColor = Color.Transparent;
|
||||
combo.ForeColor = Brand.Text;
|
||||
}
|
||||
|
||||
@@ -1538,7 +1540,7 @@ internal class CardPanel : Panel
|
||||
using var shadowPen = new Pen(Color.FromArgb(32, 110, 169, 199), Math.Max(1, 2 * s));
|
||||
g.DrawPath(shadowPen, shadow);
|
||||
using var path = UiGeometry.RoundedRectangle(new Rectangle(1, 1, Width - 3, Height - 5), radius);
|
||||
using var fill = new SolidBrush(Color.FromArgb(SurfaceAlpha, Color.White));
|
||||
using var fill = new SolidBrush(Color.FromArgb(SurfaceAlpha, 238, 247, 255));
|
||||
using var border = new Pen(ScenicStatus ? Color.White : Color.FromArgb(201, 227, 249), Math.Max(1, s * (ScenicStatus ? 1.7f : .75f)));
|
||||
g.FillPath(fill, path);
|
||||
if (ScenicStatus)
|
||||
@@ -1621,7 +1623,7 @@ internal sealed class RoundedCardPanel : Panel
|
||||
state = g.Save();
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
using var path = UiGeometry.RoundedRectangle(new Rectangle(1, 1, Width - 3, Height - 3), Math.Max(8, 12 * DeviceDpi / 96));
|
||||
using var fill = new SolidBrush(Color.FromArgb(SurfaceAlpha, Color.White));
|
||||
using var fill = new SolidBrush(Color.FromArgb(SurfaceAlpha, 238, 247, 255));
|
||||
using var border = new Pen(Color.FromArgb(180, 188, 222, 237), Math.Max(1, DeviceDpi / 96f));
|
||||
g.FillPath(fill, path);
|
||||
g.DrawPath(border, path);
|
||||
|
||||
Reference in New Issue
Block a user