diff --git a/src/NetworkOptimizer.Web/Components/Pages/PerformanceTweaks.razor b/src/NetworkOptimizer.Web/Components/Pages/PerformanceTweaks.razor index bf2ae9d22..101b2e9ea 100644 --- a/src/NetworkOptimizer.Web/Components/Pages/PerformanceTweaks.razor +++ b/src/NetworkOptimizer.Web/Components/Pages/PerformanceTweaks.razor @@ -109,7 +109,7 @@
Active Tweaks
-
@_activeTweakCount / @_compatibleTweaks.Count
+
@_activeTweakCount / @_compatibleTweakSlotCount
@@ -174,7 +174,7 @@ @if (_showFirmwareNotes) {
-
+
@@ -192,11 +192,11 @@ - + - + @@ -827,9 +827,38 @@ private List _compatibleTweaks => _tweakDefs .Where(d => d.IsCompatibleWith(_status?.GatewayModel)).ToList(); - private int _activeTweakCount => _status?.Tweaks.Values - .Count(t => (t.IsActive || t.IsManuallyDeployed) - && _compatibleTweaks.Any(d => d.Id == t.Id)) ?? 0; + // TODO: Remove deduplication when simultaneous SFP port support is working - + // at that point each SFP tweak should count independently. + private int _compatibleTweakSlotCount => _compatibleTweaks + .Where(d => d.MutuallyExclusiveWith == null + || string.Compare(d.Id, d.MutuallyExclusiveWith, StringComparison.Ordinal) < 0) + .Count(); + + private int _activeTweakCount + { + get + { + if (_status == null) return 0; + var activeIds = _status.Tweaks.Values + .Where(t => (t.IsActive || t.IsManuallyDeployed) + && _compatibleTweaks.Any(d => d.Id == t.Id)) + .Select(t => t.Id) + .ToHashSet(); + + // TODO: Remove deduplication when simultaneous SFP port support is working + var counted = new HashSet(); + var count = 0; + foreach (var id in activeIds) + { + var def = _compatibleTweaks.FirstOrDefault(d => d.Id == id); + if (def?.MutuallyExclusiveWith != null && counted.Contains(def.MutuallyExclusiveWith)) + continue; + counted.Add(id); + count++; + } + return count; + } + } private static readonly List _tweakDefs = new() { diff --git a/src/NetworkOptimizer.Web/Services/PerfTweaksDeploymentService.cs b/src/NetworkOptimizer.Web/Services/PerfTweaksDeploymentService.cs index b50a71dd2..dc1247152 100644 --- a/src/NetworkOptimizer.Web/Services/PerfTweaksDeploymentService.cs +++ b/src/NetworkOptimizer.Web/Services/PerfTweaksDeploymentService.cs @@ -92,7 +92,7 @@ public async Task CheckAllStatusAsync() "echo '---MONGO_MOUNTPOINT---'; mountpoint -q /data/unifi/data/db 2>/dev/null && echo 'mounted' || echo 'not-mounted'; " + "echo '---MONGO_FINDMNT---'; findmnt -no SOURCE /data/unifi/data/db 2>/dev/null || echo 'N/A'; " + "echo '---MONGO_SERVICE---'; systemctl is-active unifi-mongodb 2>/dev/null || echo 'inactive'; " + - "echo '---MONGO_SSD_SIZE---'; du -sh /volume*/unifi-db 2>/dev/null | head -1 | cut -f1 || echo 'N/A'; " + + "echo '---MONGO_SSD_SIZE---'; du -sh /volume1/unifi-db /volume/*/unifi-db 2>/dev/null | head -1 | cut -f1 || echo 'N/A'; " + // MongoDB backup $"echo '---MONGO_BACKUP_SCRIPT---'; test -f {OnBootDir}/07-mongodb-ssd-backup.sh && echo 'exists' || echo 'missing'; " + "echo '---MONGO_BACKUP_CRON---'; test -f /etc/cron.d/mongodb-ssd-backup && echo 'exists' || echo 'missing'; " +
UniFi OS Upgrade Boot scripts survive and reapply all tweaks on next bootVerify udm-boot is still enabled: systemctl status udm-bootCheck status indicators here to confirm everything survived
Factory ResetBoot scripts and SSD data may be wipedBoot scripts and custom modules will be wiped; SSD data may be wiped depending on reset options Reinstall udm-boot and redeploy all tweaks