Skip to content

Commit

Permalink
Merge pull request #26 from jaroslavhuss/core-architecture
Browse files Browse the repository at this point in the history
localhost precommit
  • Loading branch information
jaroslavhuss authored Apr 7, 2022
2 parents a964b53 + cc6bbd2 commit d45e758
Show file tree
Hide file tree
Showing 11 changed files with 557 additions and 70 deletions.
4 changes: 2 additions & 2 deletions client/src/GLOBAL_URL.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const GLOBAL_URL: string = "https://vpsli4228.a24vps.com/uuiot";
//
export const GLOBAL_URL: string = "http://localhost:5001";
//https://vpsli4228.a24vps.com/uuiot
//http://localhost:5001
17 changes: 13 additions & 4 deletions client/src/routes/iotDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface IHumidity {
interface ITemperature {
date: string
gw: string
humidity: number
temperature: number
__v: number
_id: number
}
Expand Down Expand Up @@ -107,8 +107,17 @@ const StudentsDashboard = () => {

const humidityData: IHumidity[] = await responseHumidity.json();
const temperatureData: ITemperature[] = await responseTemperature.json();

humidityData.forEach((h) => {
const niceDate = new Date(h.date).toLocaleDateString() + " " + new Date(h.date).toLocaleTimeString();
h.date = niceDate;
h.humidity = parseFloat(h.humidity.toFixed(1));
})
setHumidity(humidityData)
temperatureData.forEach((h: ITemperature) => {
const niceDate = new Date(h.date).toLocaleDateString() + " " + new Date(h.date).toLocaleTimeString();
h.date = niceDate;
h.temperature = parseFloat(h.temperature.toFixed(1));
})
setTemperature(temperatureData);
setIsLoading(false);
} catch (error) {
Expand Down Expand Up @@ -144,11 +153,11 @@ const StudentsDashboard = () => {
From:{" "}
<input value={startDate.toISOString().substring(0, 10)} type="date" onChange={(e: any) => {
setStartDate(new Date(e.target.value))
}} max={todayFunciton().toISOString().substring(0, 10)} />{" "}
}} max={endDate.toISOString().substring(0, 10)} />{" "}
To:{" "}
<input value={endDate.toISOString().substring(0, 10)} type="date" onChange={(e: any) => {
setEndDate(new Date(e.target.value))
}} max={todayFunciton().toISOString().substring(0, 10)} />
}} max={todayFunciton().toISOString().substring(0, 10)} min={startDate.toISOString().substring(0, 10)} />
{" "}
<span onClick={() => {
getDataFromGW(gwID, startDate, endDate);
Expand Down
15 changes: 4 additions & 11 deletions server/dist/gateway/gateway.controller.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/// <reference types="mongoose/types/pipelinestage" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose" />
import { BadRequestException } from '@nestjs/common';
import { createGateWayDto, GatewaySaveHumidityDto, GatewaySaveTemperatureDto } from './dto';
import { GatewayService } from './gateway.service';
export declare class GatewayController {
Expand All @@ -13,7 +10,7 @@ export declare class GatewayController {
saveTemperature(body: GatewaySaveTemperatureDto[], gateway: any): Promise<import("@nestjs/common").InternalServerErrorException | (import("../schemas").Temperature & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
createGateWay(dto: createGateWayDto, user: any): Promise<import("@nestjs/common").BadRequestException | (import("../schemas").Gateway & import("mongoose").Document<any, any, any> & {
createGateWay(dto: createGateWayDto, user: any): Promise<BadRequestException | (import("../schemas").Gateway & import("mongoose").Document<any, any, any> & {
_id: any;
})>;
getAllGateways(): Promise<(import("../schemas").Gateway & import("mongoose").Document<any, any, any> & {
Expand All @@ -26,14 +23,10 @@ export declare class GatewayController {
id: string;
startDate: string;
endDate: string;
}): Promise<import("@nestjs/common").BadRequestException | (import("../schemas").Humidity & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
}): Promise<any[] | BadRequestException>;
getGateWayTemperatureData(body: {
id: string;
startDate: string;
endDate: string;
}): Promise<import("@nestjs/common").BadRequestException | (import("../schemas").Temperature & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
}): Promise<any[] | BadRequestException>;
}
4 changes: 4 additions & 0 deletions server/dist/gateway/gateway.controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/dist/gateway/gateway.controller.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions server/dist/gateway/gateway.service.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// <reference types="mongoose/types/pipelinestage" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/connection" />
import { BadRequestException, InternalServerErrorException } from '@nestjs/common';
import { Gateway, GatewayDocument, Humidity, HumidityDocument, Temperature, TemperatureDocument } from 'src/schemas';
import { Model } from 'mongoose';
Expand All @@ -10,9 +7,9 @@ export declare class GatewayService {
private humidityModel;
private temperatureModel;
constructor(gatewayModel: Model<GatewayDocument>, humidityModel: Model<HumidityDocument>, temperatureModel: Model<TemperatureDocument>);
createGateway(dto: createGateWayDto): Promise<BadRequestException | (Gateway & import("mongoose").Document<any, any, any> & {
createGateway(dto: createGateWayDto): Promise<(Gateway & import("mongoose").Document<any, any, any> & {
_id: any;
})>;
}) | BadRequestException>;
getAllGateways(): Promise<(Gateway & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
Expand All @@ -25,10 +22,6 @@ export declare class GatewayService {
saveTemperature(data: GatewaySaveTemperatureDto): Promise<InternalServerErrorException | (Temperature & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
getHumidity(id: string, startDate: any, endDate: any): Promise<BadRequestException | (Humidity & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
getTemperature(id: string, startDate: string, endDate: string): Promise<BadRequestException | (Temperature & import("mongoose").Document<any, any, any> & {
_id: any;
})[]>;
getHumidity(id: string, startDate: any, endDate: any): Promise<any[] | BadRequestException>;
getTemperature(id: string, startDate: string, endDate: string): Promise<any[] | BadRequestException>;
}
Loading

0 comments on commit d45e758

Please sign in to comment.