pschelpdesk/HetznerServer/Models/Server.cs
2024-11-18 19:53:49 +01:00

160 lines
3.9 KiB
C#

using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
using Avalonia.Media;
using CommunityToolkit.Mvvm.DependencyInjection;
using Material.Icons;
using PSCHelpdesk.Shared.Service;
using ReactiveUI;
namespace PSCHelpdesk.Plugins.HetznerServer.Models;
public class Server : ReactiveObject
{
public long ServerId { get; set; }
public string Name { get; set; }
private Instance _instance;
public Instance Instance
{
get => _instance;
set => this.RaiseAndSetIfChanged(ref _instance, value);
}
private List<Plugin> _plugins;
public List<Plugin> Plugins
{
get => _plugins;
set => this.RaiseAndSetIfChanged(ref _plugins, value);
}
private string _pscApiKey;
public string PscApiKey
{
get => _pscApiKey;
set => this.RaiseAndSetIfChanged(ref _pscApiKey, value);
}
private string _fastBillId;
public string FastBillId
{
get => _fastBillId;
set => this.RaiseAndSetIfChanged(ref _fastBillId, value);
}
public string Status { get; set; }
private MaterialIconKind _isGoodIcon = MaterialIconKind.AlertCircleOutline;
public MaterialIconKind IsGoodIcon
{
get => _isGoodIcon;
set => this.RaiseAndSetIfChanged(ref _isGoodIcon, value);
}
private IImmutableSolidColorBrush? _isGoodColor = Brushes.Red;
public IImmutableSolidColorBrush? IsGoodColor
{
get => _isGoodColor;
set => this.RaiseAndSetIfChanged(ref _isGoodColor, value);
}
private String _rootDirUsed = "100%";
public string RootDirUsed
{
get => _rootDirUsed;
set => this.RaiseAndSetIfChanged(ref _rootDirUsed, value);
}
private String _dataDirUsed = "100%";
public string DataDirUsed
{
get => _dataDirUsed;
set => this.RaiseAndSetIfChanged(ref _dataDirUsed, value);
}
private String _mongoVersion = "";
public string MongoVersion
{
get => _mongoVersion;
set => this.RaiseAndSetIfChanged(ref _mongoVersion, value);
}
private int _runningContainerCount = 0;
public int RunningContainerCount
{
get => _runningContainerCount;
set => this.RaiseAndSetIfChanged(ref _runningContainerCount, value);
}
private String _mysqlVersion = "";
public string MysqlVersion
{
get => _mysqlVersion;
set => this.RaiseAndSetIfChanged(ref _mysqlVersion, value);
}
public string Type { get; set; }
public string Ipv4 { get; set; }
public string Ipv6 { get; set; }
public Server(long serverId, string name, string type, string status, string ipv4, string ipv6)
{
ServerId = serverId;
Name = name;
Type = type;
Status = status;
Ipv4 = ipv4;
Ipv6 = ipv6;
Domains = new List<Domain>();
Plugins = new List<Plugin>();
Instance = new Instance();
}
private List<Domain> _domains;
public List<Domain> Domains
{
get => _domains;
set => this.RaiseAndSetIfChanged(ref _domains, value);
}
private string _datum;
public string Datum
{
get => _datum;
set => this.RaiseAndSetIfChanged(ref _datum, value);
}
private float _release;
public float Release
{
get => _release;
set => this.RaiseAndSetIfChanged(ref _release, value);
}
private DateTime _backupLastModified;
public DateTime BackupLastModified {
get => _backupLastModified;
set => this.RaiseAndSetIfChanged(ref _backupLastModified, value);
}
private bool _hasBackup = false;
public bool HasBackup {
get => _hasBackup;
set => this.RaiseAndSetIfChanged(ref _hasBackup, value);
}
}