Zusammenfassung: Fortschrittsbalken mit Sicherung als eigenem Schritt und Abschluss-Uebersicht; Ports je Netz (#59, #61)
Build / build (push) Canceled after 0s
Build / build (push) Canceled after 0s
- Balken + 'Schritt n von m', Hinweis auf laengere Dauer bei schwacher Hardware, Liste der ausgefuehrten Schritte (auch nach einem Fehler sichtbar), Herzschlag pausiert waehrend des Anwendens (Mac v1.4.0/v1.3.0) - VLAN-Zusammenfassung nennt auch bei getaggten Netzen, worueber sie erreichbar sind Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a4e5b5b1b
commit
69d282569c
3 files changed
+61
-12
No files matched your search
@@ -37,6 +37,16 @@ public partial class SummaryStepViewModel : WizardStepViewModelBase
|
||||
[ObservableProperty]
|
||||
private string? _progressText;
|
||||
|
||||
/// <summary>Fortschrittsbalken: erledigte Schritte inkl. Sicherung (Mac v1.4.0).</summary>
|
||||
[ObservableProperty]
|
||||
private int _progressValue;
|
||||
|
||||
[ObservableProperty]
|
||||
private int _progressMaximum = 1;
|
||||
|
||||
/// <summary>Abschluss-Übersicht: was tatsächlich ausgeführt wurde.</summary>
|
||||
public ObservableCollection<string> CompletedSteps { get; } = [];
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _errorMessage;
|
||||
|
||||
@@ -105,19 +115,29 @@ public partial class SummaryStepViewModel : WizardStepViewModelBase
|
||||
}
|
||||
|
||||
IsApplying = true;
|
||||
_session.IsDeviceBusy = true;
|
||||
ErrorMessage = null;
|
||||
CompletedSteps.Clear();
|
||||
ApplyCommand.NotifyCanExecuteChanged();
|
||||
|
||||
try
|
||||
{
|
||||
ProgressText = "Sicherung wird auf dem Gerät erstellt …";
|
||||
BackupName = await _session.CreateSafetyBackupAsync(_session.Client);
|
||||
|
||||
var actions = GetAllActions();
|
||||
ProgressMaximum = actions.Count + 1;
|
||||
ProgressValue = 0;
|
||||
|
||||
// Die Sicherung ist ein eigener, sichtbarer Schritt.
|
||||
ProgressText = $"Schritt 1 von {ProgressMaximum}: Sicherung auf dem Gerät erstellen";
|
||||
BackupName = await _session.CreateSafetyBackupAsync(_session.Client);
|
||||
CompletedSteps.Add($"Sicherung „{BackupName}“ auf dem Gerät erstellt");
|
||||
ProgressValue = 1;
|
||||
|
||||
for (var i = 0; i < actions.Count; i++)
|
||||
{
|
||||
ProgressText = $"Schritt {i + 1} von {actions.Count}: {actions[i].Description}";
|
||||
ProgressText = $"Schritt {i + 2} von {ProgressMaximum}: {actions[i].Description}";
|
||||
await actions[i].ApplyAsync(_session.Client, CancellationToken.None);
|
||||
CompletedSteps.Add(actions[i].Description);
|
||||
ProgressValue = i + 2;
|
||||
}
|
||||
|
||||
ProgressText = null;
|
||||
@@ -136,6 +156,7 @@ public partial class SummaryStepViewModel : WizardStepViewModelBase
|
||||
finally
|
||||
{
|
||||
IsApplying = false;
|
||||
_session.IsDeviceBusy = false;
|
||||
ApplyCommand.NotifyCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,34 @@
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Abschluss-Übersicht / bisher ausgeführte Schritte (auch nach einem Fehler hilfreich). -->
|
||||
<StackPanel Margin="0,0,0,20">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsFinished}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ErrorMessage, Converter={StaticResource StringToVisibilityConverter}}" Value="Visible">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Text="Ausgeführt" FontWeight="SemiBold" Margin="0,0,0,6" />
|
||||
<ItemsControl ItemsSource="{Binding CompletedSteps}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,3">
|
||||
<ui:SymbolIcon Symbol="Checkmark16" Foreground="{StaticResource MikrotikAccentBrush}" Margin="0,0,8,0" VerticalAlignment="Top" />
|
||||
<TextBlock Text="{Binding}" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Invert}">
|
||||
<TextBlock Text="Das richten wir für dich ein" FontSize="16" FontWeight="SemiBold" Margin="0,0,0,12" />
|
||||
|
||||
@@ -59,10 +87,11 @@
|
||||
Command="{Binding ExportPdfCommand}"
|
||||
Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,16,0,0"
|
||||
Visibility="{Binding IsApplying, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<ui:ProgressRing IsIndeterminate="True" Width="20" Height="20" Margin="0,0,12,0" />
|
||||
<TextBlock Text="{Binding ProgressText}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
||||
<StackPanel Margin="0,16,0,0" Visibility="{Binding IsApplying, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<ProgressBar Value="{Binding ProgressValue}" Maximum="{Binding ProgressMaximum}" Height="6" Margin="0,0,0,8" />
|
||||
<TextBlock Text="{Binding ProgressText}" TextWrapping="Wrap" />
|
||||
<TextBlock Text="Je nach Router-Hardware kann das eine Weile dauern — bitte das Fenster offen lassen." FontSize="12" Margin="0,4,0,0"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMessage}" TextWrapping="Wrap" Foreground="{StaticResource MikrotikRedBrush}" Margin="0,16,0,0"
|
||||
|
||||
@@ -151,10 +151,9 @@ public static class VlanConfigurator
|
||||
.Select(vlan =>
|
||||
{
|
||||
var line = $"„{vlan.Name}\" — ein eigenes, getrenntes Netzwerk ({IpNetworkHelper.GetNetworkCidr(vlan.RouterAddressCidr)}).";
|
||||
if (vlan.AccessPorts is { Count: > 0 } ports)
|
||||
{
|
||||
line += $" Direkt nutzbar über Anschluss {string.Join(", ", ports.Select(p => $"„{p}\""))}.";
|
||||
}
|
||||
line += vlan.AccessPorts is { Count: > 0 } ports
|
||||
? $" Direkt nutzbar über Anschluss {string.Join(", ", ports.Select(p => $"„{p}\""))}."
|
||||
: " Erreichbar über VLAN-fähige Geräte an den Anschlüssen des Heimnetzes (getaggt).";
|
||||
|
||||
return line;
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user