mirror of
https://github.com/Stefan-5422/-T5-Elektrifikatsiya.git
synced 2026-09-04 00:45:58 +02:00
Dashboard progress / Docker fix
Dashboard Plug und Eventpanels sind jetzt scrollbar und Docker Error wurde behoben.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Elektrifikatsiya.Model;
|
||||
using Elektrifikatsiya.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Elektrifikatsiya.Database
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
@page "/"
|
||||
@using Blazorise.Components
|
||||
@using Blazorise.Components;
|
||||
@using Elektrifikatsiya.Models;
|
||||
@inject IVersionProvider VersionProvider
|
||||
<Row>
|
||||
<Column ColumnSize="ColumnSize.Is5">
|
||||
<ListGroup>
|
||||
@for (int i = 0; i < 3; i++)
|
||||
{
|
||||
<Column ColumnSize="ColumnSize.Is6">
|
||||
<ListView TItem="Device"
|
||||
Data="@plugs"
|
||||
TextField="@((_)=>(""))"
|
||||
ValueField="@((_)=>(""))"
|
||||
Mode="ListGroupMode.Static">
|
||||
<ItemTemplate>
|
||||
<ListGroupItem>
|
||||
<Row>
|
||||
<Column ColumnSize="ColumnSize.Is8">
|
||||
<Row>
|
||||
<Column ColumnSize="ColumnSize.Is7">
|
||||
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">Plug #@i</Heading>
|
||||
</Column>
|
||||
<Column ColumnSize="ColumnSize.Is5">
|
||||
<Paragraph Margin="Margin.Is1.OnY">60W</Paragraph>
|
||||
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item.Name</Heading>
|
||||
</Column>
|
||||
</Row>
|
||||
<Row>
|
||||
<Column>
|
||||
<Small>User: ....</Small>
|
||||
<Small>User: @context.Item.User</Small>
|
||||
<br />
|
||||
<Small>Room: ....</Small>
|
||||
<Small>Room: @context.Item.Room</Small>
|
||||
</Column>
|
||||
<Column ColumnSize="ColumnSize.Is5">
|
||||
<Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph>
|
||||
</Column>
|
||||
</Row>
|
||||
</Column>
|
||||
@@ -33,16 +36,15 @@
|
||||
</Column>
|
||||
</Row>
|
||||
</ListGroupItem>
|
||||
}
|
||||
</ListGroup>
|
||||
</ItemTemplate>
|
||||
</ListView>
|
||||
</Column>
|
||||
<Column ColumnSize="ColumnSize.Is5">
|
||||
<Column ColumnSize="ColumnSize.Is6">
|
||||
<ListView TItem="Event"
|
||||
Data="@events"
|
||||
TextField="(item) => item.EventName"
|
||||
ValueField="(item) => item.Description"
|
||||
Mode="ListGroupMode.Static"
|
||||
MaxHeight="300px">
|
||||
TextField="@((_)=>(""))"
|
||||
ValueField="@((_)=>(""))"
|
||||
Mode="ListGroupMode.Static">
|
||||
<ItemTemplate>
|
||||
<Div Flex="Flex.InlineFlex.JustifyContent.Between" Width="Width.Is100">
|
||||
<Heading Size="HeadingSize.Is6" Margin="Margin.Is2.FromBottom">@context.Item.EventName</Heading>
|
||||
@@ -55,5 +57,6 @@
|
||||
</Row>
|
||||
@code {
|
||||
List<Event> events = new List<Event>() { new Event("Jude", "Alles kaputt", DateTime.Now), new Event("Jude", "Alles kaputt", DateTime.Now), new Event("Jude", "Alles kaputt", DateTime.Now) };
|
||||
List<Device> plugs = new List<Device>() { 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") };
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user