";
+
+ let partialSource= "
{{Name}} |
+ {{online}} {{Ip}} |
+ VRM |
+ Grafana |
+ {{Identifier}} |
+ {{LastSeen}} |
+ {{Serial}} |
+ {{NumBatteries}} |
+ {{BatteryVersion}} |
+ ⬆️{{FirmwareVersion}} |
+
";
+
+ let mut handlebars = Handlebars::new();
+ handlebars.register_template_string("installations", partialSource);
+
+ let mut installsForHtml = Vec::
::new();
+ for inst in json["records"] {
+ let mut installation = InstallationToHtmlInterface {
+ Name: inst["name"],
+ Ip: 0, // TODO
+ Vrm: inst["idSite"].parse::(),
+ Identifier: inst["identifier"],
+ Serial: "", //Todo Grab and parse Details
+ EscapedName: &encode(inst["name"]).to_string(),
+ Online: "",
+ LastSeen: "",
+ NumBatteries: "",
+ BatteryVersion: "",
+ ServerIp : "10.2.0.1",
+ FirmwareVersion: "AF09",
+ };
+ installsForHtml.push(installation)
+ }
+ let mut data = installsForHtml;
+
+ let result = handlebars.render(source, &data);
+ return result.unwrap();
+}
+
+#[launch]
+fn rocket() -> _ {
+ rocket::build().mount("/", routes![index])
+}
\ 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 8d9277190..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: "http://localhost:5000/api",
+ baseURL: "https://localhost:7087",
});
const axiosConfig = axios.create({
- baseURL: "http://localhost:5000/api",
+ baseURL: "https://localhost:7087",
});
axiosConfig.defaults.params = {};