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;
|
private bool isServerSettingsOpen;
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void OpenServerSettings()
|
private async Task OpenServerSettings()
|
||||||
{
|
{
|
||||||
IsSettingsOpen = false;
|
IsSettingsOpen = false;
|
||||||
|
RefreshServers();
|
||||||
IsServerSettingsOpen = true;
|
IsServerSettingsOpen = true;
|
||||||
|
if (_client is { IsConnected: true })
|
||||||
|
await DiscoverServers();
|
||||||
}
|
}
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
@@ -188,7 +191,7 @@ public partial class MainWindowViewModel
|
|||||||
});
|
});
|
||||||
IsConnected = true;
|
IsConnected = true;
|
||||||
_autoReconnect = true;
|
_autoReconnect = true;
|
||||||
ConnectionStatus = Loc.Tr("conn.connectedto");
|
ConnectionStatus = $"{Loc.Tr("conn.connectedto")} {h}:{p}";
|
||||||
// Update the UI to reflect the server actually connected.
|
// Update the UI to reflect the server actually connected.
|
||||||
_syncingServerFields = true;
|
_syncingServerFields = true;
|
||||||
ServerHost = h;
|
ServerHost = h;
|
||||||
|
|||||||
@@ -1164,21 +1164,17 @@
|
|||||||
<TextBlock Text="{Binding Loc[server.title]}"
|
<TextBlock Text="{Binding Loc[server.title]}"
|
||||||
FontSize="18" FontWeight="Bold"/>
|
FontSize="18" FontWeight="Bold"/>
|
||||||
|
|
||||||
<!-- Host + port — Desktop: 3 columns -->
|
<!-- Host + port — Desktop: 2 columns -->
|
||||||
<Grid ColumnDefinitions="*,Auto,Auto" RowDefinitions="Auto,Auto"
|
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto"
|
||||||
IsVisible="{Binding IsDesktop}">
|
IsVisible="{Binding IsDesktop}">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Loc[server.host]}"
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Loc[server.host]}"
|
||||||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Loc[server.port]}"
|
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Loc[server.port]}"
|
||||||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="10,0,0,0" Width="90"/>
|
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}"
|
<TextBox Grid.Row="1" Grid.Column="0" Text="{Binding ServerHost}"
|
||||||
FontFamily="monospace" Margin="0,2,0,0"/>
|
FontFamily="monospace" Margin="0,2,0,0"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ServerPort}"
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ServerPort}"
|
||||||
FontFamily="monospace" Width="90" Margin="10,2,0,0"/>
|
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>
|
</Grid>
|
||||||
<!-- Host + port — Mobile: vertical, larger font -->
|
<!-- Host + port — Mobile: vertical, larger font -->
|
||||||
<StackPanel Spacing="10" IsVisible="{Binding IsMobile}">
|
<StackPanel Spacing="10" IsVisible="{Binding IsMobile}">
|
||||||
@@ -1186,27 +1182,16 @@
|
|||||||
<TextBlock Text="{Binding Loc[server.host]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
<TextBlock Text="{Binding Loc[server.host]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||||
<TextBox Text="{Binding ServerHost}" FontFamily="monospace" FontSize="15"/>
|
<TextBox Text="{Binding ServerHost}" FontFamily="monospace" FontSize="15"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
<StackPanel Spacing="4">
|
||||||
<StackPanel Grid.Column="0" Spacing="4">
|
<TextBlock Text="{Binding Loc[server.port]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||||
<TextBlock Text="{Binding Loc[server.port]}" FontSize="13" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
<TextBox Text="{Binding ServerPort}" FontFamily="monospace" FontSize="15"/>
|
||||||
<TextBox Text="{Binding ServerPort}" FontFamily="monospace" FontSize="15"/>
|
</StackPanel>
|
||||||
</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>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Actions — Desktop: in a row -->
|
<!-- Actions — Desktop: in a row -->
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8" IsVisible="{Binding IsDesktop}">
|
<StackPanel Orientation="Horizontal" Spacing="8" IsVisible="{Binding IsDesktop}">
|
||||||
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
||||||
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"/>
|
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"/>
|
||||||
<Button Content="{Binding Loc[wallet.discover]}"
|
|
||||||
Command="{Binding DiscoverServersCommand}"/>
|
|
||||||
<Button Content="{Binding Loc[wallet.resetcert]}"
|
<Button Content="{Binding Loc[wallet.resetcert]}"
|
||||||
Command="{Binding ResetCertificatesCommand}"/>
|
Command="{Binding ResetCertificatesCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -1215,23 +1200,13 @@
|
|||||||
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
<Button Content="{Binding Loc[wallet.connect]}" Classes="accent"
|
||||||
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"
|
Command="{Binding ConnectAndSyncCommand}" IsEnabled="{Binding !IsSyncing}"
|
||||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
||||||
<Button Content="{Binding Loc[wallet.discover]}"
|
|
||||||
Command="{Binding DiscoverServersCommand}"
|
|
||||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
|
||||||
<Button Content="{Binding Loc[wallet.resetcert]}"
|
<Button Content="{Binding Loc[wallet.resetcert]}"
|
||||||
Command="{Binding ResetCertificatesCommand}"
|
Command="{Binding ResetCertificatesCommand}"
|
||||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Connection status -->
|
<!-- Connection status -->
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
<TextBlock Text="{Binding ConnectionStatus}" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||||
<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>
|
|
||||||
|
|
||||||
<!-- Known servers: click to populate host/port -->
|
<!-- Known servers: click to populate host/port -->
|
||||||
<TextBlock Text="{Binding Loc[server.known]}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
<TextBlock Text="{Binding Loc[server.known]}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user