Beep boop 🤖🤖🤖🤖🤖

This commit is contained in:
Stefan
2023-03-08 12:14:08 +01:00
committed by Friend2868
parent c7628106f2
commit c06940b5dd
3 changed files with 66 additions and 87 deletions
@@ -34,9 +34,6 @@
<Row> <Row>
<Column ColumnSize="ColumnSize.Is6"> <Column ColumnSize="ColumnSize.Is6">
<Row> <Row>
<Column >
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item</Heading>
</Column>
</Row> </Row>
<Row Width="Width.Is100"> <Row Width="Width.Is100">
<Column> <Column>
@@ -4,96 +4,77 @@
@using System.Net @using System.Net
@inject IVersionProvider VersionProvider @inject IVersionProvider VersionProvider
<Div> <Row Padding="Padding.Is3">
<Row Padding="Padding.Is3"> <Div Display="Display.Flex.Row.OnDesktop" Margin="Margin.Is3.FromBottom" Width="Width.Is100">
<Div Display="Display.Flex.Row.OnDesktop" Margin=" Margin.Is3.FromBottom" Width="Width.Is100"> <Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12">
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12"> <Bar Breakpoint="Breakpoint.Desktop"
<Bar Breakpoint="Breakpoint.Desktop" Background="Background.White"
Background="Background.White" ThemeContrast="ThemeContrast.None"
ThemeContrast="ThemeContrast.None" Shadow="Shadow.Remove"
Shadow="Shadow.Remove" Border="Border.Is1.RoundedTop">
Border="Border.Is1.RoundedTop"> <BarBrand>
<BarBrand> Plugs
Plugs </BarBrand>
</BarBrand> </Bar>
</Bar> <ListView TItem="Device"
<ListView TItem="Device" Data="@plugs"
Data="@plugs" TextField="@((_)=>(""))"
TextField="@((_)=>(""))" ValueField="@((_)=>(""))"
ValueField="@((_)=>(""))" Mode="ListGroupMode.Static"
Mode="ListGroupMode.Static" Style="border-radius: 0px 0px">
Style="border-radius: 0px 0px"> <ItemTemplate>
<ItemTemplate > <ListGroupItem Border="Border.OnBottom">
<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">@context.Item.Name</Heading>
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item.Name</Heading> </Column>
</Column> </Row>
</Row> <Row>
<Row> <Column>
<Column> <Small>User: @context.Item.User.Name</Small>
<Small>User: @context.Item.User</Small> <br />
<br /> <Small>Room: @context.Item.Room</Small>
<Small>Room: @context.Item.Room</Small> </Column>
</Column> <Column ColumnSize="ColumnSize.Is5">
<Column ColumnSize="ColumnSize.Is5"> <Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph>
<Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph> </Column>
</Column> </Row>
</Row> </Column>
</Column> <Column ColumnSize="ColumnSize.Is4">
<Column ColumnSize="ColumnSize.Is4"> <Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
<Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline> <BarIcon IconName="IconName.Bolt" />
<BarIcon IconName="IconName.Bolt" /> </Button>
</Button> </Column>
</Column> </Row>
</Row> </ListGroupItem>
</ListGroupItem> </ItemTemplate>
</ItemTemplate> </ListView>
</ListView>
</Column>
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12">
<Bar Breakpoint="Breakpoint.Desktop"
Background="Background.White"
ThemeContrast="ThemeContrast.None"
Shadow="Shadow.Remove"
Border="Border.Is1.Rounded.RoundedTop">
<BarBrand>
Logs
</BarBrand>
</Bar>
<ListView TItem="Event"
Data="@events"
TextField="@((_)=>(""))"
ValueField="@((_)=>(""))"
Mode="ListGroupMode.Static"
Style="border-radius: 0px 0px">
<ItemTemplate>
<Div Flex="Flex.InlineFlex.JustifyContent.Between" Width="Width.Is100">
<Heading Size="HeadingSize.Is6" Margin="Margin.Is2.FromBottom">@context.Item.EventName</Heading>
<Small>@context.Item.Date</Small>
</Div>
<Paragraph Margin="Margin.Is2.FromBottom">@context.Item.Description</Paragraph>
</ItemTemplate>
</ListView>
</Column>
</Div>
</Row>
<Row Padding="Padding.Is3">
<Column>
<Button Color="Color.Primary" Style="border-radius: 0px" Clicked="@(async () => await HandleRedraw())">Aktualisieren</Button>
<LineChart @ref="lineChart" TItem="double" />
</Column> </Column>
</Row> <Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12">
</Div> <Bar Breakpoint="Breakpoint.Desktop"
Background="Background.White"
ThemeContrast="ThemeContrast.None"
Shadow="Shadow.Remove"
Border="Border.Is1.Rounded.RoundedTop">
<BarBrand>
Logs
</BarBrand>
</Bar>
<ListView TItem="Event"
Data="@events"
TextField="@((_)=>(""))"
ValueField="@((_)=>(""))"
Mode="ListGroupMode.Static"
Style="border-radius: 0px 0px">
@code { @code {
//TODO: insert new event here if plug produces one //TODO: insert new event here if plug produces one
List<Event> events = new List<Event>() { new Event("Placeholder", "Event", DateTime.Now), new Event("Placeholder", "Event", DateTime.Now), new Event("Placeholder", "Event", DateTime.Now) }; List<Event> events = new List<Event>() { new Event("Placeholder", "Event", DateTime.Now), new Event("Placeholder", "Event", DateTime.Now), new Event("Placeholder", "Event", DateTime.Now) };
//TODO: insert new Device here if user adds one //TODO: insert new Device here if user adds one
List<Device> plugs = new List<Device>() { new Device("ffff:ffff:ffff:ffff", "Huso", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Huso", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Huso", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), }; List<Device> plugs = new List<Device>() { new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "Josne", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), };
//code for graph //code for graph
LineChart<double> lineChart; LineChart<double> lineChart;
@@ -1,6 +1,7 @@
@page "/Settings" @page "/Settings"
@using Blazorise.Components; @using Blazorise.Components;
@using Elektrifikatsiya.Models; @using Elektrifikatsiya.Models;
@using System.Net
<Row Style="width: 100%; height: 100%"> <Row Style="width: 100%; height: 100%">
<Column ColumnSize="ColumnSize.Is4"> <Column ColumnSize="ColumnSize.Is4">
<Bar Breakpoint="Breakpoint.Desktop" <Bar Breakpoint="Breakpoint.Desktop"
@@ -124,6 +125,6 @@
@code { @code {
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") }; List<Device> plugs = new List<Device>() { new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "Josne", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), };
} }