first build

This commit is contained in:
Nathan
2025-12-17 15:55:45 -07:00
parent d0ac16e53a
commit 06d2c3934b
9 changed files with 5589 additions and 27 deletions

401
.gitignore vendored
View File

@@ -1,2 +1,403 @@
# SpecStory explanation file
.specstory/.what-is-this.md
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio cache/options directory
.vs/
.vscode/
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# NuGet Packages
*.nupkg
*.snupkg
**/packages/*
!**/packages/build/
*.nuget.props
*.nuget.targets
# Rider
.idea/
*.sln.iml
# Visual Studio Code
.vscode/
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

File diff suppressed because it is too large Load Diff

View File

@@ -4,9 +4,7 @@
RequestedThemeVariant="Default">
<Application.Styles>
<FluentTheme />
</Application.Styles>
<Application.Resources>
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
</Application.Resources>
</Application.Styles>
</Application>

View File

@@ -245,9 +245,12 @@ catch {{
var payloadBase64 = Convert.ToBase64String(Encoding.Unicode.GetBytes(payloadScript));
var remoteBasePath = await _sshService.GetWorkerBasePathAsync(worker);
var jsonParams = $@"{{""WorkerName"":""{worker.Name}"",""WorkerType"":""{workerType}"",""PayloadBase64"":""{payloadBase64}""}}";
var jsonParamsBase64 = Convert.ToBase64String(Encoding.Unicode.GetBytes(jsonParams));
var ensureScript = $@"
$ProgressPreference = 'SilentlyContinue'
$params = ConvertFrom-Json ([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('{Convert.ToBase64String(Encoding.Unicode.GetBytes($@"{{""WorkerName"":""{worker.Name}"",""WorkerType"":""{workerType}"",""PayloadBase64"":""{payloadBase64}""}}"@))}')))
$params = ConvertFrom-Json ([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('{jsonParamsBase64}')))
$workerName = $params.WorkerName
$workerType = $params.WorkerType
$payloadBase64 = $params.PayloadBase64

View File

@@ -1,4 +1,4 @@
<Project Sdk="Avalonia.Desktop">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
@@ -13,13 +13,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.0" />
<PackageReference Include="Avalonia.Theme.Fluent" Version="11.0.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
<PackageReference Include="MsBox.Avalonia" Version="2.0.6" />
<PackageReference Include="Avalonia" Version="11.3.9" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.9" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.9" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.9" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.9" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.9" />
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup>

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -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">

View File

@@ -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();
}
}