feat(ui): simplify server panel — remove TLS/Discover, show full address in status
- Removed TLS checkbox (SSL still used internally, just not exposed in UI)
- Removed "Discover servers" button (discovery now runs automatically on panel open)
- ConnectionStatus now includes host:port when connected ("Connesso a ip:porta")
- Replaced status ellipse+text with a single TextBlock
This commit is contained in:
@@ -31,10 +31,13 @@ public partial class MainWindowViewModel
|
||||
private bool isServerSettingsOpen;
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenServerSettings()
|
||||
private async Task OpenServerSettings()
|
||||
{
|
||||
IsSettingsOpen = false;
|
||||
RefreshServers();
|
||||
IsServerSettingsOpen = true;
|
||||
if (_client is { IsConnected: true })
|
||||
await DiscoverServers();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -188,7 +191,7 @@ public partial class MainWindowViewModel
|
||||
});
|
||||
IsConnected = true;
|
||||
_autoReconnect = true;
|
||||
ConnectionStatus = Loc.Tr("conn.connectedto");
|
||||
ConnectionStatus = $"{Loc.Tr("conn.connectedto")} {h}:{p}";
|
||||
// Update the UI to reflect the server actually connected.
|
||||
_syncingServerFields = true;
|
||||
ServerHost = h;
|
||||
|
||||
@@ -1164,21 +1164,17 @@
|
||||
<TextBlock Text="{Binding Loc[server.title]}"
|
||||
FontSize="18" FontWeight="Bold"/>
|
||||
|
||||
<!-- Host + port — Desktop: 3 columns -->
|
||||
<Grid ColumnDefinitions="*,Auto,Auto" RowDefinitions="Auto,Auto"
|
||||
<!-- Host + port — Desktop: 2 columns -->
|
||||
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto"
|
||||
IsVisible="{Binding IsDesktop}">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Loc[server.host]}"
|
||||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Loc[server.port]}"
|
||||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="10,0,0,0" Width="90"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="2" Text="TLS"
|
||||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="10,0,0,0"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="0" Text="{Binding ServerHost}"
|
||||
FontFamily="monospace" Margin="0,2,0,0"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ServerPort}"
|
||||
FontFamily="monospace" Width="90" Margin="10,2,0,0"/>
|
||||
<CheckBox Grid.Row="1" Grid.Column="2" IsChecked="{Binding UseSsl}"
|
||||
Margin="10,2,0,0" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<!-- Host + port — Mobile: vertical, larger font -->
|
||||
<StackPanel Spacing="10" IsVisible="{Binding IsMobile}">
|
||||
@@ -1186,27 +1182,16 @@
|
||||
<TextBlock Text="{Binding Loc[server.host]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBox Text="{Binding ServerHost}" FontFamily="monospace" FontSize="15"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0" Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[server.port]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBox Text="{Binding ServerPort}" FontFamily="monospace" FontSize="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Spacing="4" Margin="20,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="TLS" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<CheckBox IsChecked="{Binding UseSsl}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[server.port]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBox Text="{Binding ServerPort}" FontFamily="monospace" FontSize="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Actions — Desktop: in a row -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" IsVisible="{Binding IsDesktop}">
|
||||
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
||||
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"/>
|
||||
<Button Content="{Binding Loc[wallet.discover]}"
|
||||
Command="{Binding DiscoverServersCommand}"/>
|
||||
<Button Content="{Binding Loc[wallet.resetcert]}"
|
||||
Command="{Binding ResetCertificatesCommand}"/>
|
||||
</StackPanel>
|
||||
@@ -1215,23 +1200,13 @@
|
||||
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
||||
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
||||
<Button Content="{Binding Loc[wallet.discover]}"
|
||||
Command="{Binding DiscoverServersCommand}"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
||||
<Button Content="{Binding Loc[wallet.resetcert]}"
|
||||
Command="{Binding ResetCertificatesCommand}"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Connection status -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Ellipse Width="10" Height="10" Fill="{DynamicResource SuccessBrush}" VerticalAlignment="Center"
|
||||
IsVisible="{Binding IsConnected}"/>
|
||||
<Ellipse Width="10" Height="10" Fill="{DynamicResource DangerBrush}" VerticalAlignment="Center"
|
||||
IsVisible="{Binding !IsConnected}"/>
|
||||
<TextBlock Text="{Binding ConnectionStatus}" Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding ConnectionStatus}" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
|
||||
<!-- Known servers: click to populate host/port -->
|
||||
<TextBlock Text="{Binding Loc[server.known]}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
|
||||
Reference in New Issue
Block a user