From ccedff576bc603bedd1984f914a0a7318c724f97 Mon Sep 17 00:00:00 2001 From: Friend2868 <90833416+Friend2868@users.noreply.github.com> Date: Wed, 22 Mar 2023 11:21:14 +0100 Subject: [PATCH] Settings improvement --- .../Components/Layout/SideMenu.razor | 12 +- .../DeviceManagement.sqlite-shm | Bin 0 -> 32768 bytes .../DeviceManagement.sqlite-wal | 0 .../Elektrifikatsiya/Pages/AddPlug.razor | 158 ++++++------ .../Elektrifikatsiya/Pages/Settings.razor | 240 +++++++++--------- .../Elektrifikatsiya/UserDatabase.sqlite-shm | Bin 0 -> 32768 bytes .../Elektrifikatsiya/UserDatabase.sqlite-wal | 0 7 files changed, 208 insertions(+), 202 deletions(-) create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/DeviceManagement.sqlite-shm create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/DeviceManagement.sqlite-wal create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/UserDatabase.sqlite-shm create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/UserDatabase.sqlite-wal diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Components/Layout/SideMenu.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Components/Layout/SideMenu.razor index 01a573c..956a1a0 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Components/Layout/SideMenu.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Components/Layout/SideMenu.razor @@ -23,18 +23,18 @@ Admin - - - - Add Plug - - Settings + + + + Add Plug + + diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/DeviceManagement.sqlite-shm b/src/Elektrifikatsiya/Elektrifikatsiya/DeviceManagement.sqlite-shm new file mode 100644 index 0000000000000000000000000000000000000000..fe9ac2845eca6fe6da8a63cd096d9cf9e24ece10 GIT binary patch literal 32768 zcmeIuAr62r3 - - - - - - - Add a plug via wifi - - - - - - - - - - - - - - - - - IP: @context.Item - - - - - - - - - - - - - - + + - - - - - Add a plug via IP - - - - -
- - - -
- -
-
-
-
-
-
- + + + + Add a plug via wifi + + + + + + + + + + + + + + + + + IP: @context.Item + + + + + + + + + +
+
+ + + + + + + + Add a plug via IP + + + + +
+ + + +
+ +
+
+
+
+
+
+ +
+
@code { List ipAddresses = new List(); @@ -106,7 +106,7 @@ System.Timers.Timer aTimer = new System.Timers.Timer(1000); aTimer.Elapsed += (_, _) => { DateTime dateTime = DateTime.UtcNow; - if(dateTime >= time.AddSeconds(5)) + if(dateTime >= time.AddSeconds(3)) { visible = false; InvokeAsync(StateHasChanged); diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor index b58022e..b9ba91d 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor @@ -3,129 +3,131 @@ @using Elektrifikatsiya.Models; @using System.Net
- +
- - - - Plugs - - - - - - - - - - - @context.Item.Name - - - - - User: @context.Item.User -
- Room: @context.Item.Room -
-
-
- - - - -
-
+ + + + Plugs + + + + + + + + + + @context.Item.Name + + + + + User: @context.Item.User +
+ Room: @context.Item.Room +
+
+
+ + + + +
+
+ - - +
-
-
-
-
-
- - - -
- Plug Name -
- - Here you can change the Name of your Plug - -
- -
-
-
- - -
- Change Max Output -
- - Here you can limit how much Power your Plug uses - -
- -
-
-
- - -
- Electricity Price -
- - Here you enter your electricity price. This is gonna calculate the overall Price of your System - -
- -
-
-
- - -
- Select Room -
- - Here you select or change the Room where you use your Plug. - -
-
- - Rooms - - Room 1 - - Room 2 - - Room 3 - - -
- - + + + + + + + + + + + -
@@ -133,8 +135,12 @@ @code { - - List plugs = new List() { 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; + } } diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/UserDatabase.sqlite-shm b/src/Elektrifikatsiya/Elektrifikatsiya/UserDatabase.sqlite-shm new file mode 100644 index 0000000000000000000000000000000000000000..fe9ac2845eca6fe6da8a63cd096d9cf9e24ece10 GIT binary patch literal 32768 zcmeIuAr62r3