first build
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:UnifiedFarmLauncher.ViewModels"
|
||||
xmlns:models="using:UnifiedFarmLauncher.Models"
|
||||
x:Class="UnifiedFarmLauncher.Views.MainWindow"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Title="Unified Farm Launcher"
|
||||
Width="1000" Height="700"
|
||||
MinWidth="800" MinHeight="600">
|
||||
@@ -34,7 +37,8 @@
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
SelectionMode="Single"
|
||||
GridLinesVisibility="All">
|
||||
GridLinesVisibility="All"
|
||||
ItemsSource="{Binding Workers}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="150"/>
|
||||
<DataGridCheckBoxColumn Header="Enabled" Binding="{Binding Enabled}" Width="80"/>
|
||||
@@ -45,9 +49,9 @@
|
||||
</DataGrid>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<StatusBar Grid.Row="3">
|
||||
<TextBlock Name="StatusText" Text="{Binding StatusText}" Margin="5"/>
|
||||
</StatusBar>
|
||||
<Border Grid.Row="3" Background="{DynamicResource ThemeControlLowBackgroundBrush}" BorderBrush="{DynamicResource ThemeBorderLowBrush}" BorderThickness="0,1,0,0">
|
||||
<TextBlock Name="StatusText" Text="{Binding StatusText}" Margin="5" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard("Delete Worker",
|
||||
$"Are you sure you want to delete worker '{worker.Name}'?",
|
||||
ButtonEnum.YesNo, Icon.Warning);
|
||||
ButtonEnum.YesNo, MsBox.Avalonia.Enums.Icon.Warning);
|
||||
var result = await box.ShowAsync();
|
||||
|
||||
if (result == ButtonResult.Yes)
|
||||
@@ -97,7 +97,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
"Worker has no configured worker type.",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await box.ShowAsync();
|
||||
return;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
await _controllerService.StartWorkerAsync(worker, workerType);
|
||||
var successBox = MessageBoxManager.GetMessageBoxStandard("Start Worker",
|
||||
$"Worker '{worker.Name}' started successfully.",
|
||||
ButtonEnum.Ok, Icon.Success);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Success);
|
||||
await successBox.ShowAsync();
|
||||
((MainWindowViewModel)DataContext!).RefreshWorkers();
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var errorBox = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
$"Failed to start worker: {ex.Message}",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await errorBox.ShowAsync();
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
"Worker has no configured worker type.",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await box.ShowAsync();
|
||||
return;
|
||||
}
|
||||
@@ -143,14 +143,14 @@ namespace UnifiedFarmLauncher.Views
|
||||
await _controllerService.StopWorkerAsync(worker, workerType);
|
||||
var successBox = MessageBoxManager.GetMessageBoxStandard("Stop Worker",
|
||||
$"Stop command sent to worker '{worker.Name}'.",
|
||||
ButtonEnum.Ok, Icon.Info);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Info);
|
||||
await successBox.ShowAsync();
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
var errorBox = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
$"Failed to stop worker: {ex.Message}",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await errorBox.ShowAsync();
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
"Worker has no configured worker type.",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await box.ShowAsync();
|
||||
return;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var errorBox = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
$"Failed to attach to worker: {ex.Message}",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await errorBox.ShowAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:UnifiedFarmLauncher.ViewModels"
|
||||
x:Class="UnifiedFarmLauncher.Views.WorkerEditWindow"
|
||||
x:DataType="vm:WorkerEditViewModel"
|
||||
Title="Edit Worker"
|
||||
Width="600" Height="700"
|
||||
MinWidth="500" MinHeight="600">
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
"Worker name is required.",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await box.ShowAsync();
|
||||
return;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ namespace UnifiedFarmLauncher.Views
|
||||
{
|
||||
var errorBox = MessageBoxManager.GetMessageBoxStandard("Error",
|
||||
$"Failed to save worker: {ex.Message}",
|
||||
ButtonEnum.Ok, Icon.Error);
|
||||
ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error);
|
||||
await errorBox.ShowAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user