begin application build overhaul
This commit is contained in:
15
Models/ConfigRoot.cs
Normal file
15
Models/ConfigRoot.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace UnifiedFarmLauncher.Models
|
||||
{
|
||||
public class ConfigRoot
|
||||
{
|
||||
[JsonPropertyName("workers")]
|
||||
public List<WorkerConfig> Workers { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("globalSettings")]
|
||||
public GlobalSettings GlobalSettings { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
16
Models/GlobalSettings.cs
Normal file
16
Models/GlobalSettings.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace UnifiedFarmLauncher.Models
|
||||
{
|
||||
public class GlobalSettings
|
||||
{
|
||||
[JsonPropertyName("sheepitJarUrls")]
|
||||
public List<string> SheepItJarUrls { get; set; } = new()
|
||||
{
|
||||
"https://www.sheepit-renderfarm.com/media/applet/client-latest.php",
|
||||
"https://www.sheepit-renderfarm.com/media/applet/client-latest.jar"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
17
Models/SshConfig.cs
Normal file
17
Models/SshConfig.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace UnifiedFarmLauncher.Models
|
||||
{
|
||||
public class SshConfig
|
||||
{
|
||||
[JsonPropertyName("host")]
|
||||
public string Host { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("port")]
|
||||
public int Port { get; set; } = 22;
|
||||
|
||||
[JsonPropertyName("args")]
|
||||
public string Args { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
23
Models/WorkerConfig.cs
Normal file
23
Models/WorkerConfig.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace UnifiedFarmLauncher.Models
|
||||
{
|
||||
public class WorkerConfig
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("enabled")]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("ssh")]
|
||||
public SshConfig Ssh { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("workerTypes")]
|
||||
public WorkerTypeConfig WorkerTypes { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
48
Models/WorkerTypeConfig.cs
Normal file
48
Models/WorkerTypeConfig.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace UnifiedFarmLauncher.Models
|
||||
{
|
||||
public class SheepItConfig
|
||||
{
|
||||
[JsonPropertyName("gpu")]
|
||||
public string Gpu { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("renderKey")]
|
||||
public string RenderKey { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class FlamencoConfig
|
||||
{
|
||||
[JsonPropertyName("workerPath")]
|
||||
public string WorkerPath { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("networkDrives")]
|
||||
public List<string> NetworkDrives { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("networkPaths")]
|
||||
public List<string> NetworkPaths { get; set; } = new();
|
||||
}
|
||||
|
||||
public class WorkerTypeConfig
|
||||
{
|
||||
[JsonPropertyName("sheepit")]
|
||||
public SheepItConfig? SheepIt { get; set; }
|
||||
|
||||
[JsonPropertyName("flamenco")]
|
||||
public FlamencoConfig? Flamenco { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var types = new List<string>();
|
||||
if (SheepIt != null) types.Add("SheepIt");
|
||||
if (Flamenco != null) types.Add("Flamenco");
|
||||
return string.Join(", ", types);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user