diff --git a/src/Blue-Skies.postman_collection.json b/src/Blue-Skies.postman_collection.json new file mode 100644 index 00000000..dda5d53c --- /dev/null +++ b/src/Blue-Skies.postman_collection.json @@ -0,0 +1,819 @@ +{ + "info": { + "_postman_id": "e99e34b4-7b66-4175-806b-d7b3a232a43f", + "name": "Blue-Skies", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", + "_exporter_id": "26399949", + "_collection_link": "https://blue-skies.postman.co/workspace/Team-Workspace~d592cb1b-140c-497b-827c-44819d92650b/collection/20820830-e99e34b4-7b66-4175-806b-d7b3a232a43f?action=share&source=collection_link&creator=26399949" + }, + "item": [ + { + "name": ".NET API", + "item": [ + { + "name": "Authentication", + "item": [ + { + "name": "register", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\" : \"user25@gmail.com\",\r\n \"password\" : \"poiuytre\",\r\n \"repassword\" : \"poiuytre\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{net}}/auth/register", + "host": [ + "{{net}}" + ], + "path": [ + "auth", + "register" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "login", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"email\" : \"jasondutton@gmail.com\",\r\n \"password\" : \"123456789\",\r\n \"repassword\" : \"123456789\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/auth/login" + }, + "response": [] + } + ] + }, + { + "name": "Systems", + "item": [ + { + "name": "Get All Systems", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/System/all" + }, + "response": [] + }, + { + "name": "Create System", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"systemSize\": \"string\",\r\n \"inverterOutput\": 0,\r\n \"numberOfPanels\": 0,\r\n \"batterySize\": 0,\r\n \"numberOfBatteries\": 0,\r\n \"solarInput\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/System/create" + }, + "response": [] + }, + { + "name": "Update a System", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"systemId\": 37,\r\n \"inverterOutput\": 0,\r\n \"numberOfPanels\": 0,\r\n \"batterySize\": 50,\r\n \"numberOfBatteries\": 0,\r\n \"solarInput\": 0\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/System/update" + }, + "response": [] + }, + { + "name": "Get system by Id", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/System/get/2" + }, + "response": [] + } + ] + }, + { + "name": "Appliances", + "item": [ + { + "name": "Get All Appliances", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Appliance/all" + }, + "response": [] + }, + { + "name": "Create Appliance", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Tumble Dryer\",\r\n \"powerUsage\": 4150,\r\n \"durationUsed\": 0.5\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Appliance/create" + }, + "response": [] + }, + { + "name": "Update Appliance", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"applianceId\": \"75\",\r\n \"type\": \"Geyser\",\r\n \"powerUsage\": 600,\r\n \"durationUsed\": 24\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Appliance/update" + }, + "response": [] + }, + { + "name": "Delete Appliance", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"applianceId\": 75\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/appliance/delete" + }, + "response": [] + }, + { + "name": "Get Appliance", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Appliance/get/10" + }, + "response": [] + } + ] + }, + { + "name": "Keys", + "item": [ + { + "name": "Get All Keys", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Key/all" + }, + "response": [] + }, + { + "name": "Get All Business Keys", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Key/allBusiness" + }, + "response": [] + }, + { + "name": "Create Business Key", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"owner\": \"SolarPowa\",\r\n \"APIKey\" : \"ad988Ff89Jiydasdf6DflkUG\",\r\n \"remainingCalls\" : \"12\",\r\n \"isBusiness\": 1,\r\n \"description\": \"A small solar company that prides itself of user experience\",\r\n \"location\": \"123 driveway\",\r\n \"website\": \"https://google.com\",\r\n \"phoneNumber\": \"123456789\",\r\n \"email\": \"solar106@gmail.com\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Key/createBusiness" + }, + "response": [] + }, + { + "name": "Update Key", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"keyId\": \"7\",\r\n \"owner\": \"Solar 102\",\r\n \"APIKey\" : \"JasdgAS0685^&d0876DFdfO6DflkUG\",\r\n \"remainingCalls\" : \"7\",\r\n \"suspended\" : \"1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Key/update" + }, + "response": [] + }, + { + "name": "Update Business Key", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"keyId\": 42,\r\n \"owner\": \"SolarPowa\",\r\n \"APIKey\" : \"ad988Ff89Jiydasdf6DflkUG\",\r\n \"remainingCalls\" : \"45\",\r\n \"isBusiness\": 1,\r\n \"suspended\": 0,\r\n \"description\": \"A small solar company that prides itself of user experience\",\r\n \"location\": \"123 driveway\",\r\n \"website\": \"https://google.com\",\r\n \"phoneNumber\": \"123456789\",\r\n \"email\": \"solar106@gmail.com\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Key/updateBusiness" + }, + "response": [] + }, + { + "name": "Delete Key", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Key/delete/53" + }, + "response": [] + } + ] + }, + { + "name": "Location Data", + "item": [ + { + "name": "Get map box api key", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/mapboxkey" + }, + "response": [] + }, + { + "name": "Create Location Data", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"latitude\": -25.7810362,\r\n \"longitude\": 28.354123563,\r\n \"locationName\": \"This is your house\",\r\n \"solarPanelsData\": \"This is gonna be json data\",\r\n \"satteliteImageData\": \"SGVsbG8gd29ybGQh\",\r\n \"satteliteImageElevationData\": \"SGVsbG8gd29ybGQh\",\r\n \"annualFluxData\": \"SGVsbG8gd29ybGQh\",\r\n \"monthlyFluxData\": \"SGVsbG8gd29ybGQh\",\r\n \"maskData\": \"SGVsbG8gd29ybGQh\",\r\n \"horisonElevationData\": \"The elevation data\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/locationData/create" + }, + "response": [] + }, + { + "name": "Get Location Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/getLocationData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Delete Solar Score", + "request": { + "method": "DELETE", + "header": [], + "url": "{{net}}/locationData/delete/-25.71/28.357" + }, + "response": [] + }, + { + "name": "Get Essential Location Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/essentialData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Check if location data exists", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/checkIfLocationDataExists/-25.834223/28.29341" + }, + "response": [] + }, + { + "name": "Get Initial Location Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/InitialData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Get Satellite Image location data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/SatelliteImageData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Get Mask Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/MaskData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Get Annual Flux Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/AnnualFluxData/-25.78097/28.267354" + }, + "response": [] + }, + { + "name": "Get Monthly Flux Data", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/locationData/MonthlyFluxData/-25.78097/28.267354" + }, + "response": [] + } + ] + }, + { + "name": "Admin Stats", + "item": [ + { + "name": "System Usage", + "item": [ + { + "name": "Get System Usage", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/adminstats/all" + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Reports", + "item": [ + { + "name": "Create Report", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"reportName\" : \"Ruan wants to navigate to the newest report\",\r\n \"userId\" : 69,\r\n \"homeSize\": \"Small\",\r\n \"latitude\" : \"-25.78097\",\r\n \"longitude\" : \"28.267354\",\r\n \"systemId\" : 3\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Report/create" + }, + "response": [] + }, + { + "name": "Get All Reports", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Report/all" + }, + "response": [] + }, + { + "name": "Get User Reports", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Report/getUserReports/69" + }, + "response": [] + }, + { + "name": "Get Report", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/Report/get/123" + }, + "response": [] + }, + { + "name": "Update Report", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"reportId\" : 123,\r\n \"reportName\" : \"Is update working\",\r\n \"userId\" : 69,\r\n \"homeSize\": \"Large\",\r\n \"latitude\" : \"-25.816669\",\r\n \"longitude\" : \"28.154035\",\r\n \"systemId\" : 3\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Report/update" + }, + "response": [] + }, + { + "name": "Delete Report", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"reportId\": 123\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/Report/delete" + }, + "response": [] + }, + { + "name": "Download Report", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/pdf", + "type": "text" + } + ], + "url": "{{net}}/Report/downloadReport/69/123" + }, + "response": [] + } + ] + }, + { + "name": "Report All Appliances", + "item": [ + { + "name": "Get All Appliance Report", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/ReportAllAppliance/all" + }, + "response": [] + }, + { + "name": "Get Report By Report Id", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/ReportAllAppliance/getByReportId/91" + }, + "response": [] + } + ] + }, + { + "name": "Report Appliance", + "item": [ + { + "name": "Create Report Appliance", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"reportId\": 41,\r\n \"applianceId\": 1,\r\n \"numberOfAppliances\": 1,\r\n \"applianceModel\": \"Samsung TV\",\r\n \"powerUsage\": 200,\r\n \"durationUsed\": 123.2356\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/ReportAppliance/create" + }, + "response": [] + }, + { + "name": "Get All Report Appliances", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/ReportAppliance/all" + }, + "response": [] + }, + { + "name": "Get Appliances in Report", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/ReportAppliance/getAppliancesInReport/91" + }, + "response": [] + }, + { + "name": "Get Reports With Appliance", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/ReportAppliance/getReportsWithAppliance/11" + }, + "response": [] + }, + { + "name": "Update Number of Appliances", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"reportId\": 41,\r\n \"applianceId\": 1,\r\n \"numberOfAppliances\": 20\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/ReportAppliance/updateNumberOfAppliances" + }, + "response": [] + }, + { + "name": "Update ReportId", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/ReportAppliance/updateReportId/16/21" + }, + "response": [] + }, + { + "name": "Update ApplianceId", + "request": { + "method": "PATCH", + "header": [], + "url": "{{net}}/ReportAppliance/updateApplianceId/14/31" + }, + "response": [] + }, + { + "name": "Delete ReportId", + "request": { + "method": "DELETE", + "header": [], + "url": "{{net}}/ReportAppliance/deleteReportId/41" + }, + "response": [] + }, + { + "name": "Delete ApplianceId", + "request": { + "method": "DELETE", + "header": [], + "url": "{{net}}/ReportAppliance/deleteApplianceId/31" + }, + "response": [] + }, + { + "name": "Delete Report Appliance", + "request": { + "method": "DELETE", + "header": [], + "url": "{{net}}/ReportAppliance/deleteReportAppliance/13/1" + }, + "response": [] + } + ] + }, + { + "name": "Business API", + "item": [ + { + "name": "Business API Request Data", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"key\": \"ad988Ff89Jiyd0876DFdfO6DflkUG\",\r\n \"data\": \"solar score\",\r\n \"latitude\": -25.78097,\r\n \"longitude\": 28.267354\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "https://dot-net-api.azurewebsites.net/BusinessRequestData/post" + }, + "response": [] + }, + { + "name": "Get Solar Panels Layout", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"key\": \"ad988Ff89Jiyd0876DFdfO6DflkUG\",\r\n \"total_panels\": 10,\r\n \"latitude\": -25.78097,\r\n \"longitude\": 28.267354\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/BusinessBestSolarPanels/post" + }, + "response": [] + } + ] + }, + { + "name": "customAppliance", + "item": [ + { + "name": "Create Custom Appliance", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Other\",\r\n \"model\": \"Canon - PIXMA MG2545S A4 3in1 Multifunction Inkjet Printer\",\r\n \"powerUsage\": 30\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{net}}/customAppliance/create" + }, + "response": [] + }, + { + "name": "Get all custom appliances", + "request": { + "method": "GET", + "header": [], + "url": "{{net}}/customAppliance/all" + }, + "response": [] + }, + { + "name": "Delete", + "request": { + "method": "DELETE", + "header": [], + "url": "{{net}}/customAppliance/delete/121" + }, + "response": [] + } + ], + "description": "The custom appliances" + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "express", + "value": "http://localhost:3333" + }, + { + "key": "net", + "value": "http://localhost:5096" + } + ] +} \ No newline at end of file diff --git a/src/Prod.postman_environment.json b/src/Prod.postman_environment.json new file mode 100644 index 00000000..2947bceb --- /dev/null +++ b/src/Prod.postman_environment.json @@ -0,0 +1,21 @@ +{ + "id": "bab9411c-9bf9-46d3-b3d7-8c51b1f5685e", + "name": "Prod", + "values": [ + { + "key": "express", + "value": "express-microservice.azurewebsites.net", + "type": "default", + "enabled": true + }, + { + "key": "net", + "value": "https://dot-net-api.azurewebsites.net", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2023-10-09T18:50:52.338Z", + "_postman_exported_using": "Postman/10.18.11" +} \ No newline at end of file diff --git a/src/apps/api/Controllers/BusinessBestSolarPanelsController.cs b/src/apps/api/Controllers/BusinessBestSolarPanelsController.cs index 5531a526..9404412f 100644 --- a/src/apps/api/Controllers/BusinessBestSolarPanelsController.cs +++ b/src/apps/api/Controllers/BusinessBestSolarPanelsController.cs @@ -17,7 +17,7 @@ public BusinessBestSolarPanelsController() _keysRepository = new KeysRepository(); } - [HttpPost("post")] + [HttpGet("get")] public async Task CreateBusinessBestSolarPanels([FromBody] BestSolarPanelsInput bestSolarPanelsInput) { try diff --git a/src/apps/api/Controllers/BusinessRequestDataController.cs b/src/apps/api/Controllers/BusinessRequestDataController.cs index 5a63e4b0..17b216ab 100644 --- a/src/apps/api/Controllers/BusinessRequestDataController.cs +++ b/src/apps/api/Controllers/BusinessRequestDataController.cs @@ -17,7 +17,7 @@ public BusinessRequestDataController() _keysRepository = new KeysRepository(); } - [HttpPost("post")] + [HttpGet("get")] public async Task CreateBusinessRequestData([FromBody] BusinessRequestData businessRequestData) { try diff --git a/src/apps/api/Repository/BusinessBestSolarPanelsRepository.cs b/src/apps/api/Repository/BusinessBestSolarPanelsRepository.cs index 0915fb44..31799f6a 100644 --- a/src/apps/api/Repository/BusinessBestSolarPanelsRepository.cs +++ b/src/apps/api/Repository/BusinessBestSolarPanelsRepository.cs @@ -10,16 +10,7 @@ public class BusinessBestSolarPanelsRepository private DataHandlers.RooftopDataHandler rooftopDataHandler = new DataHandlers.RooftopDataHandler(); private SharedUtils.otherDataClass otherDataClass = new SharedUtils.otherDataClass(); private string locationName = ""; - private string express = "http://localhost:3333"; - private string? API_PORT = Environment.GetEnvironmentVariable("API_PORT"); - public BusinessBestSolarPanelsRepository() - { - var backendexpress = Environment.GetEnvironmentVariable("EXPRESS_BACKEND"); - if (backendexpress != null) - { - express = backendexpress; - } - } + public async Task GetProcessedDataAsync(BestSolarPanelsInput bestSolarPanelsInput) { LocationDataModel? currentLocationData = new LocationDataModel(); diff --git a/src/apps/api/Repository/BusinessRequestDataRepository.cs b/src/apps/api/Repository/BusinessRequestDataRepository.cs index a79d98f2..a6d3d84b 100644 --- a/src/apps/api/Repository/BusinessRequestDataRepository.cs +++ b/src/apps/api/Repository/BusinessRequestDataRepository.cs @@ -40,18 +40,17 @@ public async Task GetProcessedDataAsync(BusinessRequestData requestData) var data = requestData.data; double latitude = requestData.latitude; double longitude = requestData.longitude; - - //create data if not created yet var client = new HttpClient(); var dataTypeResponse = new HttpResponseMessage(); - + LocationDataModel? locationData = await locationDataClass.GetLocationData(latitude, longitude); locationName = await otherDataClass.GetLocationNameFromCoordinates(latitude, longitude); if (locationData == null) { await locationDataClass.CreateLocationData(latitude, longitude, locationName); } + typeOfData = data!; switch(data!.ToLower()){ case DataType.SOLAR_SCORE : diff --git a/src/apps/blazor-app/Components/Advanced/BuildYourHome.razor b/src/apps/blazor-app/Components/Advanced/BuildYourHome.razor index 7bac43b6..44744fee 100644 --- a/src/apps/blazor-app/Components/Advanced/BuildYourHome.razor +++ b/src/apps/blazor-app/Components/Advanced/BuildYourHome.razor @@ -263,7 +263,7 @@
- +
@@ -284,7 +284,7 @@
- + } else @@ -523,12 +523,12 @@ /// protected override async Task OnInitializedAsync() { - panelTimer = new Timer(100); + panelTimer = new Timer(200); panelTimer.Elapsed += SetNumberPanels; panelTimer.AutoReset = false; panelTimer.Enabled = true; - batteryTimer = new Timer(100); + batteryTimer = new Timer(200); batteryTimer.Elapsed += SetNumberOfBatteries; batteryTimer.AutoReset = false; batteryTimer.Enabled = true; diff --git a/src/apps/blazor-app/Components/Advanced/Finanace.razor b/src/apps/blazor-app/Components/Advanced/Finanace.razor index 2a9b234f..2b685b1d 100644 --- a/src/apps/blazor-app/Components/Advanced/Finanace.razor +++ b/src/apps/blazor-app/Components/Advanced/Finanace.razor @@ -3,6 +3,8 @@ @using ChartJs.Blazor.BarChart @using BlazorApp.Models @using BlazorApp.Components.Base +@using System.Timers +@implements IDisposable

Potential Savings and

@@ -10,25 +12,19 @@

All calculations are derived from the monthly bill. Please keep in mind that these calculations are approximate, and costs may vary among different solar installers."

-
-
+
+

Select your monthly bill:

R @monthlyBill

- +
-

OR

-
-

Select your monthly electricity usage:

-

@monthlyUsage kWh

- -
-
+

Potential Payback

@@ -53,15 +49,19 @@ @code { private BarConfig? barConfig; private int monthlyBill = 3500; - private int monthlyUsage = 600; private BarDataset? dataset; private string[] colors = { "#d2d2d2", "#d2d2d2", "#d2d2d2", "#d2d2d2" }; private double min = 0; private SystemInfo? activeSystem; - + Timer timer = default!; protected override void OnInitialized() { + timer = new Timer(10); + timer.Elapsed += HandleBillSliderChange; + timer.AutoReset = true; + timer.Enabled = true; + barConfig = new BarConfig { Options = new BarOptions @@ -134,26 +134,22 @@ barConfig.Data.Datasets.Add(dataset); } - private void HandleBillSliderChange(ChangeEventArgs e) + private void ResetTimer(ChangeEventArgs e) { - if (int.TryParse(e.Value!.ToString(), out int newValue)) - { - monthlyBill = newValue; - var round = Math.Round((monthlyBill / 2.5) / 10.0, 0); - monthlyUsage = (int) round * 10; - UpdateGraph(); - } + timer.Stop(); + int.TryParse(e.Value!.ToString(), out monthlyBill); + timer.Start(); } - private void HandleUsageSliderChange(ChangeEventArgs e) + private void HandleBillSliderChange(Object? source, ElapsedEventArgs e) { - if (int.TryParse(e.Value!.ToString(), out int newValue)) - { - monthlyUsage = newValue; - var round = Math.Round((monthlyUsage * 2.5) / 100.0, 0); - monthlyBill = (int) round * 100; - UpdateGraph(); - } + var round = Math.Round((monthlyBill / 2.5) / 10.0, 0); + UpdateGraph(); + } + + void IDisposable.Dispose() + { + timer.Dispose(); } private void UpdateGraph(){ diff --git a/src/apps/blazor-app/Components/ApplianceEnergyConsumption.razor b/src/apps/blazor-app/Components/ApplianceEnergyConsumption.razor index 571ceacb..e362f4e9 100644 --- a/src/apps/blazor-app/Components/ApplianceEnergyConsumption.razor +++ b/src/apps/blazor-app/Components/ApplianceEnergyConsumption.razor @@ -3,7 +3,7 @@ -@code{ +@code { [Parameter] public List? reportAllAppliance { get; set; } @@ -12,60 +12,55 @@ public bool animated { get; set; } = true; private PolarAreaConfig polarAreaConfig = new PolarAreaConfig(); - string[] backgroundColors = new string[] { "rgba(255,193,8, 1)", "rgba(246,135,18, 1)", "rgba(0,15,82, 1)", "rgba(255,193,8, 1)", "rgba(246,135,18, 1)" }; + string[] backgroundColors = new string[] { "rgba(255,193,8, 1)", "rgba(246,135,18, 1)", "rgba(0,15,82, 1)", +"rgba(255,193,8, 1)", "rgba(246,135,18, 1)" }; @* OnInitialized *@ protected override void OnInitialized() { polarAreaConfig = new PolarAreaConfig() - { - Options = new PolarAreaOptions { - Responsive = true, - AspectRatio = 1.5, - Legend = new Legend - { - Display = false, - }, - Animation = new ArcAnimation - { - AnimateRotate = animated, - Duration = animated == true ? 2000 : 0, - - }, - Tooltips = new Tooltips + Options = new PolarAreaOptions { - Enabled = true, - Mode = InteractionMode.Index, - Intersect = false - }, - Hover = new Hover - { - Mode = InteractionMode.Index, - Intersect = false - }, - Scale = new LinearRadialAxis - { - Ticks = new LinearRadialTicks + Responsive = true, + AspectRatio = 1.5, + Legend = new Legend { Display = false, - } - } + }, + Animation = new ArcAnimation + { + AnimateRotate = animated, + Duration = animated == true ? 2000 : 0, - } - }; - RenderCharts(); - } + }, + Tooltips = new Tooltips + { + Enabled = true, + Mode = InteractionMode.Index, + Intersect = false + }, + Hover = new Hover + { + Mode = InteractionMode.Index, + Intersect = false + }, + Scale = new LinearRadialAxis + { + Ticks = new LinearRadialTicks + { + Display = false, + } + } - @* OnParametersSet *@ - protected override void OnParametersSet() - { + } + }; RenderCharts(); } public void RenderCharts() { - if(reportAllAppliance is not null) + if (reportAllAppliance is not null) { polarAreaConfig.Data.Labels.Clear(); polarAreaConfig.Data.Datasets.Clear(); @@ -73,23 +68,25 @@ for (int i = 0; i < reportAllAppliance.Count; i++) { powerUsageData[i] = reportAllAppliance[i].numberOfAppliances * reportAllAppliance[i].defaultPowerUsage; - polarAreaConfig.Data.Labels.Add(reportAllAppliance[i].type + " - " + reportAllAppliance[i].applianceModel); + polarAreaConfig.Data.Labels.Add(reportAllAppliance[i].type + " - " + reportAllAppliance[i].applianceModel); } string[] backgroundColor = new string[reportAllAppliance.Count]; for (int i = 0; i < reportAllAppliance.Count; i++) { backgroundColor[i] = backgroundColors[i % backgroundColors.Length]; - + } PolarAreaDataset polarDataset = new PolarAreaDataset(powerUsageData) - { - BackgroundColor = backgroundColor, - BorderWidth = 0, - }; + { + BackgroundColor = backgroundColor, + BorderWidth = 0, + }; polarAreaConfig.Data.Datasets.Add(polarDataset); StateHasChanged(); - }else{ + } + else + { Console.WriteLine("reportAllAppliance is null"); } } diff --git a/src/apps/blazor-app/Components/Base/Image.razor b/src/apps/blazor-app/Components/Base/Image.razor index 3eb8754c..e8c45a61 100644 --- a/src/apps/blazor-app/Components/Base/Image.razor +++ b/src/apps/blazor-app/Components/Base/Image.razor @@ -17,7 +17,7 @@ } else { -
- @if (currentPage == "dashboard") { - -
-

Advanced Calculations

-
- -

More information about your location. The flux map shows the your roof's sunlight exposure.

-
-
- } else { - -

Fancy Data and

-

Advanced Calculations

-

More information about your location. The flux map shows the your roof's sunlight exposure."

-
- } - -
-
-

Annual Flux Map

-

Visual representation of the annual sunlight exposure on your rooftop.

- sattelite Image -
-
-
-

High sunlight exposure

-
-
-
-

Low sunlight exposure

-
-
+
+ @if (currentPage == "dashboard") + { + +
+

Advanced Calculations

+
+ +

More information about your location. The flux map shows the your roof's sunlight exposure.

+
+
+ } + else + { + + +

Fancy Data and

+
+
+

Advanced Calculations

+
+ +

More information about your location. The flux map shows the your roof's sunlight + exposure."

+
+
+ } +
+ @if (annualFluxDataReceived) + { +
+

Annual Flux Map

+

Visual representation of the annual sunlight exposure on your + rooftop.

+ sattelite Image +
+
+
+

High sunlight exposure

+
+
+
+

Low sunlight exposure

+
+
+ } else { + + } -
- - - @if(solarPanelsData != null){ +
+ @if (solarPanelsDataReceived) + { + @if (solarPanelsData != null) + { +

Rooftop Stats

@@ -60,103 +78,120 @@ Math.Round(solarPanelsData!.solarPotential!.maxSunshineHoursPerYear / 365, 2); } -
- -

@tooltipService.SetCustomTooltip("Rooftop area")

-
- Home Icon -

@squaredArea m²

-
+
+ +

@tooltipService.SetCustomTooltip("Rooftop area")

+
+ Home Icon +

@squaredArea m²

+
-
- -

@tooltipService.SetCustomTooltip("Max solar panels that will fit")

-
- Solar Panels Icon -

@solarPanelsData!.solarPotential!.maxArrayPanelsCount

-
+
+ +

@tooltipService.SetCustomTooltip("Max solar panels that will fit")

+
+ Solar Panels Icon +

@solarPanelsData!.solarPotential!.maxArrayPanelsCount

+
-
- -

@tooltipService.SetCustomTooltip("Area of the roof, suitable for solar panels")

-
- Area Icon -

@maxArraArea m²

-
+
+ +

@tooltipService.SetCustomTooltip("Area of the roof, suitable for solar panels")

+
+ Area Icon +

@maxArraArea m²

+
-
- -

@tooltipService.SetCustomTooltip("Total usable sunlight times per day")

-
- Sun Icon -

@maxHoursSunlightPerDay h

-
+
+ +

@tooltipService.SetCustomTooltip("Total usable sunlight times per day")

+
+ Sun Icon +

@maxHoursSunlightPerDay h

+
} - else{ -

Solar Panels Data != available

+ else + { +

Solar Panels Data != available

} -
+ } + else + { + + }
+
-
+
+ @if (monthlyFluxDataReceived) + {

Monthly Flux Map

- @if(monthlyFluxMap != null) { + @if (monthlyFluxMap != null) + {

@monthNames[@currentImageIndex]

- +
- Left Arrow + Left Arrow
- sattelite Image + sattelite Image
- Right Arrow + Right Arrow
} - else{ + else + {

Monthly Flux Map != available

- } -
-
-

Solar Irradiance Per Month

- + }
+ } else { + + } +
+

Solar Irradiance Per Month

+
+
-
-
-

Sun path over the horizon

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores cupiditate impedit ipsam temporibus, dignissimos nostrum.

- +
+
+

Sun path over the horizon

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. + Asperiores cupiditate impedit ipsam temporibus, dignissimos nostrum.

+ +
+ +
+
+

Your location

+
+
+
+

Horizon

+
+
+
+

Sun - Winter Solstice

+
+
+
+

Sun - Spring Equinox

+
+
+
+

Sun - Summer Solstice

- -
-
-

Your location

-
-
-
-

Horizon

-
-
-
-

Sun - Winter Solstice

-
-
-
-

Sun - Spring Equinox

-
-
-
-

Sun - Summer Solstice

-
-
-
+
+
@code { @@ -180,7 +215,8 @@ private DataHandlers.SolarDataHandler solarDataHandler = new DataHandlers.SolarDataHandler(); private string? satteliteImageSrc = ""; private string?[]? monthlyFluxMap = new string[12]; - private string[] monthNames = new string[12]{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; + private string[] monthNames = new string[12]{"January", "February", "March", "April", "May", "June", "July", "August", +"September", "October", "November", "December"}; private int currentImageIndex = 0; @@ -190,14 +226,21 @@ private Wholeroofstats? wholeroofstats = null; private List solarPanels = new List(); + private bool solarPanelsDataReceived = false; + private bool monthlyFluxDataReceived = false; + private bool annualFluxDataReceived = false; + protected override void OnParametersSet() { - if(currentLocationData != null) { - if(currentLocationData.horisonElevationData != null) { + if (currentLocationData != null) + { + if (currentLocationData.horisonElevationData != null) + { horisonElevationData = currentLocationData.horisonElevationData; } - if(currentLocationData.solarPanelsData != null) { + if (currentLocationData.solarPanelsData != null) + { solarPanelsData = currentLocationData.solarPanelsData; } SetAllVariables(); @@ -205,35 +248,71 @@ } } - private async Task GetMontlyFluxData() { - if(currentLocationData != null && (cancellationTokenSource == null || cancellationTokenSource.Token.IsCancellationRequested == false)) { - if(currentLocationData.monthlyFluxData == null) { - LocationDataModel? result = null; - if(cancellationTokenSource == null) { - result = await locationDataClass.GetMonthlyFluxData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData); - } else { - result = await locationDataClass.GetMonthlyFluxData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData, cancellationTokenSource.Token); + private Task GetSatteliteImageData() + { + if (currentLocationData != null && (cancellationTokenSource == null || + cancellationTokenSource.Token.IsCancellationRequested == false)) + { + if (currentLocationData.satteliteImageData != null) + { + satteliteImageData = currentLocationData.satteliteImageData; + SetAllVariables(); + _ = GetMaskData(); + } + } + return Task.CompletedTask; + } + + private async Task GetMaskData() + { + if (currentLocationData != null && (cancellationTokenSource == null || + cancellationTokenSource.Token.IsCancellationRequested == false)) + { + if (currentLocationData.maskData == null) + { + LocationDataModel? result; + if (cancellationTokenSource == null) + { + result = await locationDataClass.GetMaskData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData); + } + else + { + result = await locationDataClass.GetMaskData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData, cancellationTokenSource.Token); } - if(result != null) { + if (result != null) + { currentLocationData = result; } - Console.WriteLine("Done retrieving monthly flux data"); + Console.WriteLine("Done retrieving mask data"); } - monthlyFluxData = currentLocationData.monthlyFluxData; + maskData = currentLocationData.maskData; SetAllVariables(); + _ = GetAnnualFluxData(); } } - private async Task GetAnnualFluxData() { - if(currentLocationData != null && (cancellationTokenSource == null || cancellationTokenSource.Token.IsCancellationRequested == false)) { - if(currentLocationData.annualFluxData == null) { + private async Task GetAnnualFluxData() + { + if (currentLocationData != null && (cancellationTokenSource == null || + cancellationTokenSource.Token.IsCancellationRequested == false)) + { + if (currentLocationData.annualFluxData == null) + { LocationDataModel? result; - if(cancellationTokenSource == null) { - result = await locationDataClass.GetAnnualFluxData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData); - } else { - result = await locationDataClass.GetAnnualFluxData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData, cancellationTokenSource.Token); + if (cancellationTokenSource == null) + { + result = await locationDataClass.GetAnnualFluxData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData); + } + else + { + result = await locationDataClass.GetAnnualFluxData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData, cancellationTokenSource.Token); } - if(result != null) { + if (result != null) + { currentLocationData = result; } Console.WriteLine("Done retrieving annual flux data"); @@ -244,73 +323,86 @@ } } - private Task GetSatteliteImageData() { - if(currentLocationData != null && (cancellationTokenSource == null || cancellationTokenSource.Token.IsCancellationRequested == false)) { - if(currentLocationData.satteliteImageData != null) { - satteliteImageData = currentLocationData.satteliteImageData; - SetAllVariables(); - _ = GetMaskData(); - } - } - return Task.CompletedTask; - } - - private async Task GetMaskData() { - if(currentLocationData != null && (cancellationTokenSource == null || cancellationTokenSource.Token.IsCancellationRequested == false)) { - if(currentLocationData.maskData == null) { - LocationDataModel? result; - if(cancellationTokenSource == null) { - result = await locationDataClass.GetMaskData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData); - } else { - result = await locationDataClass.GetMaskData(currentLocationData.latitude, currentLocationData.longitude, currentLocationData, cancellationTokenSource.Token); + private async Task GetMontlyFluxData() + { + if (currentLocationData != null && (cancellationTokenSource == null || + cancellationTokenSource.Token.IsCancellationRequested == false)) + { + if (currentLocationData.monthlyFluxData == null) + { + LocationDataModel? result = null; + if (cancellationTokenSource == null) + { + result = await locationDataClass.GetMonthlyFluxData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData); } - if(result != null) { + else + { + result = await locationDataClass.GetMonthlyFluxData(currentLocationData.latitude, currentLocationData.longitude, + currentLocationData, cancellationTokenSource.Token); + } + if (result != null) + { currentLocationData = result; } - Console.WriteLine("Done retrieving mask data"); + Console.WriteLine("Done retrieving monthly flux data"); } - maskData = currentLocationData.maskData; + monthlyFluxData = currentLocationData.monthlyFluxData; SetAllVariables(); - _ = GetAnnualFluxData(); } } - private void SetAllVariables() { - if(cancellationTokenSource != null && cancellationTokenSource.Token.IsCancellationRequested == true) { + private void SetAllVariables() + { + if (cancellationTokenSource != null && cancellationTokenSource.Token.IsCancellationRequested == true) + { return; } - if(satteliteImageData != null && maskData != null) { - if(annualFluxData != null && satteliteImageSrc == "") { + if (satteliteImageData != null && maskData != null) + { + if (annualFluxData != null && satteliteImageSrc == "") + { satteliteImageSrc = rooftopDataHandler.GetAnnualFluxMap(annualFluxData, satteliteImageData, maskData); + annualFluxDataReceived = true; } - if(monthlyFluxData != null && monthlyFluxMap![0] == null) { + if (monthlyFluxData != null && monthlyFluxMap![0] == null) + { monthlyFluxMap = rooftopDataHandler.GetMonthlyFluxMap(monthlyFluxData, satteliteImageData, maskData); solarRadiationPerMonth = solarDataHandler.getMontlySolarRadiation(monthlyFluxData, maskData, true); + monthlyFluxDataReceived = true; } } - if(solarPanelsData != null && solarPanels.Count == 0) { + if (solarPanelsData != null && solarPanels.Count == 0) + { solarPanels = solarDataHandler.getBestSolarPanels(numSolarPanels, solarPanelsData); wholeroofstats = solarPanelsData!.solarPotential!.wholeRoofStats; annualKWGenerated = solarDataHandler.getAnnualKwGenerated(numSolarPanels, solarPanelsData); + solarPanelsDataReceived = true; } StateHasChanged(); } - private void IncreamentMonthImage(){ - if(currentImageIndex < monthlyFluxMap!.Length - 1){ + private void IncreamentMonthImage() + { + if (currentImageIndex < monthlyFluxMap!.Length - 1) + { currentImageIndex++; - } else if (currentImageIndex == monthlyFluxMap!.Length - 1) + } + else if (currentImageIndex == monthlyFluxMap!.Length - 1) { currentImageIndex = 0; } } - private void DecrementMonthImage(){ - if(currentImageIndex > 0){ + private void DecrementMonthImage() + { + if (currentImageIndex > 0) + { currentImageIndex--; - } else if (currentImageIndex == 0) + } + else if (currentImageIndex == 0) { currentImageIndex = monthlyFluxMap!.Length - 1; } } -} +} diff --git a/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/AnnualFluxSkeleton.razor b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/AnnualFluxSkeleton.razor new file mode 100644 index 00000000..a9659454 --- /dev/null +++ b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/AnnualFluxSkeleton.razor @@ -0,0 +1,20 @@ +
+

Annual Flux Map

+

Visual representation of the annual sunlight exposure on your + rooftop.

+
+ + + +
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/EnviromentImpactSkeleton.razor b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/EnviromentImpactSkeleton.razor new file mode 100644 index 00000000..19f97145 --- /dev/null +++ b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/EnviromentImpactSkeleton.razor @@ -0,0 +1,118 @@ + +

Rooftop Stats

+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+
+
+ +

Rooftop Stats

+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+ +
+ + + +
+
+
+
+
+
\ No newline at end of file diff --git a/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/MonthlyFluxSkeleton.razor b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/MonthlyFluxSkeleton.razor new file mode 100644 index 00000000..ad8f3c14 --- /dev/null +++ b/src/apps/blazor-app/Components/Dashboard/FancyData/Skeletons/MonthlyFluxSkeleton.razor @@ -0,0 +1,22 @@ +
+

Monthly Flux Map

+

January

+ +
+
+ Left Arrow +
+
+ + + +
+
+ Right Arrow +
+
+
\ No newline at end of file diff --git a/src/apps/blazor-app/Components/Dashboard/LocationInfo.razor b/src/apps/blazor-app/Components/Dashboard/LocationInfo.razor index 6bbf5125..6c3bf55f 100644 --- a/src/apps/blazor-app/Components/Dashboard/LocationInfo.razor +++ b/src/apps/blazor-app/Components/Dashboard/LocationInfo.razor @@ -7,7 +7,7 @@ Rob
- @if (currentLocationData != null && displayNewData) + @if (currentLocationData != null && displayNewData && displayImage) {
@@ -180,6 +180,7 @@ [Parameter] public bool displayNewData { get; set; } public int selectedSystem { get; set; } + private bool displayImage = false; protected override void OnParametersSet(){ for (int i = 0; i < systems!.Count; i++) @@ -193,7 +194,7 @@ if(currentLocationData != null) { if(currentLocationData.satteliteImageData != null) { satteliteImage = rooftopDataHandler.GetSatelliteImage(currentLocationData!.satteliteImageData!); - StateHasChanged(); + displayImage = true; } } } diff --git a/src/apps/blazor-app/Components/Dashboard/SelectCalculation.razor b/src/apps/blazor-app/Components/Dashboard/SelectCalculation.razor index 5969bfd6..3a739e4e 100644 --- a/src/apps/blazor-app/Components/Dashboard/SelectCalculation.razor +++ b/src/apps/blazor-app/Components/Dashboard/SelectCalculation.razor @@ -42,13 +42,26 @@

@date

-
- -
+ @if (isReportGenerated) + { +
+ +
+ } + else + { +
+ +
+ } } else {
diff --git a/src/apps/blazor-app/Components/SolarScore/Results.razor b/src/apps/blazor-app/Components/SolarScore/Results.razor index ff3047ac..0d5e32a7 100644 --- a/src/apps/blazor-app/Components/SolarScore/Results.razor +++ b/src/apps/blazor-app/Components/SolarScore/Results.razor @@ -306,12 +306,12 @@ protected override void OnInitialized() { - panelTimer = new Timer(100); + panelTimer = new Timer(200); panelTimer.Elapsed += SetChargingLimit; panelTimer.AutoReset = false; panelTimer.Enabled = true; - batteryTimer = new Timer(100); + batteryTimer = new Timer(200); batteryTimer.Elapsed += SetRunningHours; batteryTimer.AutoReset = false; batteryTimer.Enabled = true; diff --git a/src/apps/blazor-app/Pages/Dashboard.razor b/src/apps/blazor-app/Pages/Dashboard.razor index ead6915a..999304bd 100644 --- a/src/apps/blazor-app/Pages/Dashboard.razor +++ b/src/apps/blazor-app/Pages/Dashboard.razor @@ -309,13 +309,10 @@ } } } - } - @if (appliancesLoaded) - { - - - - } + } + + + }
} @@ -373,7 +370,6 @@ private List reportAllAppliance = new List(); private List systems = new List(); private List allSystems = new List(); - private bool isLoaded = false; private bool logIn = false; private bool isAd = false; private int userId = -1; @@ -473,7 +469,6 @@ } reportManager.EditReportRequested += Edit; reportManager.DeleteReportRequested += ShowModal; - isLoaded = true; _ = GetSatteliteImage(); } @@ -490,12 +485,10 @@ if (appliance == selectedAppliance) { selectedAppliance = ""; - StateHasChanged(); } else { selectedAppliance = appliance; - StateHasChanged(); } } diff --git a/src/apps/blazor-app/Section/LoadingScreen.razor b/src/apps/blazor-app/Section/LoadingScreen.razor index 8808d82f..d28f2859 100644 --- a/src/apps/blazor-app/Section/LoadingScreen.razor +++ b/src/apps/blazor-app/Section/LoadingScreen.razor @@ -3,4 +3,4 @@
-
\ No newline at end of file +
a \ No newline at end of file diff --git a/src/apps/blazor-app/wwwroot/css/app.css b/src/apps/blazor-app/wwwroot/css/app.css index d5e75caf..3f2bb4e3 100644 --- a/src/apps/blazor-app/wwwroot/css/app.css +++ b/src/apps/blazor-app/wwwroot/css/app.css @@ -1024,6 +1024,11 @@ video { margin-bottom: auto; } +.mx-2 { + margin-left: 0.5rem; + margin-right: 0.5rem; +} + .-mb-2 { margin-bottom: -0.5rem; } @@ -1304,6 +1309,10 @@ video { display: none; } +.aspect-square { + aspect-ratio: 1 / 1; +} + .h-0 { height: 0px; } @@ -1743,6 +1752,14 @@ video { width: 100vw; } +.w-11\/12 { + width: 91.666667%; +} + +.w-2\/5 { + width: 40%; +} + .min-w-fit { min-width: -moz-fit-content; min-width: fit-content; diff --git a/src/k6-script.js b/src/k6-script.js new file mode 100644 index 00000000..fddd9c3d --- /dev/null +++ b/src/k6-script.js @@ -0,0 +1,177 @@ +// Auto-generated by the postman-to-k6 converter + +import './libs/shim/core.js'; +import './libs/shim/urijs.js'; +import { group } from 'k6'; + +export const options = { + vus: 10, + duration: '30s', + ext: { + loadimpact: { + // Project: blueskies + projectID: 3663177, + // Test runs with the same name groups test runs together. + name: 'All endpoints', + }, + }, +}; + +const Request = Symbol.for('request'); +postman[Symbol.for('initial')]({ + options, + collection: { + express: 'https://express-microservice.azurewebsites.net', + net: 'https://dot-net-api.azurewebsites.net', + }, +}); + +export default function () { + group('.NET API', function () { + group('Systems', function () { + postman[Request]({ + name: 'Get All Systems', + id: '60e52fb6-a0c0-4b46-87f1-f76541de35d0', + method: 'GET', + address: '{{net}}/System/all', + }); + + postman[Request]({ + name: 'Get system by Id', + id: '423ad1a5-53ee-412e-abac-ff20b3685a3f', + method: 'GET', + address: '{{net}}/System/get/2', + }); + }); + + group('Appliances', function () { + postman[Request]({ + name: 'Get All Appliances', + id: '8bbdd23b-6c07-4d30-9020-5f21505b97cb', + method: 'GET', + address: '{{net}}/Appliance/all', + }); + + postman[Request]({ + name: 'Get Appliance', + id: '82f805ae-7e65-4ac3-902b-9c67a2fc70de', + method: 'GET', + address: '{{net}}/Appliance/get/10', + }); + }); + + group('Keys', function () { + postman[Request]({ + name: 'Get All Keys', + id: 'e308c52e-da58-40e7-9e5a-c7a816d1ffe1', + method: 'GET', + address: '{{net}}/Key/all', + }); + + postman[Request]({ + name: 'Get All Business Keys', + id: 'd8929dd2-4dbc-4dc2-9b24-0b67cb89c979', + method: 'GET', + address: '{{net}}/Key/allBusiness', + }); + }); + + group('Location Data', function () { + postman[Request]({ + name: 'Get map box api key', + id: '4c25a9af-d00a-4908-807f-51095b473ebb', + method: 'GET', + address: '{{net}}/locationData/mapboxkey', + }); + + postman[Request]({ + name: 'Get Location Data', + id: 'a6698a9c-a87f-491f-99b0-31ce2f243f2d', + method: 'GET', + address: '{{net}}/locationData/getLocationData/-25.78097/28.267354', + }); + }); + + group('Admin Stats', function () { + group('System Usage', function () { + postman[Request]({ + name: 'Get System Usage', + id: '2364d545-3274-47db-805e-bdc68c2bbf73', + method: 'GET', + address: '{{net}}/adminstats/all', + }); + }); + }); + + group('Reports', function () { + postman[Request]({ + name: 'Get All Reports', + id: '7eda0df0-a689-40bd-b81d-4eca6ae6030a', + method: 'GET', + address: '{{net}}/Report/all', + }); + + postman[Request]({ + name: 'Get User Reports', + id: 'e4399509-9714-4ca3-922b-76d137bb5d44', + method: 'GET', + address: '{{net}}/Report/getUserReports/69', + }); + + postman[Request]({ + name: 'Get Report', + id: 'e46ccdc5-b53d-4c82-b7a4-ed1c06e9cc8d', + method: 'GET', + address: '{{net}}/Report/get/122', + }); + }); + + group('Report All Appliances', function () { + postman[Request]({ + name: 'Get All Appliance Report', + id: '866d0c10-ec19-4c7e-8121-9319ce2fa949', + method: 'GET', + address: '{{net}}/ReportAllAppliance/all', + }); + + postman[Request]({ + name: 'Get Report By Report Id', + id: '4bbae466-4326-458c-be23-8d5d32465723', + method: 'GET', + address: '{{net}}/ReportAllAppliance/getByReportId/91', + }); + }); + + group('Report Appliance', function () { + postman[Request]({ + name: 'Get All Report Appliances', + id: 'b8bc112a-1945-4b65-977e-46fd4e419d7c', + method: 'GET', + address: '{{net}}/ReportAppliance/all', + }); + + postman[Request]({ + name: 'Get Appliances in Report', + id: '0e53f84d-497d-4c65-b67b-462a16cdc1d2', + method: 'GET', + address: '{{net}}/ReportAppliance/getAppliancesInReport/91', + }); + + postman[Request]({ + name: 'Get Reports With Appliance', + id: 'ca1c958d-3a3d-4ea9-a59d-bd46d63d745e', + method: 'GET', + address: '{{net}}/ReportAppliance/getReportsWithAppliance/11', + }); + }); + + group('customAppliance', function () { + postman[Request]({ + name: 'Get all custom appliances', + id: 'f8635cf0-eaea-49c5-8d8b-16df60a9b445', + method: 'GET', + address: '{{net}}/customAppliance/all', + }); + }); + }); +}