diff --git a/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 index 747fce7..0223361 100644 Binary files a/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 and b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Server Dashboard/v16/.suo b/.vs/Server Dashboard/v16/.suo index b460527..a0bcbbf 100644 Binary files a/.vs/Server Dashboard/v16/.suo and b/.vs/Server Dashboard/v16/.suo differ diff --git a/Server Dashboard/App.xaml b/Server Dashboard/App.xaml index 3a3286a..787a7c0 100644 --- a/Server Dashboard/App.xaml +++ b/Server Dashboard/App.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Server_Dashboard" xmlns:views="clr-namespace:Server_Dashboard.Views.DashboardPages" + xmlns:modulescrud="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD" StartupUri="LoginWindow.xaml"> @@ -10,6 +11,9 @@ + + + @@ -229,7 +233,7 @@ - - + diff --git a/Server Dashboard/Controls/ServerModules/ServerModule.xaml b/Server Dashboard/Controls/ServerModules/ServerModule.xaml new file mode 100644 index 0000000..4d6f840 --- /dev/null +++ b/Server Dashboard/Controls/ServerModules/ServerModule.xaml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Server Dashboard/Controls/ServerModules/ServerModule.xaml.cs b/Server Dashboard/Controls/ServerModules/ServerModule.xaml.cs new file mode 100644 index 0000000..702692a --- /dev/null +++ b/Server Dashboard/Controls/ServerModules/ServerModule.xaml.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Server_Dashboard.Controls.ServerModules { + /// + /// Interaktionslogik für ServerModule.xaml + /// + public partial class ServerModule : UserControl { + public ServerModule() { + InitializeComponent(); + } + } +} diff --git a/Server Dashboard/DashboardModules/DashboardModule.cs b/Server Dashboard/DashboardModules/DashboardModule.cs index 78a2130..aea985c 100644 --- a/Server Dashboard/DashboardModules/DashboardModule.cs +++ b/Server Dashboard/DashboardModules/DashboardModule.cs @@ -7,9 +7,6 @@ namespace Server_Dashboard { public string ModulName { get; set; } public string Creator { get; set; } public ModuleItem ServerInfo { get; set; } - public string ModuleIcon { get; set; } - public int Width { get; set; } - public int Height { get; set; } public string StatusIndicator { get; set; } public string StatusIndicatorBG { get; set; } @@ -17,7 +14,6 @@ namespace Server_Dashboard { StatusIndicator = true ? "#20c657" : "#e53935"; StatusIndicatorBG = true ? "#94eeb0" : "#ef9a9a"; ServerInfo = new ModuleItem(true, 88.88, 69.69, DateTime.Now, "sudo", "Archlinux", "192.168.1.100", "84.102.25.96"); - } } } diff --git a/Server Dashboard/Server Dashboard.csproj b/Server Dashboard/Server Dashboard.csproj index 0469c4e..e207a9e 100644 --- a/Server Dashboard/Server Dashboard.csproj +++ b/Server Dashboard/Server Dashboard.csproj @@ -38,8 +38,10 @@ + + diff --git a/Server Dashboard/Server Dashboard.csproj.user b/Server Dashboard/Server Dashboard.csproj.user index c9b7fcd..7571c6f 100644 --- a/Server Dashboard/Server Dashboard.csproj.user +++ b/Server Dashboard/Server Dashboard.csproj.user @@ -9,20 +9,32 @@ + + Code + Code + + Code + Code + + Designer + Designer Designer + + Designer + Designer diff --git a/Server Dashboard/ViewModels/DashboardModuleViewModel.cs b/Server Dashboard/ViewModels/DashboardModuleViewModel.cs deleted file mode 100644 index 01eba6e..0000000 --- a/Server Dashboard/ViewModels/DashboardModuleViewModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; - -namespace Server_Dashboard { - class DashboardModuleViewModel : BaseViewModel { - - private ObservableCollection modules; - - public ObservableCollection Modules { - get { return modules; } - set { - if (modules != value) - modules = value; - OnPropertyChanged(nameof(modules)); - } - } - - public DashboardModuleViewModel() { - Modules = new ObservableCollection(); - for (int i = 0; i < 1; i++) { - Modules.Add(new DashboardModule() { - Creator = "Ersteller TestUser", - ModulName = "TestName", - ModuleIcon = "../../Assets/Images/PlaceHolderModuleLight.png", - Width = new Random().Next(300, 400), - Height = new Random().Next(100, 400), - }); - } - var sort = Modules.OrderBy(h => h.Height).ThenBy(w => w.Width).ToList(); - Modules = new ObservableCollection(sort); - } - #region Dashboard CRUD - private void CreateDashboard() { - - } - private void UpdateDashboard() { - - } - private void GetDashboardInformation() { - - } - private void DeleteDashboard() { - - } - #endregion - } -} \ No newline at end of file diff --git a/Server Dashboard/ViewModels/ServerModule/DashboardModuleViewModel.cs b/Server Dashboard/ViewModels/ServerModule/DashboardModuleViewModel.cs new file mode 100644 index 0000000..84ce681 --- /dev/null +++ b/Server Dashboard/ViewModels/ServerModule/DashboardModuleViewModel.cs @@ -0,0 +1,26 @@ +using Server_Dashboard.Views.DashboardPages.ModuleCRUD; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; + +namespace Server_Dashboard { + class DashboardModuleViewModel : BaseViewModel { + public string ModuleName { get; set; } + public string StatusIndicator { get; set; } + public string StatusIndicatorBG { get; set; } + public string ServerName { get; set; } + public string HostName { get; set; } + public string CpuTemp { get; set; } + public string GpuTemp { get; set; } + public string Uptime { get; set; } + public string DeployDate { get; set; } + public string PublicIpAdress { get; set; } + public string PrivateIpAdress { get; set; } + public string OSHostName { get; set; } + } +} \ No newline at end of file diff --git a/Server Dashboard/Views/DashboardPages/MainDashboardPage.xaml b/Server Dashboard/Views/DashboardPages/MainDashboardPage.xaml index 2e40986..70f66b8 100644 --- a/Server Dashboard/Views/DashboardPages/MainDashboardPage.xaml +++ b/Server Dashboard/Views/DashboardPages/MainDashboardPage.xaml @@ -4,8 +4,12 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Server_Dashboard" - xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" - mc:Ignorable="d" + xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages" + xmlns:modulescrud="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD" + xmlns:root="clr-namespace:Server_Dashboard" + xmlns:i="http://schemas.microsoft.com/xaml/behaviors" + xmlns:controls="clr-namespace:Server_Dashboard.Controls.ServerModules" + mc:Ignorable="d" d:DesignHeight="920" d:DesignWidth="1600"> @@ -36,21 +40,22 @@ Command="{Binding CreateModuleCommand}" Content="CREATE MODULE" Height="50" - Margin="0 10 0 0" + Margin="5 10 5 0" Cursor="Hand" + x:Name="CreateModule" />