commit 488494c27322118d9ba4dca62b2bc8b45b049db3 Author: Rene Schwarz Date: Thu Apr 1 15:15:09 2021 +0200 init commit diff --git a/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..4ee9dd6 Binary files /dev/null and b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Server Dashboard/v16/.suo b/.vs/Server Dashboard/v16/.suo new file mode 100644 index 0000000..3e9828e Binary files /dev/null and b/.vs/Server Dashboard/v16/.suo differ diff --git a/Server Dashboard.sln b/Server Dashboard.sln new file mode 100644 index 0000000..85b71b8 --- /dev/null +++ b/Server Dashboard.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31129.286 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server Dashboard", "Server Dashboard\Server Dashboard.csproj", "{1183B3CA-7F78-4749-B571-0BCF52EA4FCD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1183B3CA-7F78-4749-B571-0BCF52EA4FCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1183B3CA-7F78-4749-B571-0BCF52EA4FCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1183B3CA-7F78-4749-B571-0BCF52EA4FCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1183B3CA-7F78-4749-B571-0BCF52EA4FCD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A326C8A2-0AB9-4248-B7F3-720181D8A10E} + EndGlobalSection +EndGlobal diff --git a/Server Dashboard/App.xaml b/Server Dashboard/App.xaml new file mode 100644 index 0000000..938123c --- /dev/null +++ b/Server Dashboard/App.xaml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Server Dashboard/App.xaml.cs b/Server Dashboard/App.xaml.cs new file mode 100644 index 0000000..87091a6 --- /dev/null +++ b/Server Dashboard/App.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace Server_Dashboard { + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application { + } +} diff --git a/Server Dashboard/AssemblyInfo.cs b/Server Dashboard/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/Server Dashboard/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Server Dashboard/Assets/Images/userlogin.png b/Server Dashboard/Assets/Images/userlogin.png new file mode 100644 index 0000000..2fd549e Binary files /dev/null and b/Server Dashboard/Assets/Images/userlogin.png differ diff --git a/Server Dashboard/Assets/Images/userpasswd.png b/Server Dashboard/Assets/Images/userpasswd.png new file mode 100644 index 0000000..a117ad0 Binary files /dev/null and b/Server Dashboard/Assets/Images/userpasswd.png differ diff --git a/Server Dashboard/DashboardModules/DashboardModule.cs b/Server Dashboard/DashboardModules/DashboardModule.cs new file mode 100644 index 0000000..351bde0 --- /dev/null +++ b/Server Dashboard/DashboardModules/DashboardModule.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Server_Dashboard { + class DashboardModule { + public string Name { get; set; } + public string Creator { get; set; } + public DateTime Uptime { get; set; } + public ModuleItem ModuleItem { get; set; } + public DashboardModule() { + ModuleItem = new ModuleItem(); + } + } +} diff --git a/Server Dashboard/DashboardModules/ModuleItem.cs b/Server Dashboard/DashboardModules/ModuleItem.cs new file mode 100644 index 0000000..a19eacf --- /dev/null +++ b/Server Dashboard/DashboardModules/ModuleItem.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Server_Dashboard { + class ModuleItem { + public string Name { get; set; } + public double CpuTemp { get; set; } + public double GpuTemp { get; set; } + public DateTime Uptime { get; set; } + } +} diff --git a/Server Dashboard/Database/DatabaseHandler.cs b/Server Dashboard/Database/DatabaseHandler.cs new file mode 100644 index 0000000..1b2bdf0 --- /dev/null +++ b/Server Dashboard/Database/DatabaseHandler.cs @@ -0,0 +1,28 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data.SqlClient; +using System.Reflection; + +namespace Server_Dashboard { + class DatabaseHandler { + #region Private methods + /// + /// Opens a database connection + /// + /// Callback type SqlConnection + /// + private SqlConnection ConnectToDatabase(Action callback) { + using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Co2AuswertungDB"].ConnectionString)) { + try { + con.Open(); + callback(con); + con.Close(); + } catch { return null; } + } + return null; + } + #endregion + } +} diff --git a/Server Dashboard/MainWindow.xaml b/Server Dashboard/MainWindow.xaml new file mode 100644 index 0000000..072d248 --- /dev/null +++ b/Server Dashboard/MainWindow.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +