Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
DAQEM committed Jan 12, 2024
2 parents de20296 + d58bc80 commit fc9b7aa
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Netmon.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\basvd\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_Netmon.1481318327\Snapshot\snapshot.utdcvr</s:String>



<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=9b8a4c9e_002D5f16_002D474d_002D9068_002D5d039104f6f6/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Get_EndpointsReturnSuccessAndCorrectContentType" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# UI
![Interfaces](https://imgur.com/yuNm6cX.png)
![Devices List](https://imgur.com/jhGXtYa.png)

# C4 Model
![C4 Model: Level 2](https://i.imgur.com/1zFy415.png)

Expand Down
6 changes: 1 addition & 5 deletions Services/AdminWebApp/src/lib/api/url_handler.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
const urlHandler = {
getBaseUrl(url: string) {
if (process.env.NODE_ENV === 'development') {
return 'http://localhost:5000/api' + url;
} else {
return 'http://netmon-api-gateway:80/api' + url;
}
return (process.env.BASE_URL || "http://localhost:5000/api") + url;
},
getDeviceManagerUrl(url: string) {
return this.getBaseUrl('/device' + url);
Expand Down
5 changes: 2 additions & 3 deletions Services/UserWebApp/src/lib/api/device_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Device } from '$lib/types';
import UrlHandler from './url_handler';

export default class DeviceAPI {
fetch: typeof fetch;
Expand All @@ -8,9 +9,7 @@ export default class DeviceAPI {
}

getUrl(url: string): string {
return process.env.NODE_ENV === 'development'
? `http://localhost:5000/api/device/device/${url}`
: `http://netmon-api-gateway:80/api/device/device/${url}`;
return UrlHandler.getUrl(`/device/device/${url}`);
}

async getDevices(): Promise<Device[]> {
Expand Down
5 changes: 2 additions & 3 deletions Services/UserWebApp/src/lib/api/disk_statistics_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DiskStatisticsList } from "$lib/types";
import UrlHandler from "./url_handler";

export default class DiskStatisticsAPI {
fetch: typeof fetch;
Expand All @@ -8,9 +9,7 @@ export default class DiskStatisticsAPI {
}

getUrl(url: string, deviceId: string): string {
return process.env.NODE_ENV === 'development'
? `http://localhost:5000/api/device/device/${deviceId}/statistics/disk${url}`
: `http://netmon-api-gateway:80/api/device/device/${deviceId}/statistics/disk${url}`;
return UrlHandler.getUrl(`/device/device/${deviceId}/statistics/disk${url}`);
}

async getStatistics(deviceId: string, from: Date, to: Date): Promise<DiskStatisticsList> {
Expand Down
5 changes: 2 additions & 3 deletions Services/UserWebApp/src/lib/api/interface_statistics_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { InterfaceStatisticsList } from '$lib/types';
import UrlHandler from './url_handler';

export default class InterfaceStatisticsAPI {
fetch: typeof fetch;
Expand All @@ -8,9 +9,7 @@ export default class InterfaceStatisticsAPI {
}

getUrl(url: string, deviceId: string): string {
return process.env.NODE_ENV === 'development'
? `http://localhost:5000/api/device/device/${deviceId}/statistics/interface${url}`
: `http://netmon-api-gateway:80/api/device/device/${deviceId}/statistics/interface${url}`;
return UrlHandler.getUrl(`/device/device/${deviceId}/statistics/interface${url}`);
}

async getInOut(deviceId: string, from: Date, to: Date): Promise<InterfaceStatisticsList> {
Expand Down
5 changes: 5 additions & 0 deletions Services/UserWebApp/src/lib/api/url_handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default class UrlHandler {
static getUrl(url: string): string {
return (process.env.BASE_URL || "http://localhost:5000/api") + url;
}
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
environment:
- ENV=production
- ORIGIN=http://localhost:80
- BASE_URL=http://netmon-api-gateway:80/api
ports:
- "80:3000"
networks:
Expand All @@ -20,6 +21,7 @@ services:
environment:
- ENV=production
- ORIGIN=http://localhost:81
- BASE_URL=http://netmon-api-gateway:80/api
ports:
- "81:3000"
networks:
Expand Down

0 comments on commit fc9b7aa

Please sign in to comment.