mirror of
https://github.com/Stefan-5422/-T5-Elektrifikatsiya.git
synced 2026-09-10 15:46:03 +02:00
Merge branch 'feature-Dashboard' of https://github.com/Stefan-5422/-T5-Elektrifikatsiya into feature-Dashboard
This commit is contained in:
@@ -23,18 +23,18 @@
|
|||||||
Admin
|
Admin
|
||||||
</BarLink>
|
</BarLink>
|
||||||
</BarItem>
|
</BarItem>
|
||||||
<BarItem>
|
|
||||||
<BarLink To="/addplug" TextColor="TextColor.White">
|
|
||||||
<BarIcon Style="color:white" IconName="IconName.Plug" />
|
|
||||||
Add Plug
|
|
||||||
</BarLink>
|
|
||||||
</BarItem>
|
|
||||||
<BarItem>
|
<BarItem>
|
||||||
<BarLink To="/settings" TextColor="TextColor.White">
|
<BarLink To="/settings" TextColor="TextColor.White">
|
||||||
<BarIcon Style="color:white" IconName="IconName.Wrench" />
|
<BarIcon Style="color:white" IconName="IconName.Wrench" />
|
||||||
Settings
|
Settings
|
||||||
</BarLink>
|
</BarLink>
|
||||||
</BarItem>
|
</BarItem>
|
||||||
|
<BarItem>
|
||||||
|
<BarLink To="/addplug" TextColor="TextColor.White">
|
||||||
|
<BarIcon Style="color:white" IconName="IconName.Plug" />
|
||||||
|
Add Plug
|
||||||
|
</BarLink>
|
||||||
|
</BarItem>
|
||||||
</BarStart>
|
</BarStart>
|
||||||
<BarEnd>
|
<BarEnd>
|
||||||
<BarItem>
|
<BarItem>
|
||||||
|
|||||||
@@ -2,17 +2,16 @@
|
|||||||
@inherits LayoutComponentBase
|
@inherits LayoutComponentBase
|
||||||
<Image Source="logo.png" Width="Width.Is50" Height="Height.Is50"> </Image>
|
<Image Source="logo.png" Width="Width.Is50" Height="Height.Is50"> </Image>
|
||||||
<Card Width="Width.Is50" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Padding="Padding.Is5">
|
<Card Width="Width.Is50" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Padding="Padding.Is5">
|
||||||
<Field Width="Width.Is25" Position="Position.Relative.Top.Is50.Start.Is50.Translate.Middle">
|
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12.Is3.WithOffset">
|
||||||
|
<Field Position="Position.Relative.Top.Is50.Start.Is50.Translate.Middle">
|
||||||
<TextEdit Placeholder="Username" />
|
<TextEdit Placeholder="Username" />
|
||||||
</Field>
|
</Field>
|
||||||
<Field Width="Width.Is25" Position="Position.Relative.Top.Is50.Start.Is50.Translate.Middle">
|
<Field Position="Position.Relative.Top.Is50.Start.Is50.Translate.Middle">
|
||||||
<TextEdit Role="TextRole.Password" Placeholder="Password" />
|
<TextEdit Role="TextRole.Password" Placeholder="Password" />
|
||||||
</Field>
|
</Field>
|
||||||
<Button Width="Width.Is25" Color="Color.Primary" Clicked="Clicked" Position="Position.Relative.Bottom.Is50.Start.Is50.Translate.MiddleX" >Login</Button>
|
<Button Color="Color.Primary" Position="Position.Relative.Bottom.Is50.Start.Is50.Translate.MiddleX">Login</Button>
|
||||||
|
</Column>
|
||||||
</Card>
|
</Card>
|
||||||
@code {
|
@code {
|
||||||
private void Clicked()
|
|
||||||
{
|
|
||||||
Debug.WriteLine("Button was clicked!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<Column ColumnSize="ColumnSize.Is9">
|
<Column ColumnSize="ColumnSize.Is9">
|
||||||
Add a plug via wifi
|
Add a plug via wifi
|
||||||
</Column>
|
</Column>
|
||||||
<Column ColumnSize="ColumnSize.Is3.Is1.WithOffset">
|
<Column ColumnSize="ColumnSize.Is3.Is6.WithOffset">
|
||||||
<LoadingIndicator @bind-Visible="@visible">
|
<LoadingIndicator @bind-Visible="@visible">
|
||||||
</LoadingIndicator>
|
</LoadingIndicator>
|
||||||
</Column>
|
</Column>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<ListGroupItem>
|
<ListGroupItem>
|
||||||
<Row>
|
<Row>
|
||||||
<Column ColumnSize="ColumnSize.Is6">
|
<Column ColumnSize="ColumnSize.Is8">
|
||||||
<Row>
|
<Row>
|
||||||
</Row>
|
</Row>
|
||||||
<Row Width="Width.Is100">
|
<Row Width="Width.Is100">
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
</Column>
|
</Column>
|
||||||
<Column ColumnSize="ColumnSize.Is4.Is2.WithOffset">
|
<Column ColumnSize="ColumnSize.Is4">
|
||||||
<Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Clicked="@(async () => await DeviceManagmentService.RegisterDevice(context.Item,(await AuthenticationService.GetUserAsync()).ValueOrDefault))" Outline>
|
<Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Clicked="@(async () => await DeviceManagmentService.RegisterDevice(context.Item,(await AuthenticationService.GetUserAsync()).ValueOrDefault))" Outline>
|
||||||
<BarIcon IconName="IconName.Add" />
|
<BarIcon IconName="IconName.Add" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
System.Timers.Timer aTimer = new System.Timers.Timer(1000);
|
System.Timers.Timer aTimer = new System.Timers.Timer(1000);
|
||||||
aTimer.Elapsed += (_, _) => {
|
aTimer.Elapsed += (_, _) => {
|
||||||
DateTime dateTime = DateTime.UtcNow;
|
DateTime dateTime = DateTime.UtcNow;
|
||||||
if(dateTime >= time.AddSeconds(5))
|
if(dateTime >= time.AddSeconds(3))
|
||||||
{
|
{
|
||||||
visible = false;
|
visible = false;
|
||||||
InvokeAsync(StateHasChanged);
|
InvokeAsync(StateHasChanged);
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
@using Blazorise.Components;
|
@using Blazorise.Components;
|
||||||
@using Elektrifikatsiya.Models;
|
@using Elektrifikatsiya.Models;
|
||||||
@using System.Net
|
@using System.Net
|
||||||
<Div>
|
|
||||||
<Row Style="width: 100%; height: 100%">
|
<Row Style="width: 100%; height: 100%">
|
||||||
<Div Display="Display.Flex.Row.OnDesktop" Margin=" Margin.Is3.FromBottom" Width="Width.Is100">
|
<Column ColumnSize="ColumnSize.Is4">
|
||||||
<Column ColumnSize="ColumnSize.Is5.OnDesktop.Is12.OnMobile">
|
|
||||||
<Bar Breakpoint="Breakpoint.Desktop"
|
<Bar Breakpoint="Breakpoint.Desktop"
|
||||||
Background="Background.White"
|
Background="Background.White"
|
||||||
ThemeContrast="ThemeContrast.None"
|
ThemeContrast="ThemeContrast.None"
|
||||||
@@ -17,16 +15,15 @@
|
|||||||
</Bar>
|
</Bar>
|
||||||
<ListView TItem="Device"
|
<ListView TItem="Device"
|
||||||
Data="@plugs"
|
Data="@plugs"
|
||||||
TextField="@((_)=>(""))"
|
TextField="@(()=>(""))"
|
||||||
ValueField="@((_)=>(""))"
|
ValueField="@(()=>(""))"
|
||||||
Style="border-radius: 0px 0px"
|
Style="border-radius: 0px 0px"
|
||||||
Height="100%"
|
Height="100%"
|
||||||
MaxHeight="90%">
|
MaxHeight="90%">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<ListGroupItem Border="Border.OnBottom">
|
<ListGroupItem Border="Border.OnBottom">
|
||||||
<Row>
|
<Row>
|
||||||
|
<Column ColumnSize="ColumnSize.Is8">
|
||||||
<Column ColumnSize="ColumnSize.Is6">
|
|
||||||
<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>
|
||||||
@@ -38,107 +35,27 @@
|
|||||||
<br />
|
<br />
|
||||||
<Small>Room: @context.Item.Room</Small>
|
<Small>Room: @context.Item.Room</Small>
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
<Column ColumnSize="ColumnSize.Is5">
|
||||||
</Column>
|
<Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph>
|
||||||
|
|
||||||
<Column ColumnSize="ColumnSize.Is4.OnDesktop.Is7.OnMobile">
|
|
||||||
<Button class="btn1" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
|
|
||||||
<style>
|
|
||||||
.btn1:hover {
|
|
||||||
background: #E50000;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<BarIcon IconName="IconName.Delete" />
|
|
||||||
</Button>
|
|
||||||
</Column>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<Row>
|
|
||||||
<Column ColumnSize="ColumnSize.Is1.OnDesktop">
|
|
||||||
<Button Position="Position.Absolute.Top.Is50.Start.Is100.Translate.Middle" Color="Color.Dark" Outline>
|
|
||||||
<BarIcon IconName="IconName.Pen" />
|
|
||||||
</Button>
|
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
|
</Column>
|
||||||
|
<Column ColumnSize="ColumnSize.Is4">
|
||||||
|
<Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
|
||||||
|
<BarIcon IconName="IconName.Bolt" />
|
||||||
|
</Button>
|
||||||
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
</ListGroupItem>
|
</ListGroupItem>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</ListView>
|
</ListView>
|
||||||
</Column>
|
</Column>
|
||||||
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is12.OnMobile" Margin="Margin.Is3.OnMobile">
|
|
||||||
<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>
|
|
||||||
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>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<Field>
|
|
||||||
<FieldLabel>
|
|
||||||
<h5>
|
|
||||||
Select Room
|
|
||||||
</h5>
|
|
||||||
<Paragraph>
|
|
||||||
Here you select or change the Room where you use your Plug.
|
|
||||||
</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>
|
|
||||||
<Column ColumnSize="ColumnSize.IsFull" TextAlignment="TextAlignment.End">
|
|
||||||
<Button Color="Color.Primary">Save</Button>
|
|
||||||
</Column>
|
|
||||||
</Column>
|
|
||||||
</Div>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@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"), };
|
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"), };
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user