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;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Elektrifikatsiya.Database
|
namespace Elektrifikatsiya.Database
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
namespace Elektrifikatsiya.Model;
|
namespace Elektrifikatsiya.Models;
|
||||||
|
|
||||||
public class Device
|
public class Device
|
||||||
{
|
{
|
||||||
@@ -11,10 +11,17 @@ public class Device
|
|||||||
public string Name { get; private set; } = string.Empty;
|
public string Name { get; private set; } = string.Empty;
|
||||||
[Required]
|
[Required]
|
||||||
public IPAddress Address { get; private set; }
|
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;
|
Key = key;
|
||||||
|
Name = name;
|
||||||
Address = address;
|
Address = address;
|
||||||
|
PowerUsage = powerUsage;
|
||||||
|
User = user;
|
||||||
|
Room = room;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public DateTime Date { 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)
|
public Event(string eventName, string description, DateTime date)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,28 +1,31 @@
|
|||||||
@page "/"
|
@page "/"
|
||||||
@using Blazorise.Components
|
@using Blazorise.Components;
|
||||||
@using Elektrifikatsiya.Models;
|
@using Elektrifikatsiya.Models;
|
||||||
@inject IVersionProvider VersionProvider
|
@inject IVersionProvider VersionProvider
|
||||||
<Row>
|
<Row>
|
||||||
<Column ColumnSize="ColumnSize.Is5">
|
<Column ColumnSize="ColumnSize.Is6">
|
||||||
<ListGroup>
|
<ListView TItem="Device"
|
||||||
@for (int i = 0; i < 3; i++)
|
Data="@plugs"
|
||||||
{
|
TextField="@((_)=>(""))"
|
||||||
|
ValueField="@((_)=>(""))"
|
||||||
|
Mode="ListGroupMode.Static">
|
||||||
|
<ItemTemplate>
|
||||||
<ListGroupItem>
|
<ListGroupItem>
|
||||||
<Row>
|
<Row>
|
||||||
<Column ColumnSize="ColumnSize.Is8">
|
<Column ColumnSize="ColumnSize.Is8">
|
||||||
<Row>
|
<Row>
|
||||||
<Column ColumnSize="ColumnSize.Is7">
|
<Column ColumnSize="ColumnSize.Is7">
|
||||||
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">Plug #@i</Heading>
|
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item.Name</Heading>
|
||||||
</Column>
|
|
||||||
<Column ColumnSize="ColumnSize.Is5">
|
|
||||||
<Paragraph Margin="Margin.Is1.OnY">60W</Paragraph>
|
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Column>
|
<Column>
|
||||||
<Small>User: ....</Small>
|
<Small>User: @context.Item.User</Small>
|
||||||
<br />
|
<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>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
</Column>
|
</Column>
|
||||||
@@ -33,16 +36,15 @@
|
|||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
</ListGroupItem>
|
</ListGroupItem>
|
||||||
}
|
</ItemTemplate>
|
||||||
</ListGroup>
|
</ListView>
|
||||||
</Column>
|
</Column>
|
||||||
<Column ColumnSize="ColumnSize.Is5">
|
<Column ColumnSize="ColumnSize.Is6">
|
||||||
<ListView TItem="Event"
|
<ListView TItem="Event"
|
||||||
Data="@events"
|
Data="@events"
|
||||||
TextField="(item) => item.EventName"
|
TextField="@((_)=>(""))"
|
||||||
ValueField="(item) => item.Description"
|
ValueField="@((_)=>(""))"
|
||||||
Mode="ListGroupMode.Static"
|
Mode="ListGroupMode.Static">
|
||||||
MaxHeight="300px">
|
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<Div Flex="Flex.InlineFlex.JustifyContent.Between" Width="Width.Is100">
|
<Div Flex="Flex.InlineFlex.JustifyContent.Between" Width="Width.Is100">
|
||||||
<Heading Size="HeadingSize.Is6" Margin="Margin.Is2.FromBottom">@context.Item.EventName</Heading>
|
<Heading Size="HeadingSize.Is6" Margin="Margin.Is2.FromBottom">@context.Item.EventName</Heading>
|
||||||
@@ -55,5 +57,6 @@
|
|||||||
</Row>
|
</Row>
|
||||||
@code {
|
@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<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": {
|
"Docker": {
|
||||||
"commandName": "Docker",
|
"commandName": "Docker",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "{Scheme}://{IPAdress}:{ServicePort}",
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||||
"publishAllPorts": true,
|
"publishAllPorts": true,
|
||||||
"useSSL": true,
|
"useSSL": true,
|
||||||
"DockerfileRunArguments": "-p 80:80 -p 443:443"
|
"DockerfileRunArguments": "-p 80:80 -p 443:443"
|
||||||
|
|||||||
Reference in New Issue
Block a user