Files
NebulaLauncher/Nebula.Launcher/Views/ServerEntryView.axaml

174 lines
7.4 KiB
Plaintext
Raw Normal View History

2025-01-17 16:23:50 +03:00
<UserControl
d:DesignHeight="300"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Nebula.Launcher.Views.ServerEntryView"
x:DataType="viewModels:ServerEntryModelView"
xmlns="https://github.com/avaloniaui"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
2025-01-18 18:20:11 +03:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Nebula.Launcher.Converters">
2025-01-16 21:07:50 +03:00
<Design.DataContext>
<viewModels:ServerEntryModelView />
</Design.DataContext>
2025-01-17 16:23:50 +03:00
<Border CornerRadius="10" Margin="0,5,0,5">
2025-01-18 18:20:11 +03:00
<Grid ColumnDefinitions="30,*,80,90" RowDefinitions="35,*,*">
2025-01-17 16:23:50 +03:00
<Border
BorderThickness="0,0,0,2"
CornerRadius="10"
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="0"
IsVisible="{Binding ExpandInfo}" />
<Button
Command="{Binding ExpandInfoRequired}"
CornerRadius="10,0,0,10"
Grid.Column="0"
Grid.Row="0"
Grid.RowSpan="3"
VerticalAlignment="Stretch">
2025-01-18 18:20:11 +03:00
<Label VerticalAlignment="Bottom" Margin="5,0,5,2">i</Label>
2025-01-17 16:23:50 +03:00
</Button>
<ScrollViewer
Grid.Column="1"
Grid.Row="0"
Margin="5">
<Label VerticalAlignment="Center">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Name}" />
</Label>
</ScrollViewer>
2025-01-16 21:07:50 +03:00
<StackPanel
2025-01-17 16:23:50 +03:00
Grid.Column="2"
Grid.Row="0"
2025-01-16 21:07:50 +03:00
HorizontalAlignment="Center"
Orientation="Horizontal"
VerticalAlignment="Center">
<Label>
<TextBlock Text="{Binding ServerHubInfo.StatusData.Players}" />
</Label>
<Label>/</Label>
<Label>
<TextBlock Text="{Binding ServerHubInfo.StatusData.SoftMaxPlayers}" />
</Label>
</StackPanel>
2025-01-17 16:23:50 +03:00
<Panel
Grid.Column="3"
Grid.Row="0"
Margin="5,0,0,0">
2025-01-16 21:07:50 +03:00
<Button
2025-01-17 16:23:50 +03:00
Command="{Binding RunInstance}"
CornerRadius="10,10,10,10"
2025-01-16 21:07:50 +03:00
HorizontalAlignment="Stretch"
2025-01-17 16:23:50 +03:00
IsVisible="{Binding RunVisible}"
2025-01-16 21:07:50 +03:00
VerticalAlignment="Stretch">
2025-01-18 18:20:11 +03:00
<Svg Path="/Assets/svg/play.svg"/>
2025-01-16 21:07:50 +03:00
</Button>
2025-01-18 18:20:11 +03:00
<Grid ColumnDefinitions="*,*"
IsVisible="{Binding !RunVisible}">
2025-01-17 16:23:50 +03:00
<Button
Command="{Binding ReadLog}"
CornerRadius="10,0,0,10"
HorizontalAlignment="Stretch"
2025-01-18 18:20:11 +03:00
Margin="0,0,2,0"
2025-01-17 16:23:50 +03:00
VerticalAlignment="Stretch">
2025-01-18 18:20:11 +03:00
<Svg Path="/Assets/svg/newspaper.svg"/>
2025-01-17 16:23:50 +03:00
</Button>
<Button
Command="{Binding StopInstance}"
2025-01-18 18:20:11 +03:00
CornerRadius="0,10,10,0"
2025-01-17 16:23:50 +03:00
Grid.Column="1"
HorizontalAlignment="Stretch"
2025-01-18 18:20:11 +03:00
Margin="2,0,0,0"
2025-01-17 16:23:50 +03:00
VerticalAlignment="Stretch">
2025-01-18 18:20:11 +03:00
<Svg Path="/Assets/svg/stop.svg"/>
2025-01-17 16:23:50 +03:00
</Button>
</Grid>
</Panel>
<Border
BorderThickness="0,0,0,0"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="1"
IsVisible="{Binding ExpandInfo}"
Margin="5">
<Label FontSize="12">
<TextBlock Text="{Binding Description}" />
</Label>
</Border>
<Border
BorderThickness="0,2,0,0"
CornerRadius="10"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="2"
IsVisible="{Binding ExpandInfo}"
Margin="5,15,15,5">
<StackPanel Margin="5" Spacing="4">
<StackPanel Orientation="Horizontal">
<Label FontSize="10" VerticalAlignment="Center">Tags:</Label>
<ItemsControl ItemsSource="{Binding Tags}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type system:String}">
<Border
Background="#121212"
CornerRadius="8"
HorizontalAlignment="Center"
Margin="1,1,1,1"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding}" />
</Label>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
HorizontalAlignment="Left"
Orientation="Horizontal"
VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label FontSize="10" VerticalAlignment="Center">Map:</Label>
<Border
Background="#121212"
CornerRadius="8"
HorizontalAlignment="Center"
Margin="1,1,1,1"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Map}" />
</Label>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label FontSize="10" VerticalAlignment="Center">Preset:</Label>
<Border
Background="#121212"
CornerRadius="8"
HorizontalAlignment="Center"
Margin="1,1,1,1"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Preset}" />
</Label>
</Border>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Border>
2025-01-16 21:07:50 +03:00
</UserControl>