add auto module fetch on startup and finished module creation form for real now

This commit is contained in:
Rene Schwarz
2021-08-09 15:08:26 +02:00
parent f1f717a37f
commit cdb86331e5
30 changed files with 269 additions and 124 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media.Imaging;
namespace Server_Dashboard {
internal class ModuleData {
//The name the user gives the module
public string ModuleName { get; set; }
//The user who created it
public string Creator { get; set; }
//The status indicator
public string StatusIndicator { get; set; }
//The background color of the status indicator
public string StatusIndicatorBG { get; set; }
//If the server is avaibale or not
public bool ServerAvailable { get; set; }
//The Module icon the user give the server, defaults to a generic server symbol
public BitmapImage ModuleIcon { get; set; }
//Creation date with System.DateTime.Now
public DateTime CreationDate { get; set; }
//List that contains all the serverinformation over a period of time(lifespan of the module)
public List<ServerInformation> ServerInformation { get; set; }
/// <summary>
/// This will set the Module status indicator red or green if the server is available or not
/// </summary>
/// <param name="serverAvailable"></param>
public ModuleData(bool serverAvailable) {
ServerAvailable = serverAvailable;
StatusIndicator = ServerAvailable ? "#20c657" : "#e53935";
StatusIndicatorBG = ServerAvailable ? "#94eeb0" : "#ef9a9a";
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// Server information class, this will probably scale pretty big later on
/// This will hold all the information the socket will gather
/// </summary>
internal class ServerInformation {
public string ServerName { get; set; }
public string OSUserName { get; set; }
public double CpuTemp { get; set; }
public double GpuTemp { get; set; }
public DateTime Uptime { get; set; }
public DateTime DeployDate { get; set; }
public string PublicIpAdress { get; set; }
public string PrivateIpAdress { get; set; }
public int GpuUsage { get; set; }
public int CpuUsage { get; set; }
public double NetworkUP { get; set; }
public double NetworkDown { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents a single CPU and will be added
/// to a list to account for a multi CPU system
/// </summary>
internal class CPU {
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents a single drive on a server, this will be added
/// to a list to account for multiple drives
/// </summary>
internal class Drives {
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents a single GPU and will be added to a list
/// to account for multiple GPU's
/// </summary>
internal class GPU {
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents the mainboard
/// It will hold information about the chipset, number of hardware etc...
/// </summary>
internal class Motherboard {
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents a single network interface and will be added
/// to a list to account for multiple networking interfaces
/// </summary>
internal class NetworkInterface {
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// This class represents RAM
/// TODO: figure out if it makes sense to create a class for the entire system memory
/// or for each and every stick
/// </summary>
internal class RAM {
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
namespace Server_Dashboard {
/// <summary>
/// User class to store user informations
/// </summary>
internal class User {
public int UID { get; set; }
public string UserName { get; set; }
public string Email { get; set; }
public DateTime RegistrationDate { get; set; }
public User(DataTable userData) {
foreach (DataRow row in userData.Rows) {
UID = (int)row[0];
UserName = (string)row[1];
Email = (string)row[2];
RegistrationDate = (DateTime)row[3];
}
}
}
}