|
84 | 84 | @(_status.BinaryDeployed ? "Deployed" : "Not Deployed") |
85 | 85 | </div> |
86 | 86 | </div> |
87 | | - @if (_parsedStatus != null && !string.IsNullOrEmpty(_parsedStatus.Version)) |
| 87 | + @if (_deployedAt.HasValue && (DateTime.UtcNow - _deployedAt.Value).TotalSeconds < 45) |
| 88 | + { |
| 89 | + <div class="metric"> |
| 90 | + <div class="metric-label">Version</div> |
| 91 | + <div class="metric-value"><span class="spinner spinner-sm"></span></div> |
| 92 | + </div> |
| 93 | + } |
| 94 | + else if (_parsedStatus != null && !string.IsNullOrEmpty(_parsedStatus.Version)) |
88 | 95 | { |
89 | 96 | <div class="metric"> |
90 | 97 | <div class="metric-label">Version</div> |
|
504 | 511 | private ParsedDaemonStatus? _parsedStatus; |
505 | 512 | private bool _showVersionWarning; |
506 | 513 | private string _appVersion = ""; |
| 514 | + private DateTime? _deployedAt; |
507 | 515 |
|
508 | 516 | // Rule editing |
509 | 517 | private int? _editingRuleId; // null = not editing, 0 = adding new, >0 = editing existing |
|
852 | 860 | var (success, error) = await DeployService.DeployAsync(progress); |
853 | 861 | _deploySuccess = success; |
854 | 862 | _deployMessage = success ? "WAN Steering deployed successfully." : error; |
855 | | - if (success) _hasUndeployedChanges = false; |
| 863 | + if (success) |
| 864 | + { |
| 865 | + _hasUndeployedChanges = false; |
| 866 | + _showVersionWarning = false; |
| 867 | + // Suppress version check until the new binary has time to start |
| 868 | + // and write its status file (startup grace period is ~30s). |
| 869 | + _deployedAt = DateTime.UtcNow; |
| 870 | + } |
856 | 871 |
|
857 | 872 | await RefreshStatusQuietAsync(); |
858 | 873 | } |
|
1109 | 1124 | _showVersionWarning = false; |
1110 | 1125 | if (_parsedStatus == null) return; |
1111 | 1126 |
|
| 1127 | + // After a deploy, suppress the check for 45s (30s grace + 15s buffer) |
| 1128 | + // to avoid showing a stale warning from the old status file. |
| 1129 | + if (_deployedAt.HasValue && (DateTime.UtcNow - _deployedAt.Value).TotalSeconds < 45) |
| 1130 | + return; |
| 1131 | + |
1112 | 1132 | _appVersion = Assembly.GetExecutingAssembly() |
1113 | 1133 | .GetCustomAttribute<AssemblyInformationalVersionAttribute>() |
1114 | 1134 | ?.InformationalVersion ?? ""; |
|
0 commit comments