diff --git a/.idea/csv-editor.xml b/.idea/csv-editor.xml
index 15988f7..ea54588 100644
--- a/.idea/csv-editor.xml
+++ b/.idea/csv-editor.xml
@@ -3,7 +3,7 @@
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -32,27 +41,28 @@
- {
+ "keyToString": {
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "WebServerToolWindowFactoryState": "false",
+ "last_opened_file_path": "/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/apps",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "ts.external.directory.path": "/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/node_modules/typescript/lib",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
+
@@ -65,7 +75,8 @@
1696663237589
-
+
+
diff --git a/weather_platform/.env b/weather_platform/.env
index 6ea5b18..406dd3f 100644
--- a/weather_platform/.env
+++ b/weather_platform/.env
@@ -1,4 +1,6 @@
AGW_PORT=8045
+AGW_HOST_DEV=http://localhost:8045
+AGW_HOST=https://gw.cg.k-lab.su
SENSORS_SERVICE_PORT=8046
AGREGATORS_SERVICE_PORT=8047
MEASURES_SERVICE_PORT=8048
diff --git a/weather_platform/agw.ts b/weather_platform/agw.ts
new file mode 100644
index 0000000..cf93991
--- /dev/null
+++ b/weather_platform/agw.ts
@@ -0,0 +1,3 @@
+
+
+export const AGW_URL = "https://gw.cg.k-lab.su"
diff --git a/weather_platform/package-lock.json b/weather_platform/package-lock.json
index e92a6c6..ab8f6da 100644
--- a/weather_platform/package-lock.json
+++ b/weather_platform/package-lock.json
@@ -76,6 +76,7 @@
"nx-cloud": "latest",
"postcss": "8.4.21",
"prettier": "^2.6.2",
+ "react-error-overlay": "^6.0.9",
"sass": "^1.55.0",
"tailwindcss": "3.2.7",
"ts-jest": "^29.1.0",
@@ -16608,6 +16609,12 @@
"react": "^18.2.0"
}
},
+ "node_modules/react-error-overlay": {
+ "version": "6.0.9",
+ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz",
+ "integrity": "sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==",
+ "dev": true
+ },
"node_modules/react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
diff --git a/weather_platform/package.json b/weather_platform/package.json
index 4afc39e..28f2e4b 100644
--- a/weather_platform/package.json
+++ b/weather_platform/package.json
@@ -72,6 +72,7 @@
"nx-cloud": "latest",
"postcss": "8.4.21",
"prettier": "^2.6.2",
+ "react-error-overlay": "^6.0.9",
"sass": "^1.55.0",
"tailwindcss": "3.2.7",
"ts-jest": "^29.1.0",
diff --git a/weather_platform/pages/package.json b/weather_platform/pages/package.json
index fe1b0c7..021c4c2 100644
--- a/weather_platform/pages/package.json
+++ b/weather_platform/pages/package.json
@@ -8,5 +8,5 @@
"import": "./index.mjs",
"require": "./index.js"
}
- }
+ },
}
diff --git a/weather_platform/pages/src/lib/dashboard/dashboard.tsx b/weather_platform/pages/src/lib/dashboard/dashboard.tsx
index 4941ac7..2be2e30 100644
--- a/weather_platform/pages/src/lib/dashboard/dashboard.tsx
+++ b/weather_platform/pages/src/lib/dashboard/dashboard.tsx
@@ -9,6 +9,7 @@ import {BaseLayout} from "@weather-platform/layout";
import {useEffect, useState} from "react";
import {Prisma, Measures} from "@weather-platform/prisma-clients/Measures";
import axios from "axios";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface DashboardProps {}
@@ -17,7 +18,7 @@ export function Dashboard(props: DashboardProps) {
const fetchGetMeasuresList = async (params: Prisma.MeasuresFindManyArgs = {}) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/measures/get-with-params', params);
+ const response = await axios.post( AGW_URL + '/api/v1/measures/get-with-params', params);
const data = response.data;
return data;
} catch (error) {
diff --git a/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx b/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx
index e85a26d..7463cb2 100644
--- a/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx
+++ b/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx
@@ -4,6 +4,7 @@ import axios from "axios";
import {useState} from "react";
// eslint-disable-next-line @nx/enforce-module-boundaries
import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface AgregatorCreateFormProps {}
@@ -17,7 +18,7 @@ export function AgregatorCreateForm(props: AgregatorCreateFormProps) {
const fetchCreateAgregator = async (params: AgregatorCreateDTOClass) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/agregator/create', params);
+ const response = await axios.post( AGW_URL + '/api/v1/agregator/create', params);
const data = response.data;
return data;
} catch (error) {
diff --git a/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx b/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx
index 8ab071c..3afac04 100644
--- a/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx
+++ b/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx
@@ -3,6 +3,7 @@ import AgregatorTableItem from "../agregator-table-item/agregator-table-item";
import { Agregator, Prisma } from "@weather-platform/prisma-clients/Agregators";
import axios from "axios";
import {useEffect, useState} from "react";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface AgregatorTableProps {}
@@ -11,7 +12,7 @@ export function AgregatorTable(props: AgregatorTableProps) {
const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/agregator/get-with-params', params);
+ const response = await axios.post( AGW_URL + '/api/v1/agregator/get-with-params', params);
const data = response.data;
return data;
} catch (error) {
diff --git a/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx b/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx
index 3794759..1a2d482 100644
--- a/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx
+++ b/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx
@@ -6,8 +6,10 @@ import axios from "axios";
import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto";
// eslint-disable-next-line @nx/enforce-module-boundaries
import {SensorCreateDTOClass} from "../../../../apps/sensors-service/src/DTO/SensorCreateDTOClass.dto";
+// eslint-disable-next-line @nx/enforce-module-boundaries
import {MeasuresCreateDTOClass} from "../../../../apps/agw/src/measures/DTO/CreateMeasuresClass.dto";
import {randomStringGenerator} from "@nestjs/common/utils/random-string-generator.util";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface SensorCreateFormProps {}
@@ -26,7 +28,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
// todo: incapsulate this function
const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/agregator/get-with-params', params);
+ const response = await axios.post( AGW_URL + '/api/v1/agregator/get-with-params', params);
const data = response.data;
return data;
} catch (error) {
@@ -55,7 +57,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
const fetchCreateSensor = async (params: SensorCreateDTOClass) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/sensors/create', params);
+ const response = await axios.post( AGW_URL + '/api/v1/sensors/create', params);
const data = response.data;
return data;
} catch (error) {
@@ -88,7 +90,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
const fetchCreateMeasure = async (params: MeasuresCreateDTOClass) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/measures/register', params);
+ const response = await axios.post( AGW_URL + '/api/v1/measures/register', params);
const data = response.data;
return data;
} catch (error) {
diff --git a/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx b/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx
index ccbe125..6d8f559 100644
--- a/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx
+++ b/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx
@@ -3,6 +3,7 @@ import {Sensor, Prisma as PrismaSensors} from "@weather-platform/prisma-clients/
import axios from "axios";
import {useEffect, useState} from "react";
import {Measures, Prisma as PrismaMeasures} from "@weather-platform/prisma-clients/Measures";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface SensorsTableItemProps {
@@ -13,7 +14,7 @@ export function SensorsTableItem(props: SensorsTableItemProps) {
const fetchGetMeasuresList = async (params: PrismaMeasures.MeasuresFindManyArgs = {}) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/measures/get-with-params', params);
+ const response = await axios.post( AGW_URL + '/api/v1/measures/get-with-params', params);
const data = response.data;
return data;
} catch (error) {
diff --git a/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx b/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx
index df702bd..6d17726 100644
--- a/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx
+++ b/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx
@@ -4,6 +4,7 @@ import axios from "axios";
import {useEffect, useState} from "react";
import AgregatorTableItem from "../agregator-table-item/agregator-table-item";
import SensorsTableItem from "../sensors-table-item/sensors-table-item";
+import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */
export interface SensorsTableProps {}
@@ -12,7 +13,7 @@ export function SensorsTable(props: SensorsTableProps) {
const fetchGetSensorsList = async (params: Prisma.SensorFindManyArgs = {}) => {
try {
- const response = await axios.post( 'http://localhost:8045/api/v1/sensors/get-with-params', params);
+ const response = await axios.post( AGW_URL + '/api/v1/sensors/get-with-params', params);
const data = response.data;
return data;
} catch (error) {