Merge development (#86)

This commit is contained in:
John Wu
2021-09-13 09:15:20 -07:00
committed by GitHub
parent 74eb2707a3
commit 680280dbf2
32 changed files with 465 additions and 466 deletions

View File

@@ -1,6 +1,6 @@
const updatesAPI = {
const manifestsAPI = {
createCarUpdates: async (data, token) => {
if (!data.id) data.id = 0;
data.id++;
@@ -14,21 +14,21 @@ const updatesAPI = {
id: 1,
package_name: "Test",
version: "1.0",
link: "http://cloudfront.com/download",
link: "https://cloudfront.com/download",
ecu_list: "ECU1 1.0.0,ECU2 1.0.2",
},
{
id: 2,
package_name: "Test",
version: "1.1",
link: "http://cloudfront.com/download",
link: "https://cloudfront.com/download",
ecu_list: "ECU1 1.0.1,ECU2 1.0.2",
},
{
id: 3,
package_name: "Test",
version: "1.2",
link: "http://cloudfront.com/download",
link: "https://cloudfront.com/download",
ecu_list: "ECU1 1.1.0,ECU2 1.1.2",
}
]
@@ -56,4 +56,4 @@ const updatesAPI = {
},
};
export default updatesAPI;
export default manifestsAPI;

View File

@@ -1,10 +1,10 @@
import { fetchRespHandler } from "../utils/http"
import { logger } from "../services/monitoring";
import { logger } from "./monitoring";
const API_ENDPOINT = "https://grafana.fiskerdps.com/api/datasources/proxy/2"
const grafanaAPI = {
getCarsCount: async () => fetch(`${API_ENDPOINT}/?query=SELECT%20countDistinct(vin)%20as%20count%0AFROM%20default.vehicle_data%20FORMAT%20JSON`, {
getCarsCount: async () => fetch(`${API_ENDPOINT}/?query=SELECT%20countDistinct(VIN)%20as%20count%0AFROM%20default.vehicle_signal%0AWHERE%20Timestamp%20%3C%3D%20toDateTime64(${Date.now() / Math.pow(10, 3)}%2C%203)%20AND%20Timestamp%20%3E%3D%20toDateTime64(${Date.now() / Math.pow(10, 3) - 60 * 60 * 24}%2C%203)%20FORMAT%20JSON`, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }),
})