| | 2 | 1 | | <UserControl xmlns="https://github.com/avaloniaui" |
| | | 2 | | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| | | 3 | | xmlns:vm="using:LOCKnet.App.ViewModels" |
| | | 4 | | xmlns:mi="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" |
| | | 5 | | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| | | 6 | | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| | | 7 | | mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="600" |
| | | 8 | | x:Class="LOCKnet.App.Views.CredentialDetailView" |
| | | 9 | | x:DataType="vm:CredentialDetailViewModel" |
| | 1 | 10 | | x:Name="ROOT" |
| | 1 | 11 | | Background="{StaticResource BrushBg}"> |
| | | 12 | | |
| | | 13 | | <Design.DataContext> |
| | | 14 | | <vm:CredentialDetailViewModel/> |
| | | 15 | | </Design.DataContext> |
| | | 16 | | |
| | 2 | 17 | | <Grid RowDefinitions="*"> |
| | 3 | 18 | | <ScrollViewer Grid.Row="0" |
| | | 19 | | HorizontalScrollBarVisibility="Disabled" |
| | 1 | 20 | | VerticalScrollBarVisibility="Auto"> |
| | 4 | 21 | | <Border Width="540" |
| | | 22 | | HorizontalAlignment="Center" |
| | 1 | 23 | | Background="{StaticResource BrushSurface}" |
| | 1 | 24 | | CornerRadius="{StaticResource RadiusLg}" |
| | | 25 | | Padding="44,40" |
| | 1 | 26 | | Margin="0,24"> |
| | 3 | 27 | | <StackPanel Spacing="20"> |
| | | 28 | | |
| | | 29 | | <!-- Header --> |
| | 3 | 30 | | <TextBlock Text="{Binding WindowTitle}" |
| | | 31 | | FontSize="22" |
| | 1 | 32 | | FontWeight="Bold" |
| | 1 | 33 | | Foreground="{StaticResource BrushTextPrimary}"/> |
| | | 34 | | |
| | | 35 | | <!-- Title --> |
| | | 36 | | <!-- Credential Type Selector --> |
| | 3 | 37 | | <StackPanel Spacing="6"> |
| | 3 | 38 | | <TextBlock Text="Typ" |
| | | 39 | | FontSize="12" |
| | 1 | 40 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 3 | 41 | | <StackPanel Orientation="Horizontal" Spacing="20"> |
| | 2 | 42 | | <RadioButton Content="Passwort" |
| | 1 | 43 | | GroupName="CredType" |
| | 1 | 44 | | IsChecked="{Binding IsPasswordCredential, Mode=TwoWay}"/> |
| | 2 | 45 | | <RadioButton Content="API-Schlüssel" |
| | 1 | 46 | | GroupName="CredType" |
| | 1 | 47 | | IsChecked="{Binding IsApiKeyCredential, Mode=TwoWay}"/> |
| | 2 | 48 | | <RadioButton Content="Backup Codes" |
| | 1 | 49 | | GroupName="CredType" |
| | 1 | 50 | | IsChecked="{Binding IsBackupCodesCredential, Mode=TwoWay}"/> |
| | | 51 | | </StackPanel> |
| | | 52 | | </StackPanel> |
| | | 53 | | |
| | 3 | 54 | | <StackPanel Spacing="6"> |
| | 3 | 55 | | <TextBlock Text="Titel *" |
| | | 56 | | FontSize="12" |
| | 1 | 57 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 2 | 58 | | <TextBox Text="{Binding Title, Mode=TwoWay}" |
| | 1 | 59 | | Watermark="z.B. GitHub, Google…"/> |
| | | 60 | | </StackPanel> |
| | | 61 | | |
| | | 62 | | <!-- Username --> |
| | 3 | 63 | | <StackPanel Spacing="6"> |
| | 3 | 64 | | <TextBlock Text="{Binding UsernameLabel}" |
| | | 65 | | FontSize="12" |
| | 1 | 66 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 2 | 67 | | <TextBox Text="{Binding Username, Mode=TwoWay}" |
| | 1 | 68 | | Watermark="optional"/> |
| | | 69 | | </StackPanel> |
| | | 70 | | |
| | | 71 | | <!-- Password / API Secret --> |
| | 4 | 72 | | <StackPanel Spacing="6" IsVisible="{Binding !IsBackupCodesCredential}"> |
| | 3 | 73 | | <TextBlock Text="{Binding SecretFieldLabel}" |
| | | 74 | | FontSize="12" |
| | 1 | 75 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 3 | 76 | | <Grid ColumnDefinitions="*,Auto"> |
| | | 77 | | <!-- Masked (default) --> |
| | 4 | 78 | | <TextBox Grid.Column="0" |
| | 1 | 79 | | Text="{Binding Password, Mode=TwoWay}" |
| | | 80 | | PasswordChar="●" |
| | 1 | 81 | | Watermark="{Binding SecretFieldWatermark}" |
| | | 82 | | CornerRadius="8,0,0,8" |
| | 1 | 83 | | IsVisible="{Binding !IsPasswordVisible}"/> |
| | | 84 | | <!-- Unmasked --> |
| | 3 | 85 | | <TextBox Grid.Column="0" |
| | 1 | 86 | | Text="{Binding Password, Mode=TwoWay}" |
| | 1 | 87 | | Watermark="{Binding SecretFieldWatermark}" |
| | | 88 | | CornerRadius="8,0,0,8" |
| | 1 | 89 | | IsVisible="{Binding IsPasswordVisible}"/> |
| | 3 | 90 | | <Button Grid.Column="1" |
| | 1 | 91 | | Content="👁️" |
| | 1 | 92 | | Command="{Binding TogglePasswordVisibilityCommand}" |
| | 1 | 93 | | Background="{StaticResource BrushBorder}" |
| | 1 | 94 | | Foreground="{StaticResource BrushTextPrimary}" |
| | | 95 | | CornerRadius="0,8,8,0" |
| | 1 | 96 | | Padding="12,10" |
| | 1 | 97 | | ToolTip.Tip="Passwort verstecken" |
| | 1 | 98 | | IsVisible="{Binding IsPasswordVisible}"/> |
| | 3 | 99 | | <Button Grid.Column="1" |
| | 1 | 100 | | Content="🙈" |
| | 1 | 101 | | Command="{Binding TogglePasswordVisibilityCommand}" |
| | 1 | 102 | | Background="{StaticResource BrushBorder}" |
| | 1 | 103 | | Foreground="{StaticResource BrushTextPrimary}" |
| | | 104 | | CornerRadius="0,8,8,0" |
| | 1 | 105 | | Padding="12,10" |
| | 1 | 106 | | ToolTip.Tip="Passwort anzeigen" |
| | 1 | 107 | | IsVisible="{Binding !IsPasswordVisible}"/> |
| | | 108 | | </Grid> |
| | | 109 | | |
| | 2 | 110 | | <Grid ColumnDefinitions="*,Auto" |
| | 1 | 111 | | IsVisible="{Binding Password, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> |
| | 3 | 112 | | <Border Grid.Column="0" |
| | | 113 | | Margin="0,2,0,0"> |
| | 3 | 114 | | <StackPanel Spacing="4"> |
| | 3 | 115 | | <Grid ColumnDefinitions="*,*,*,*,*" |
| | | 116 | | ColumnSpacing="4"> |
| | 5 | 117 | | <Border Grid.Column="0" Height="4" CornerRadius="2" Background="{Binding Strengt |
| | 5 | 118 | | <Border Grid.Column="1" Height="4" CornerRadius="2" Background="{Binding Strengt |
| | 5 | 119 | | <Border Grid.Column="2" Height="4" CornerRadius="2" Background="{Binding Strengt |
| | 5 | 120 | | <Border Grid.Column="3" Height="4" CornerRadius="2" Background="{Binding Strengt |
| | 5 | 121 | | <Border Grid.Column="4" Height="4" CornerRadius="2" Background="{Binding Strengt |
| | | 122 | | </Grid> |
| | 4 | 123 | | <TextBlock Text="{Binding StrengthLabel}" |
| | | 124 | | FontSize="11" |
| | 1 | 125 | | Foreground="{Binding StrengthColor}" |
| | | 126 | | HorizontalAlignment="Right"/> |
| | | 127 | | </StackPanel> |
| | | 128 | | </Border> |
| | | 129 | | </Grid> |
| | | 130 | | |
| | 3 | 131 | | <StackPanel IsVisible="{Binding IsPasswordCredential}"> |
| | 4 | 132 | | <Button Content="🎲 Generieren" |
| | | 133 | | Classes="ghost" |
| | 1 | 134 | | Command="{Binding ToggleGeneratorCommand}" |
| | | 135 | | HorizontalAlignment="Left" |
| | 1 | 136 | | Padding="10,6"/> |
| | | 137 | | |
| | 3 | 138 | | <Border Background="{StaticResource BrushInput}" |
| | 1 | 139 | | CornerRadius="{StaticResource RadiusMd}" |
| | | 140 | | Padding="16,12" |
| | 1 | 141 | | IsVisible="{Binding ShowGenerator}"> |
| | 3 | 142 | | <StackPanel Spacing="12"> |
| | 3 | 143 | | <TextBlock Text="Passwort generieren" |
| | | 144 | | FontSize="13" |
| | 1 | 145 | | FontWeight="SemiBold" |
| | 1 | 146 | | Foreground="{StaticResource BrushTextPrimary}"/> |
| | | 147 | | |
| | 3 | 148 | | <StackPanel Spacing="4"> |
| | 3 | 149 | | <Grid ColumnDefinitions="*,Auto"> |
| | 3 | 150 | | <TextBlock Text="Laenge" |
| | | 151 | | FontSize="12" |
| | 1 | 152 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 3 | 153 | | <TextBlock Grid.Column="1" |
| | 1 | 154 | | Text="{Binding PasswordLength}" |
| | | 155 | | FontSize="12" |
| | 1 | 156 | | Foreground="{StaticResource BrushTextPrimary}"/> |
| | | 157 | | </Grid> |
| | 4 | 158 | | <Slider Minimum="8" |
| | | 159 | | Maximum="64" |
| | 1 | 160 | | Value="{Binding PasswordLength, Mode=TwoWay}" |
| | | 161 | | TickFrequency="1" |
| | 1 | 162 | | IsSnapToTickEnabled="True"/> |
| | | 163 | | </StackPanel> |
| | | 164 | | |
| | 1 | 165 | | <WrapPanel> |
| | 4 | 166 | | <CheckBox Content="Grossbuchstaben" IsChecked="{Binding UseUppercase, Mode=TwoWay}" |
| | 4 | 167 | | <CheckBox Content="Kleinbuchstaben" IsChecked="{Binding UseLowercase, Mode=TwoWay}" |
| | 4 | 168 | | <CheckBox Content="Zahlen" IsChecked="{Binding UseDigits, Mode=TwoWay}" Margin="0,0, |
| | 3 | 169 | | <CheckBox Content="Sonderzeichen" IsChecked="{Binding UseSpecial, Mode=TwoWay}"/> |
| | | 170 | | </WrapPanel> |
| | | 171 | | |
| | 4 | 172 | | <Button Content="Passwort generieren" |
| | | 173 | | Classes="primary" |
| | 1 | 174 | | Command="{Binding GeneratePasswordCommand}" |
| | | 175 | | HorizontalAlignment="Stretch" |
| | 1 | 176 | | HorizontalContentAlignment="Center"/> |
| | | 177 | | </StackPanel> |
| | | 178 | | </Border> |
| | | 179 | | </StackPanel> |
| | | 180 | | </StackPanel> |
| | | 181 | | |
| | | 182 | | <!-- Backup Codes --> |
| | 4 | 183 | | <StackPanel Spacing="8" IsVisible="{Binding IsBackupCodesCredential}"> |
| | 3 | 184 | | <TextBlock Text="Backup-Codes *" |
| | | 185 | | FontSize="12" |
| | 1 | 186 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 4 | 187 | | <TextBox Text="{Binding BackupCodesInput, Mode=TwoWay}" |
| | 1 | 188 | | Watermark="Ein Code pro Zeile oder mit ; / , getrennt" |
| | | 189 | | AcceptsReturn="True" |
| | 1 | 190 | | Height="90" |
| | | 191 | | TextWrapping="Wrap"/> |
| | 4 | 192 | | <Button Content="Codes importieren" |
| | | 193 | | Classes="ghost" |
| | 1 | 194 | | Command="{Binding ImportBackupCodesCommand}" |
| | | 195 | | HorizontalAlignment="Left" |
| | 1 | 196 | | Padding="10,6"/> |
| | | 197 | | |
| | 3 | 198 | | <StackPanel Orientation="Horizontal" Spacing="8"> |
| | 3 | 199 | | <Button Content="Aktive kopieren" |
| | | 200 | | Classes="ghost" |
| | 1 | 201 | | Command="{Binding CopyActiveBackupCodesCommand}"/> |
| | 3 | 202 | | <Button Content="Alle kopieren" |
| | | 203 | | Classes="ghost" |
| | 1 | 204 | | Command="{Binding CopyAllBackupCodesCommand}"/> |
| | | 205 | | </StackPanel> |
| | | 206 | | |
| | 3 | 207 | | <ItemsControl ItemsSource="{Binding BackupCodes}"> |
| | | 208 | | <ItemsControl.ItemTemplate> |
| | 1 | 209 | | <DataTemplate> |
| | 1 | 210 | | <Grid ColumnDefinitions="Auto,*,Auto,Auto" ColumnSpacing="8" Margin="0,2"> |
| | 0 | 211 | | <Button Grid.Column="0" |
| | 0 | 212 | | Content="✓" |
| | | 213 | | Classes="ghost" |
| | 0 | 214 | | Command="{Binding #ROOT.DataContext.ToggleBackupCodeUsedCommand}" |
| | 0 | 215 | | CommandParameter="{Binding}" |
| | | 216 | | Width="26" |
| | 0 | 217 | | Height="26" |
| | | 218 | | VerticalAlignment="Center"/> |
| | 0 | 219 | | <TextBlock Grid.Column="1" |
| | 0 | 220 | | Text="{Binding Value}" |
| | | 221 | | VerticalAlignment="Center"/> |
| | 0 | 222 | | <TextBlock Grid.Column="2" |
| | 0 | 223 | | Text="verwendet" |
| | 0 | 224 | | Foreground="{StaticResource BrushTextMuted}" |
| | | 225 | | VerticalAlignment="Center" |
| | 0 | 226 | | IsVisible="{Binding IsUsed}"/> |
| | 0 | 227 | | <StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="6"> |
| | 0 | 228 | | <Button Content="Kopieren" |
| | | 229 | | Classes="ghost" |
| | 0 | 230 | | Command="{Binding #ROOT.DataContext.CopyBackupCodeCommand}" |
| | 0 | 231 | | CommandParameter="{Binding}"/> |
| | 0 | 232 | | <Button |
| | 0 | 233 | | Content="Entfernen" |
| | | 234 | | Classes="ghost" |
| | 0 | 235 | | Command="{Binding #ROOT.DataContext.RemoveBackupCodeCommand}" |
| | 0 | 236 | | CommandParameter="{Binding}"/> |
| | | 237 | | </StackPanel> |
| | | 238 | | </Grid> |
| | | 239 | | </DataTemplate> |
| | | 240 | | </ItemsControl.ItemTemplate> |
| | | 241 | | </ItemsControl> |
| | | 242 | | </StackPanel> |
| | | 243 | | |
| | | 244 | | <!-- URL --> |
| | 3 | 245 | | <StackPanel Spacing="6"> |
| | 3 | 246 | | <TextBlock Text="URL" |
| | | 247 | | FontSize="12" |
| | 1 | 248 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 2 | 249 | | <TextBox Text="{Binding Url, Mode=TwoWay}" |
| | 1 | 250 | | Watermark="https://..."/> |
| | | 251 | | </StackPanel> |
| | | 252 | | |
| | 3 | 253 | | <StackPanel Spacing="6"> |
| | 3 | 254 | | <TextBlock Text="Icon" |
| | | 255 | | FontSize="12" |
| | 1 | 256 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 5 | 257 | | <WrapPanel ItemHeight="36" ItemWidth="36" Orientation="Horizontal"> |
| | 11 | 258 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 259 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 260 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 261 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 262 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 263 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 264 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 265 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 266 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 267 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 268 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 269 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 270 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 271 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 272 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 273 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 274 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | 11 | 275 | | <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey |
| | | 276 | | </WrapPanel> |
| | | 277 | | </StackPanel> |
| | | 278 | | |
| | | 279 | | <!-- Notes --> |
| | 3 | 280 | | <StackPanel Spacing="6"> |
| | 3 | 281 | | <TextBlock Text="Notizen" |
| | | 282 | | FontSize="12" |
| | 1 | 283 | | Foreground="{StaticResource BrushTextSecondary}"/> |
| | 4 | 284 | | <TextBox Text="{Binding Notes, Mode=TwoWay}" |
| | 1 | 285 | | Watermark="optional" |
| | | 286 | | AcceptsReturn="True" |
| | 1 | 287 | | Height="80" |
| | | 288 | | TextWrapping="Wrap"/> |
| | | 289 | | </StackPanel> |
| | | 290 | | |
| | | 291 | | <!-- Error --> |
| | 3 | 292 | | <TextBlock Text="{Binding ErrorMessage}" |
| | 1 | 293 | | Foreground="{StaticResource BrushError}" |
| | | 294 | | FontSize="12" |
| | 1 | 295 | | TextWrapping="Wrap" |
| | 1 | 296 | | IsVisible="{Binding ErrorMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}} |
| | | 297 | | |
| | | 298 | | <!-- Action Buttons --> |
| | 3 | 299 | | <Grid ColumnDefinitions="*,Auto,Auto" Margin="0,8,0,0"> |
| | 4 | 300 | | <Button Grid.Column="1" |
| | 1 | 301 | | Content="Abbrechen" |
| | | 302 | | Classes="secondary" |
| | 1 | 303 | | Command="{Binding CancelCommand}" |
| | | 304 | | Margin="0,0,10,0"/> |
| | 3 | 305 | | <Button Grid.Column="2" |
| | 1 | 306 | | Content="Speichern" |
| | | 307 | | Classes="primary" |
| | 1 | 308 | | Command="{Binding SaveCommand}"/> |
| | | 309 | | </Grid> |
| | | 310 | | |
| | | 311 | | </StackPanel> |
| | | 312 | | </Border> |
| | | 313 | | </ScrollViewer> |
| | | 314 | | </Grid> |
| | | 315 | | |
| | | 316 | | </UserControl> |