Files
NebulaLauncher/Nebula.Launcher/Views/Pages/ServerListView.axaml

193 lines
10 KiB
Plaintext
Raw Normal View History

2024-12-21 13:11:30 +03:00
<UserControl
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
2024-12-22 16:38:47 +03:00
x:Class="Nebula.Launcher.Views.Pages.ServerListView"
x:DataType="viewModels:ServerListViewModel"
2024-12-21 13:11:30 +03:00
xmlns="https://github.com/avaloniaui"
2024-12-23 20:45:34 +03:00
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
2024-12-21 13:11:30 +03:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2024-12-22 16:38:47 +03:00
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
2024-12-23 20:45:34 +03:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2024-12-22 16:38:47 +03:00
<Design.DataContext>
<viewModels:ServerListViewModel />
</Design.DataContext>
2025-01-11 20:39:58 +03:00
<Grid
ColumnDefinitions="*"
Margin="5"
RowDefinitions="*,40">
2024-12-21 13:11:30 +03:00
<ScrollViewer Margin="0,0,0,10" Padding="0,0,8,0">
2025-01-07 19:14:42 +03:00
<ItemsControl
2024-12-22 16:38:47 +03:00
Background="#00000000"
ItemsSource="{Binding ServerInfos}"
Padding="0">
2025-01-07 19:14:42 +03:00
<ItemsControl.ItemTemplate>
2024-12-27 19:15:33 +03:00
<DataTemplate DataType="{x:Type viewModels:ServerEntryModelView}">
2024-12-22 21:38:19 +03:00
<Grid
2025-01-05 17:05:23 +03:00
ColumnDefinitions="*,120"
2024-12-23 20:45:34 +03:00
Margin="0,5,0,5"
2024-12-26 09:49:01 +03:00
RowDefinitions="30,*">
2024-12-23 20:45:34 +03:00
<Border
BorderThickness="2,0,0,0"
Grid.Column="0"
Grid.Row="0"
2024-12-26 09:49:01 +03:00
Padding="10,0,0,0">
<Label VerticalAlignment="Center">
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.Name}" />
2024-12-23 20:45:34 +03:00
</Label>
</Border>
<Border
2025-01-05 17:05:23 +03:00
BorderThickness="2,0,2,0"
2024-12-23 20:45:34 +03:00
CornerRadius="0"
Grid.Column="1"
Grid.Row="0"
Padding="5">
<StackPanel
HorizontalAlignment="Center"
Orientation="Horizontal"
VerticalAlignment="Center">
<Label>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.Players}" />
2024-12-23 20:45:34 +03:00
</Label>
<Label>/</Label>
<Label>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.SoftMaxPlayers}" />
2024-12-23 20:45:34 +03:00
</Label>
</StackPanel>
</Border>
<Border
BorderThickness="2,0,0,0"
CornerRadius="0,0,10,10"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="1"
MinHeight="50">
<Border.Background>
<ImageBrush Stretch="UniformToFill" asyncImageLoader:ImageBrushLoader.Source="https://t4.ftcdn.net/jpg/00/81/55/69/360_F_81556974_8sF8cKszJaRfBGd5sDt1RXE2QbzDtQqs.jpg" />
</Border.Background>
2024-12-22 21:38:19 +03:00
<Border
2024-12-23 20:45:34 +03:00
BorderThickness="0,2,2,0"
2025-01-05 17:05:23 +03:00
CornerRadius="0,0,10,10"
2024-12-23 20:45:34 +03:00
IsVisible="True"
2025-01-05 17:05:23 +03:00
Margin="0,0,0,0"
2024-12-23 20:45:34 +03:00
Opacity="40"
Padding="0">
<UniformGrid Margin="15,5,15,0">
<UniformGrid.Styles>
<Style Selector="Label">
<Setter Property="FontSize" Value="8" />
</Style>
</UniformGrid.Styles>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">RoundStart:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.RoundStartTime}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Map:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.Map}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Preset:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.Preset}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">PanicBunker:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.PanicBunker}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Round Id:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.RoundId}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Run Level:</TextBlock>
2024-12-27 19:15:33 +03:00
<TextBlock Text="{Binding ServerHubInfo.StatusData.RunLevel}" />
2024-12-23 20:45:34 +03:00
</StackPanel>
</Label>
</UniformGrid>
2024-12-22 21:38:19 +03:00
</Border>
2024-12-23 20:45:34 +03:00
</Border>
<Panel Grid.Column="1" Grid.Row="1">
2025-01-05 17:05:23 +03:00
<Button
Command="{Binding RunInstance}"
CornerRadius="10,0,10,10"
2025-01-11 20:39:58 +03:00
HorizontalAlignment="Stretch"
IsVisible="{Binding RunVisible}"
2025-01-05 17:05:23 +03:00
VerticalAlignment="Stretch">
<Label HorizontalAlignment="Center" VerticalAlignment="Center">
Play
</Label>
</Button>
<Grid Grid.ColumnDefinitions="*,*" IsVisible="{Binding !RunVisible}">
2025-01-11 20:39:58 +03:00
<Button
Command="{Binding ReadLog}"
CornerRadius="10,0,0,10"
HorizontalAlignment="Stretch"
Margin="0,0,1,0"
VerticalAlignment="Stretch">
2024-12-23 20:45:34 +03:00
<Label HorizontalAlignment="Center" VerticalAlignment="Center">
2025-01-05 17:05:23 +03:00
Log
2024-12-23 20:45:34 +03:00
</Label>
</Button>
2025-01-11 20:39:58 +03:00
<Button
Command="{Binding StopInstance}"
CornerRadius="0,0,10,0"
Grid.Column="1"
HorizontalAlignment="Stretch"
Margin="1,0,0,0"
VerticalAlignment="Stretch">
2025-01-05 17:05:23 +03:00
<Label HorizontalAlignment="Center" VerticalAlignment="Center">
Stop
</Label>
</Button>
</Grid>
2024-12-23 20:45:34 +03:00
</Panel>
</Grid>
2024-12-22 16:38:47 +03:00
</DataTemplate>
2025-01-07 19:14:42 +03:00
</ItemsControl.ItemTemplate>
</ItemsControl>
2024-12-21 13:11:30 +03:00
</ScrollViewer>
2024-12-22 16:38:47 +03:00
2024-12-21 13:11:30 +03:00
<Border
BorderThickness="2,0,0,0"
CornerRadius="10"
Grid.Row="1">
2024-12-27 19:15:33 +03:00
<Grid ColumnDefinitions="*,40,40" RowDefinitions="*">
2024-12-21 13:11:30 +03:00
<TextBox
Margin="0"
2024-12-27 19:15:33 +03:00
Text="{Binding SearchText}"
TextChanged="TextBox_OnTextChanged"
2024-12-21 13:11:30 +03:00
VerticalAlignment="Center"
2024-12-27 19:15:33 +03:00
Watermark="Server name..." />
<Button
Command="{Binding FilterRequired}"
Grid.Column="1"
Padding="10">
2024-12-21 13:11:30 +03:00
<Image Source="/Assets/filter.png" />
</Button>
2024-12-27 19:15:33 +03:00
<Button
Command="{Binding UpdateRequired}"
Grid.Column="2"
Padding="10">
<Image Source="/Assets/refresh.png" />
</Button>
2024-12-21 13:11:30 +03:00
</Grid>
</Border>
</Grid>
</UserControl>