- Config zuordnung überarbeitet -> keine vorhanden zeigt im editor dann hinweis an: Keine Config gefunden. Server bereits neu gestartet ? - Config Speichern behoben - Ladeanimationen hinzugefügt - Mod löschen funktion eingefügt -> Popup zur bestätigung ob gelöscht werden soll
135 lines
5.5 KiB
XML
135 lines
5.5 KiB
XML
<UserControl
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="clr-namespace:Valheim_Dashboard.ViewModels"
|
|
mc:Ignorable="d" d:DesignWidth="1424" d:DesignHeight="714"
|
|
x:Class="Valheim_Dashboard.Views.ServerDashboardView"
|
|
x:DataType="vm:ServerDashboardViewModel"
|
|
xmlns:ae="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
|
|
xmlns:icons="clr-namespace:Lucide.Avalonia;assembly=Lucide.Avalonia"
|
|
xmlns:li="using:LoadingIndicators.Avalonia">
|
|
|
|
|
|
<Grid ColumnDefinitions="570,*">
|
|
<!-- Linke Spalte -->
|
|
<Grid Margin="20" RowDefinitions="Auto,*" RowSpacing="20">
|
|
|
|
<!-- BepInEx Status -->
|
|
<Border BorderBrush="Gray" BorderThickness="2" CornerRadius="12" Padding="20"
|
|
Grid.Row="0">
|
|
<StackPanel Spacing="10">
|
|
<Grid>
|
|
<TextBlock Text="BepInEx Status" FontSize="28" FontWeight="Bold"/>
|
|
<Ellipse Width="20" Height="20" Fill="{Binding BepInExStatusBrush}" Stroke="Black" StrokeThickness="1"
|
|
VerticalAlignment="Center"/>
|
|
</Grid>
|
|
<TextBlock Text="{Binding BepInExStatus}" FontSize="20"/>
|
|
<li:LoadingIndicator IsActive="{Binding IsLoading}" IsVisible="{Binding IsLoading}" Mode="Arcs" SpeedRatio="0.8" Height="100" Width="100" />
|
|
<Button Content="Installieren"
|
|
Command="{Binding InstallBepInExCommand}"
|
|
IsVisible="{Binding ShowInstallButton}"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Height="80"/>
|
|
<Button Content="Update"
|
|
Command="{Binding UpdateBepInExCommand}"
|
|
IsVisible="{Binding ShowUpdateButton}"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Height="80"/>
|
|
<ProgressBar Minimum="0" Maximum="100" Value="{Binding ProgressValue}"
|
|
IsVisible="{Binding IsProgress}" Height="20"/>
|
|
<TextBlock Text="{Binding ProgressText}" Margin="0,5,0,0" IsVisible="{Binding IsProgress}"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- Mods Liste -->
|
|
<Border BorderBrush="Gray" BorderThickness="2" CornerRadius="12" Padding="20"
|
|
Grid.Row="1">
|
|
<Grid RowDefinitions="Auto,*,Auto" RowSpacing="10">
|
|
<TextBlock Text="Mods" FontSize="28" FontWeight="Bold" Grid.Row="0"/>
|
|
|
|
<!-- ListBox füllt jetzt automatisch den Rest -->
|
|
<StackPanel IsVisible="{Binding !IsModsLoading}">
|
|
<ListBox ItemsSource="{Binding Mods}" SelectedItem="{Binding SelectedMod}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid ColumnDefinitions="*,Auto" Margin="5" VerticalAlignment="Center">
|
|
<!-- Links: Name + Version -->
|
|
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
|
<TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="0,0,10,0"/>
|
|
<TextBlock Text="{Binding Version}" Foreground="Gray"/>
|
|
</StackPanel>
|
|
|
|
<!-- Rechts: Icon-Buttons -->
|
|
<StackPanel Orientation="Horizontal" Spacing="8" Grid.Column="1" HorizontalAlignment="Right">
|
|
<!-- Update nur wenn HasUpdate true -->
|
|
<Button Command="{Binding $parent[UserControl].DataContext.UpdateModCommand}"
|
|
CommandParameter="{Binding}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
ToolTip.Tip="Update verfügbar"
|
|
IsVisible="{Binding HasUpdate}"
|
|
Content="{LucideIconContent ArrowUp}" />
|
|
|
|
<!-- Löschen -->
|
|
<Button Command="{Binding $parent[UserControl].DataContext.RemoveModCommand}"
|
|
CommandParameter="{Binding}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
ToolTip.Tip="Mod entfernen"
|
|
Content="{LucideIconContent Trash2}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</StackPanel>
|
|
<!-- Spinner -->
|
|
<StackPanel IsVisible="{Binding IsModsLoading}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Center"
|
|
Spacing="10">
|
|
<li:LoadingIndicator IsActive="True" Mode="Arcs" SpeedRatio="0.8" Height="100" Width="100" />
|
|
<TextBlock Text="Mods werden geladen..."
|
|
Foreground="Gray"
|
|
FontSize="16"
|
|
HorizontalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Row="2">
|
|
<Button Content="Mod hochladen" Command="{Binding UploadModCommand}" Height="80" VerticalContentAlignment="Center" HorizontalAlignment="Center" />
|
|
<Button Content="Aus Store installieren" Command="{Binding InstallFromStoreCommand}" Height="80" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- Rechte Spalte (Config Editor) -->
|
|
<StackPanel Grid.Column="1" Margin="20" Spacing="20">
|
|
<TextBlock Text="{Binding SelectedMod.Name}" FontSize="28" FontWeight="Bold"/>
|
|
<ae:TextEditor
|
|
Document="{Binding ConfigDocument}"
|
|
ShowLineNumbers="True"
|
|
FontFamily="Cascadia Code, Consolas, Menlo, monospace"
|
|
FontSize="16"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
VerticalScrollBarVisibility="Auto"
|
|
SyntaxHighlighting="CfgDark"
|
|
Background="{DynamicResource Cfg.BgBrush}"
|
|
Foreground="{DynamicResource Cfg.FgBrush}"
|
|
Height="520"
|
|
/>
|
|
<Grid>
|
|
<Button Content="Speichern" Command="{Binding SaveConfigCommand}" Height="80" HorizontalAlignment="Right" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
|
|
</UserControl>
|