fix: added agw_url env into crud

pull/1/head
Artem-Darius Weber 1 year ago
parent 3d98cfa7df
commit 6977c802c1

@ -3,7 +3,7 @@
<component name="CsvFileAttributes"> <component name="CsvFileAttributes">
<option name="attributeMap"> <option name="attributeMap">
<map> <map>
<entry key="/weather_platform/apps/py-multy-agent-interpreter/examples/files/extracted_data.csv"> <entry key="/weather_platform/apps/py-tg-bot-weather-agent/examples/files/extracted_data.csv">
<value> <value>
<Attribute> <Attribute>
<option name="separator" value="," /> <option name="separator" value="," />

@ -5,9 +5,18 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="6cb4dca5-d93c-4b61-8425-4ba8b7c9b2ff" name="Changes" comment=""> <list default="true" id="6cb4dca5-d93c-4b61-8425-4ba8b7c9b2ff" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/csv-editor.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/weather_platform/.env" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/.env" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/apps/py-tg-bot-weather-agent/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/apps/py-tg-bot-weather-agent/main.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/weather_platform/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/pages/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/pages/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/pages/src/lib/dashboard/dashboard.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/pages/src/lib/dashboard/dashboard.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/agregator-create-form/agregator-create-form.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/agregator-table/agregator-table.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensor-create-form/sensor-create-form.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensors-table-item/sensors-table-item.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/sensors-table/sensors-table.tsx" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -32,27 +41,28 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"last_opened_file_path": "/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/apps", &quot;last_opened_file_path&quot;: &quot;/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/apps&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"ts.external.directory.path": "/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/node_modules/typescript/lib", &quot;ts.external.directory.path&quot;: &quot;/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/node_modules/typescript/lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/weather_platform/apps" /> <recent name="$PROJECT_DIR$/weather_platform/apps" />
<recent name="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/navbar" /> <recent name="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/navbar" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/weather_platform" />
<recent name="$PROJECT_DIR$/assets" /> <recent name="$PROJECT_DIR$/assets" />
</key> </key>
</component> </component>
@ -65,7 +75,8 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1696663237589</updated> <updated>1696663237589</updated>
<workItem from="1696663238626" duration="5030000" /> <workItem from="1696663238626" duration="5030000" />
<workItem from="1696670312018" duration="26053000" /> <workItem from="1696670312018" duration="30267000" />
<workItem from="1696714581513" duration="187000" />
</task> </task>
<servers /> <servers />
</component> </component>

@ -1,4 +1,6 @@
AGW_PORT=8045 AGW_PORT=8045
AGW_HOST_DEV=http://localhost:8045
AGW_HOST=https://gw.cg.k-lab.su
SENSORS_SERVICE_PORT=8046 SENSORS_SERVICE_PORT=8046
AGREGATORS_SERVICE_PORT=8047 AGREGATORS_SERVICE_PORT=8047
MEASURES_SERVICE_PORT=8048 MEASURES_SERVICE_PORT=8048

@ -0,0 +1,3 @@
export const AGW_URL = "https://gw.cg.k-lab.su"

@ -76,6 +76,7 @@
"nx-cloud": "latest", "nx-cloud": "latest",
"postcss": "8.4.21", "postcss": "8.4.21",
"prettier": "^2.6.2", "prettier": "^2.6.2",
"react-error-overlay": "^6.0.9",
"sass": "^1.55.0", "sass": "^1.55.0",
"tailwindcss": "3.2.7", "tailwindcss": "3.2.7",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
@ -16608,6 +16609,12 @@
"react": "^18.2.0" "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": { "node_modules/react-is": {
"version": "18.2.0", "version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",

@ -72,6 +72,7 @@
"nx-cloud": "latest", "nx-cloud": "latest",
"postcss": "8.4.21", "postcss": "8.4.21",
"prettier": "^2.6.2", "prettier": "^2.6.2",
"react-error-overlay": "^6.0.9",
"sass": "^1.55.0", "sass": "^1.55.0",
"tailwindcss": "3.2.7", "tailwindcss": "3.2.7",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",

@ -8,5 +8,5 @@
"import": "./index.mjs", "import": "./index.mjs",
"require": "./index.js" "require": "./index.js"
} }
} },
} }

@ -9,6 +9,7 @@ import {BaseLayout} from "@weather-platform/layout";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import {Prisma, Measures} from "@weather-platform/prisma-clients/Measures"; import {Prisma, Measures} from "@weather-platform/prisma-clients/Measures";
import axios from "axios"; import axios from "axios";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface DashboardProps {} export interface DashboardProps {}
@ -17,7 +18,7 @@ export function Dashboard(props: DashboardProps) {
const fetchGetMeasuresList = async (params: Prisma.MeasuresFindManyArgs = {}) => { const fetchGetMeasuresList = async (params: Prisma.MeasuresFindManyArgs = {}) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

@ -4,6 +4,7 @@ import axios from "axios";
import {useState} from "react"; import {useState} from "react";
// eslint-disable-next-line @nx/enforce-module-boundaries // eslint-disable-next-line @nx/enforce-module-boundaries
import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto"; import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface AgregatorCreateFormProps {} export interface AgregatorCreateFormProps {}
@ -17,7 +18,7 @@ export function AgregatorCreateForm(props: AgregatorCreateFormProps) {
const fetchCreateAgregator = async (params: AgregatorCreateDTOClass) => { const fetchCreateAgregator = async (params: AgregatorCreateDTOClass) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

@ -3,6 +3,7 @@ import AgregatorTableItem from "../agregator-table-item/agregator-table-item";
import { Agregator, Prisma } from "@weather-platform/prisma-clients/Agregators"; import { Agregator, Prisma } from "@weather-platform/prisma-clients/Agregators";
import axios from "axios"; import axios from "axios";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface AgregatorTableProps {} export interface AgregatorTableProps {}
@ -11,7 +12,7 @@ export function AgregatorTable(props: AgregatorTableProps) {
const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => { const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

@ -6,8 +6,10 @@ import axios from "axios";
import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto"; import {AgregatorCreateDTOClass} from "../../../../apps/agregators-service/src/DTO/AgregatorCreateDTOClass.dto";
// eslint-disable-next-line @nx/enforce-module-boundaries // eslint-disable-next-line @nx/enforce-module-boundaries
import {SensorCreateDTOClass} from "../../../../apps/sensors-service/src/DTO/SensorCreateDTOClass.dto"; 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 {MeasuresCreateDTOClass} from "../../../../apps/agw/src/measures/DTO/CreateMeasuresClass.dto";
import {randomStringGenerator} from "@nestjs/common/utils/random-string-generator.util"; import {randomStringGenerator} from "@nestjs/common/utils/random-string-generator.util";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface SensorCreateFormProps {} export interface SensorCreateFormProps {}
@ -26,7 +28,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
// todo: incapsulate this function // todo: incapsulate this function
const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => { const fetchGetAgregatorsList = async (params: Prisma.AgregatorFindManyArgs = {}) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {
@ -55,7 +57,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
const fetchCreateSensor = async (params: SensorCreateDTOClass) => { const fetchCreateSensor = async (params: SensorCreateDTOClass) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {
@ -88,7 +90,7 @@ export function SensorCreateForm(props: SensorCreateFormProps) {
const fetchCreateMeasure = async (params: MeasuresCreateDTOClass) => { const fetchCreateMeasure = async (params: MeasuresCreateDTOClass) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

@ -3,6 +3,7 @@ import {Sensor, Prisma as PrismaSensors} from "@weather-platform/prisma-clients/
import axios from "axios"; import axios from "axios";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import {Measures, Prisma as PrismaMeasures} from "@weather-platform/prisma-clients/Measures"; import {Measures, Prisma as PrismaMeasures} from "@weather-platform/prisma-clients/Measures";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface SensorsTableItemProps { export interface SensorsTableItemProps {
@ -13,7 +14,7 @@ export function SensorsTableItem(props: SensorsTableItemProps) {
const fetchGetMeasuresList = async (params: PrismaMeasures.MeasuresFindManyArgs = {}) => { const fetchGetMeasuresList = async (params: PrismaMeasures.MeasuresFindManyArgs = {}) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

@ -4,6 +4,7 @@ import axios from "axios";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import AgregatorTableItem from "../agregator-table-item/agregator-table-item"; import AgregatorTableItem from "../agregator-table-item/agregator-table-item";
import SensorsTableItem from "../sensors-table-item/sensors-table-item"; import SensorsTableItem from "../sensors-table-item/sensors-table-item";
import {AGW_URL} from "../../../../agw";
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface SensorsTableProps {} export interface SensorsTableProps {}
@ -12,7 +13,7 @@ export function SensorsTable(props: SensorsTableProps) {
const fetchGetSensorsList = async (params: Prisma.SensorFindManyArgs = {}) => { const fetchGetSensorsList = async (params: Prisma.SensorFindManyArgs = {}) => {
try { 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; const data = response.data;
return data; return data;
} catch (error) { } catch (error) {

Loading…
Cancel
Save