diff --git a/csharp/App/Backend/Controller.cs b/csharp/App/Backend/Controller.cs index 6adc74a2f..b03dde8e6 100644 --- a/csharp/App/Backend/Controller.cs +++ b/csharp/App/Backend/Controller.cs @@ -267,7 +267,7 @@ public class Controller : ControllerBase if (! await session.Create(installation)) return Unauthorized(); - return installation.FillOrderNumbers().HideParentIfUserHasNoAccessToParent(session!.User); + return installation; } [HttpPost(nameof(CreateFolder))] diff --git a/csharp/App/Backend/Properties/launchSettings.json b/csharp/App/Backend/Properties/launchSettings.json index dc2ac027a..d04542990 100644 --- a/csharp/App/Backend/Properties/launchSettings.json +++ b/csharp/App/Backend/Properties/launchSettings.json @@ -7,7 +7,7 @@ "dotnetRunMessages": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7087;http://localhost:5031", + "applicationUrl": "https://localhost:8000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/csharp/App/BmsTunnel/Program.cs b/csharp/App/BmsTunnel/Program.cs index eb23e57d8..8202ccb0f 100644 --- a/csharp/App/BmsTunnel/Program.cs +++ b/csharp/App/BmsTunnel/Program.cs @@ -1,4 +1,4 @@ -// dotnet publish BmsTunnel.csproj -c Release -r linux-arm -p:PublishSingleFile=true --self-contained true && \ +// && \ // rsync -av bin/Release/net6.0/linux-arm/publish/ root@10.2.1.6:/home/root/tunnel && clear && \ // ssh root@10.2.1.6 /home/root/tunnel/BmsTunnel diff --git a/csharp/App/VrmGrabber/Program.cs b/csharp/App/VrmGrabber/Program.cs index 772951f5f..693f847cc 100644 --- a/csharp/App/VrmGrabber/Program.cs +++ b/csharp/App/VrmGrabber/Program.cs @@ -24,7 +24,7 @@ public static class Program app.MapControllers(); // app.MapGet("/", () => Controller.Index()); var webTask = app.RunAsync(); - await Task.WhenAll(webTask); + await Task.WhenAll(webTask, updateTask); } private static OpenApiInfo OpenApiInfo { get; } = new OpenApiInfo diff --git a/rust/VrmGrabberOxidised/src/installation.rs b/rust/VrmGrabberOxidised/src/installation.rs new file mode 100644 index 000000000..97f1afd2b --- /dev/null +++ b/rust/VrmGrabberOxidised/src/installation.rs @@ -0,0 +1,11 @@ +pub struct Installation { + name: String, + vrm: i64, + ip: String, + identifier: String, + serial: String, + online: String, + last_seen: String, + number_of_batteries: String, + batter_firmware_version: String +} \ No newline at end of file diff --git a/rust/VrmGrabberOxidised/src/vrm_account.rs b/rust/VrmGrabberOxidised/src/vrm_account.rs new file mode 100644 index 000000000..eb1c6d854 --- /dev/null +++ b/rust/VrmGrabberOxidised/src/vrm_account.rs @@ -0,0 +1,21 @@ +use std::ops::Add; +use reqwest::{Error, Response}; +// use serde::{Deserialize, Serialize}; + + +const API_ROOT:&str ="https://vrmapi.victronenergy.com/v2"; +const USER_ID:&str = "55450"; +const TOKEN:&str = "88b36e7226ff7fa7bf231d0f9f98e916f661923c84e494cd27b6bc795ec0074b"; + +pub async fn all_installations_request() -> Result { + // use reqwest::header::AUTHORIZATION; + let client = reqwest::Client::new(); + let res = client + .get(API_ROOT.to_owned().add("/users/").add(USER_ID).add("/installations")) + .header("Content-Type", "application/json") + .header("x-authorization","Token ".to_owned()+TOKEN) + .send() + .await; + return res; +} + diff --git a/typescript/Frontend/src/config/axiosConfig.tsx b/typescript/Frontend/src/config/axiosConfig.tsx index 95616e2e0..9b47c3c8a 100644 --- a/typescript/Frontend/src/config/axiosConfig.tsx +++ b/typescript/Frontend/src/config/axiosConfig.tsx @@ -1,11 +1,11 @@ import axios from "axios"; export const axiosConfigWithoutToken = axios.create({ - baseURL: "https://monitor.innov.energy/api", + baseURL: "https://localhost:7087", }); const axiosConfig = axios.create({ - baseURL: "https://monitor.innov.energy/api", + baseURL: "https://localhost:7087", }); axiosConfig.defaults.params = {};