diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs index f182b24..693b9e5 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs @@ -1,4 +1,4 @@ -using Elektrifikatsiya.Model; +using Elektrifikatsiya.Models; using Microsoft.EntityFrameworkCore; namespace Elektrifikatsiya.Database diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs index 65cdf34..0176b78 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.Net; -namespace Elektrifikatsiya.Model; +namespace Elektrifikatsiya.Models; public class Device { @@ -11,10 +11,17 @@ public class Device public string Name { get; private set; } = string.Empty; [Required] public IPAddress Address { get; private set; } + public int PowerUsage { get; set; } + public string User { get; set; } + public string Room { get; set; } - public Device(string key, IPAddress address) + public Device(string key, string name, IPAddress address, int powerUsage, string user, string room) { Key = key; + Name = name; Address = address; + PowerUsage = powerUsage; + User = user; + Room = room; } } \ No newline at end of file diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Event.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Event.cs index b949a88..5c76207 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Event.cs +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Event.cs @@ -6,7 +6,7 @@ public string Description { get; set; } public DateTime Date { get; set; } - //if Plug Class implemented -> Property for plug + //if Plug Class implemented -> Property for which plug this event is from public Event(string eventName, string description, DateTime date) { diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor index 4a78171..c8f9a64 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor @@ -1,28 +1,31 @@ @page "/" -@using Blazorise.Components +@using Blazorise.Components; @using Elektrifikatsiya.Models; @inject IVersionProvider VersionProvider - - - @for (int i = 0; i < 3; i++) - { + + + - Plug #@i - - - 60W + @context.Item.Name - User: .... + User: @context.Item.User
- Room: .... + Room: @context.Item.Room +
+ + @context.Item.PowerUsage W
@@ -33,16 +36,15 @@
- } - + + - + + TextField="@((_)=>(""))" + ValueField="@((_)=>(""))" + Mode="ListGroupMode.Static">
@context.Item.EventName @@ -55,5 +57,6 @@ @code { List events = new List() { new Event("Jude", "Alles kaputt", DateTime.Now), new Event("Jude", "Alles kaputt", DateTime.Now), new Event("Jude", "Alles kaputt", DateTime.Now) }; + List plugs = new List() { new Device("Placeholder", "Plug", System.Net.IPAddress.Broadcast, 60, "Oldin", "4AHINF"), new Device("Placeholder", "Plug", System.Net.IPAddress.Broadcast, 60, "Oldin", "4AHINF"), new Device("Placeholder", "Plug", System.Net.IPAddress.Broadcast, 60, "Oldin", "4AHINF") }; } diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Properties/launchSettings.json b/src/Elektrifikatsiya/Elektrifikatsiya/Properties/launchSettings.json index 7111a52..71c02c5 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Properties/launchSettings.json +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Properties/launchSettings.json @@ -19,7 +19,7 @@ "Docker": { "commandName": "Docker", "launchBrowser": true, - "launchUrl": "{Scheme}://{IPAdress}:{ServicePort}", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", "publishAllPorts": true, "useSSL": true, "DockerfileRunArguments": "-p 80:80 -p 443:443"