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">
<option name="attributeMap">
<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>
<Attribute>
<option name="separator" value="," />

@ -5,9 +5,18 @@
</component>
<component name="ChangeListManager">
<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$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" 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/.env" beforeDir="false" afterPath="$PROJECT_DIR$/weather_platform/.env" 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>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -32,27 +41,28 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"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"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;last_opened_file_path&quot;: &quot;/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/apps&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;ts.external.directory.path&quot;: &quot;/Users/darius/Desktop/ASC/CyberGarden/kempt-kinkajou/weather_platform/node_modules/typescript/lib&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/weather_platform/apps" />
<recent name="$PROJECT_DIR$/weather_platform/ui-modules/src/lib/navbar" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/weather_platform" />
<recent name="$PROJECT_DIR$/assets" />
</key>
</component>
@ -65,7 +75,8 @@
<option name="presentableId" value="Default" />
<updated>1696663237589</updated>
<workItem from="1696663238626" duration="5030000" />
<workItem from="1696670312018" duration="26053000" />
<workItem from="1696670312018" duration="30267000" />
<workItem from="1696714581513" duration="187000" />
</task>
<servers />
</component>

@ -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

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

@ -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",

@ -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",

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

@ -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) {

@ -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) {

@ -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) {

@ -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) {

@ -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) {

@ -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) {

Loading…
Cancel
Save