Files
NebulaLauncher/Nebula.Launcher/Views/Pages/AccountInfoView.axaml
2025-02-01 18:19:18 +03:00

182 lines
8.8 KiB
XML

<UserControl
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Nebula.Launcher.Views.Pages.AccountInfoView"
x:DataType="pages:AccountInfoViewModel"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.DataContext>
<pages:AccountInfoViewModel />
</Design.DataContext>
<Grid
ColumnDefinitions="*,1*"
Margin="15"
RowDefinitions="*">
<StackPanel Grid.Column="1" Grid.Row="0">
<Border
Background="{StaticResource DefaultBackground}"
BoxShadow="0 -1 15 -2 #121212"
CornerRadius="10,10,0,0"
Margin="5,5,5,0"
Padding="5">
<Label HorizontalAlignment="Center">Profiles:</Label>
</Border>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl
Background="#00000000"
ItemsSource="{Binding Accounts}"
Padding="0">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type pages:ProfileAuthCredentials}">
<Border
Background="{StaticResource DefaultBackground}"
BoxShadow="0 1 15 -2 #121212"
CornerRadius="0,10,0,10"
Margin="5,5,5,5"
VerticalAlignment="Center">
<Panel>
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
<Label>Name:</Label>
<Label>
<TextBlock Text="{Binding Login}" />
</Label>
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button
Command="{Binding OnSelect}"
CornerRadius="0,0,0,10"
Padding="5">
<Label>
Select
</Label>
</Button>
<Button
Command="{Binding OnDelete}"
CornerRadius="0,10,0,0"
Padding="5">
<Label>
Delete
</Label>
</Button>
</StackPanel>
</Panel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>
<StackPanel
Grid.Column="0"
Grid.ColumnSpan="{Binding AuthViewSpan}"
Grid.Row="0">
<Border
Background="{StaticResource DefaultBackground}"
BoxShadow="{StaticResource DefaultShadow}"
CornerRadius="10"
Margin="5"
Padding="15">
<Panel>
<StackPanel IsVisible="{Binding !IsLogged}" Spacing="15">
<Svg
Height="100"
Margin="0,0,0,20"
Path="/Assets/svg/user.svg" />
<StackPanel HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Label VerticalAlignment="Center">
Login:
</Label>
<TextBox Text="{Binding CurrentLogin}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label HorizontalAlignment="Left" VerticalAlignment="Center">
Password:
</Label>
<TextBox PasswordChar="#" Text="{Binding CurrentPassword}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label VerticalAlignment="Center">
Auth server:
</Label>
<TextBox Text="{Binding CurrentAuthServer}" />
<Button Command="{Binding ExpandAuthUrlCommand}" VerticalAlignment="Stretch">
<Label>+</Label>
</Button>
</StackPanel>
</StackPanel>
<Border
BoxShadow="{StaticResource DefaultShadow}"
CornerRadius="10"
IsVisible="{Binding AuthUrlConfigExpand}">
<ScrollViewer Height="80">
<ListBox
Background="#00000000"
ItemsSource="{Binding AuthUrls}"
Margin="5"
SelectedItem="{Binding AuthItemSelect}"
SelectionMode="Toggle">
<ListBox.ItemTemplate>
<DataTemplate>
<Label>
<TextBlock Text="{Binding}" />
</Label>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
</Border>
<Border Background="{StaticResource DefaultSelected}" BoxShadow="{StaticResource DefaultShadow}">
<Button
Command="{Binding DoAuth}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center">
<Label>Auth</Label>
</Button>
</Border>
<Button Command="{Binding ExpandAuthViewCommand}" HorizontalAlignment="Right">
<Label>
>
</Label>
</Button>
</StackPanel>
<StackPanel IsVisible="{Binding IsLogged}">
<Svg
Height="100"
Margin="0,0,0,20"
Path="/Assets/svg/user.svg" />
<Label>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock>Hello,</TextBlock>
<TextBlock Text="{Binding CurrentLogin}" />
</StackPanel>
</Label>
<StackPanel
HorizontalAlignment="Center"
Margin="5,20,5,5"
Orientation="Horizontal"
Spacing="5">
<Border BoxShadow="{StaticResource DefaultShadow}">
<Button Command="{Binding Logout}">
<Label>Logout</Label>
</Button>
</Border>
<Border BoxShadow="{StaticResource DefaultShadow}">
<Button Command="{Binding SaveProfileCommand}">
<Label>Save profile</Label>
</Button>
</Border>
</StackPanel>
</StackPanel>
</Panel>
</Border>
</StackPanel>
</Grid>
</UserControl>