Settings fix

This commit is contained in:
Friend2868
2023-04-19 10:18:47 +02:00
parent cb00e5b768
commit f54b70ef63
5 changed files with 148 additions and 51 deletions
@@ -2,8 +2,10 @@
@using Blazorise.Components;
@using Elektrifikatsiya.Models;
@using System.Net
<Row Style="width: 100%; height: 100%">
<Column ColumnSize="ColumnSize.Is4">
<Div>
<Row Style="width: 100%; height: 100%" Margin="Margin.Is3.FromTop.OnMobile" Padding="Padding.Is4.FromStart.OnMobile">
<Div Display="Display.Flex.Row.OnDesktop" Margin=" Margin.Is3.FromBottom" Width="Width.Is100">
<Column ColumnSize="ColumnSize.Is5.OnDesktop.Is12.OnMobile">
<Bar Breakpoint="Breakpoint.Desktop"
Background="Background.White"
ThemeContrast="ThemeContrast.None"
@@ -15,15 +17,16 @@
</Bar>
<ListView TItem="Device"
Data="@plugs"
TextField="@(()=>(""))"
ValueField="@(()=>(""))"
TextField="@((_)=>(""))"
ValueField="@((_)=>(""))"
Style="border-radius: 0px 0px"
Height="100%"
MaxHeight="90%">
<ItemTemplate>
<ListGroupItem Border="Border.OnBottom">
<Row>
<Column ColumnSize="ColumnSize.Is8">
<Column ColumnSize="ColumnSize.Is6">
<Row>
<Column ColumnSize="ColumnSize.Is7">
<Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item.Name</Heading>
@@ -35,27 +38,121 @@
<br />
<Small>Room: @context.Item.Room</Small>
</Column>
<Column ColumnSize="ColumnSize.Is5">
<Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph>
</Column>
</Row>
</Column>
<Column ColumnSize="ColumnSize.Is4">
<Column ColumnSize="ColumnSize.Is4.OnDesktop.Is7.OnMobile">
<Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
<BarIcon IconName="IconName.Bolt" />
<BarIcon IconName="IconName.Delete" />
</Button>
</Column>
<br />
<br />
<Row>
<Column ColumnSize="ColumnSize.Is1.OnDesktop">
<Button @onclick="Toggle" Position="Position.Absolute.Top.Is50.Start.Is100.Translate.Middle" Color="Color.Dark" Outline>
<BarIcon IconName="IconName.Pen" />
</Button>
</Column>
</Row>
</Row>
</ListGroupItem>
</ItemTemplate>
</ListView>
</Column>
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12.OnMobile" Margin="Margin.Is3.FromTop.OnMobile" Padding="Padding.Is4.FromStart.OnMobile">
<Div hidden="@hideButtonSettings">
<Field>
<FieldLabel>
<h2>
Plug Settings
</h2>
</FieldLabel>
</Field>
<Field>
<FieldLabel>
<h5>
Plug Name
</h5>
<Paragraph>
Here you can change the name of your plug
</Paragraph>
</FieldLabel>
<TextEdit Placeholder="Enter Name" />
</Field>
<br />
<br />
<Field>
<FieldLabel>
<h5>
Change Max Output
</h5>
<Paragraph>
Here you can limit how much power your plug uses
</Paragraph>
</FieldLabel>
<TextEdit Placeholder="Enter Max Output" />
</Field>
<br />
<br />
<Field>
<FieldLabel>
<h5>
Select Room
</h5>
<Paragraph>
Here you select or change the room the plug belongs to.
</Paragraph>
</FieldLabel>
<br />
<Dropdown Display="Display.InlineBlock">
<DropdownToggle Color="Color.Primary" Width="Width.Is100">Rooms</DropdownToggle>
<DropdownMenu>
<DropdownItem>Room 1</DropdownItem>
<DropdownDivider />
<DropdownItem>Room 2</DropdownItem>
<DropdownDivider />
<DropdownItem>Room 3</DropdownItem>
</DropdownMenu>
</Dropdown>
</Field>
</Div>
<Div hidden="@(!hideButtonSettings)">
<Field>
<FieldLabel>
<h2>
General Settings
</h2>
</FieldLabel>
</Field>
<Field>
<FieldLabel>
<h5>
Electricity Price
</h5>
<Paragraph>
Here you enter your electricity price. This is gonna calculate the overall Price of your System
</Paragraph>
</FieldLabel>
<TextEdit Placeholder="Enter Electricity Price" />
</Field>
</Div>
<Column ColumnSize="ColumnSize.IsFull" TextAlignment="TextAlignment.End">
<Button Color="Color.Primary">Save</Button>
</Column>
</Column>
</Div>
</Row>
</Div>
@code {
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"), };
private bool hideButtonSettings = true;
private void Toggle()
{
hideButtonSettings = !hideButtonSettings;
}
}