Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add site version #215

Merged
merged 5 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions mocks/data/ADDRESSES.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,7 @@
"currentFlows": 0
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202292177172,
"timeRangeEnd": 1674203192177172,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203192177175,
"elapsed": 770,
"count": 2,
"timeRangeCount": 2,
"totalCount": 2
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/ADDRESS_FLOW_PAIRS.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,7 @@
"processAggregateId": "process-op-to-process-2-xy"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202689930069,
"timeRangeEnd": 1674203589930069,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203589930073,
"elapsed": 149,
"count": 3,
"timeRangeCount": 3,
"totalCount": 3
Expand Down
17 changes: 3 additions & 14 deletions mocks/data/ADDRESS_PROCESSES.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,8 @@
"processRole": "external"
}
],
"queryParams": {
"offset": 0,
"limit": 10,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202685914945,
"timeRangeEnd": 1674203585914945,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203585914961,
"elapsed": 97,
"count": 1,
"timeRangeCount": 1,
"totalCount": 1
"count": 2,
"timeRangeCount": 2,
"totalCount": 2
}
17 changes: 1 addition & 16 deletions mocks/data/COLLECTORS.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,10 @@
"recType": "COLLECTOR",
"identity": "8fbf901a-28b9-4b9d-a2ba-55affed5ee2c",
"startTime": 1679429189022217,
"endTime": 0,
"PrometheusHost": "",
"PrometheusAuthMethod": "",
"PrometheusUser": "",
"PrometheusPassword": ""
"endTime": 0
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1679519682125413,
"timeRangeEnd": 1679520582125413,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1679520582125418,
"elapsed": 24,
"count": 1,
"timeRangeCount": 1,
"totalCount": 1
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/FLOW_PAIRS.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,7 @@
"processAggregateId": "process-op-to-process-2-xy"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202689930069,
"timeRangeEnd": 1674203589930069,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203589930073,
"elapsed": 149,
"count": 3,
"timeRangeCount": 3,
"totalCount": 3
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/HOSTS.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{
"results": [],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202267815874,
"timeRangeEnd": 1674203167815874,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203167815878,
"elapsed": 19,
"count": 0,
"timeRangeCount": 0,
"totalCount": 0
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/LINKS.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,7 @@
"direction": "outgoing"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202313097192,
"timeRangeEnd": 1674203213097192,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203213097194,
"elapsed": 65,
"count": 6,
"timeRangeCount": 6,
"totalCount": 6
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/PROCESSES.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,7 @@
"processRole": "external"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202236115671,
"timeRangeEnd": 1674203136115671,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203136115674,
"elapsed": 1347,
"count": 6,
"timeRangeCount": 6,
"totalCount": 6
Expand Down
11 changes: 0 additions & 11 deletions mocks/data/PROCESS_GROUPS.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@
"processGroupRole": "external"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202366943924,
"timeRangeEnd": 1674203266943924,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203266943928,
"elapsed": 511,
"count": 3,
"timeRangeCount": 3,
"totalCount": 3
Expand Down
17 changes: 3 additions & 14 deletions mocks/data/PROCESS_GROUP_PAIRS.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,8 @@
"destinationName": "component 1"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202522056487,
"timeRangeEnd": 1674203422056487,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203422056491,
"elapsed": 421,
"count": 1,
"timeRangeCount": 1,
"totalCount": 1
"count": 2,
"timeRangeCount": 2,
"totalCount": 2
}
17 changes: 3 additions & 14 deletions mocks/data/PROCESS_PAIRS.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,8 @@
"protocol": "http1"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202548995043,
"timeRangeEnd": 1674203448995043,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203448995047,
"elapsed": 412,
"count": 3,
"timeRangeCount": 3,
"totalCount": 3
"count": 6,
"timeRangeCount": 6,
"totalCount": 6
}
11 changes: 0 additions & 11 deletions mocks/data/ROUTERS.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,7 @@
"buildVersion": "UNKNOWN"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202218894130,
"timeRangeEnd": 1674203118894130,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203118894133,
"elapsed": 64,
"count": 3,
"timeRangeCount": 3,
"totalCount": 3
Expand Down
26 changes: 10 additions & 16 deletions mocks/data/SITES.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,47 @@
"startTime": 1674048683000000,
"endTime": 0,
"name": "site 1",
"nameSpace": "config-grpc-site-1-test"
"nameSpace": "config-grpc-site-1-test",
"siteVersion": "1.5.0"
},
{
"recType": "SITE",
"identity": "site-2",
"startTime": 1674048662000000,
"endTime": 0,
"name": "site 2",
"nameSpace": "config-grpc-site-2-test"
"nameSpace": "config-grpc-site-2-test",
"siteVersion": "1.5.0"
},
{
"recType": "SITE",
"identity": "site-3",
"startTime": 1674048705000000,
"endTime": 0,
"name": "site 3",
"nameSpace": "config-grpc-site-3-test"
"nameSpace": "config-grpc-site-3-test",
"siteVersion": "1.5.0"
},
{
"recType": "SITE",
"identity": "site-4",
"startTime": 1674048705000000,
"endTime": 0,
"name": "site 4",
"nameSpace": "config-grpc-site-4-test"
"nameSpace": "config-grpc-site-4-test",
"siteVersion": "1.5.0"
},
{
"recType": "SITE",
"identity": "site-5",
"startTime": 1674048705000000,
"endTime": 0,
"name": "site 5",
"nameSpace": "config-grpc-site-5-test"
"nameSpace": "config-grpc-site-5-test",
"siteVersion": "1.5.0"
}
],
"queryParams": {
"offset": -1,
"limit": -1,
"sortBy": "identity.asc",
"filter": "",
"timeRangeStart": 1674202183865932,
"timeRangeEnd": 1674203083865932,
"timeRangeOperation": 0
},
"status": "",
"timestamp": 1674203083865935,
"elapsed": 105,
"count": 5,
"timeRangeCount": 5,
"totalCount": 5
Expand Down
3 changes: 2 additions & 1 deletion mocks/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ for (let i = 0; i < ITEMS_TEST; i++) {
startTime: 1674048705000000,
endTime: 0,
name: `site ${i}`,
nameSpace: `config-grpc-site-${i}-test`
nameSpace: `config-grpc-site-${i}-test`,
siteVersion: 'x.x.x'
});
}

Expand Down
12 changes: 3 additions & 9 deletions src/API/REST.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ export interface HTTPError extends AxiosError {

export type ResponseWrapper<T> = {
results: T; // Type based on the Response interface
totalCount: number;
status: string; // this field is for debug scope. Empty value => OK. In case we have some internal BE error that is not a http status this field is not empty. For example a value can be `Malformed sortBy query`
count: number;
timeRangeCount: number;
status: string;
timestamp: number;
elapsed: number;
queryParams: RequestOptions;
totalCount: number;
};

/* Response Interfaces */
Expand All @@ -52,6 +49,7 @@ interface BaseResponse {
export interface SiteResponse extends BaseResponse {
name: string;
nameSpace: string;
siteVersion: string;
}

export interface ProcessGroupResponse extends BaseResponse {
Expand Down Expand Up @@ -166,8 +164,4 @@ export interface CollectorsResponse {
identity: string;
startTime: number;
endTime: number;
PrometheusHost: string;
PrometheusAuthMethod: string;
PrometheusUser: string;
PrometheusPassword: string;
}
6 changes: 1 addition & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Suspense } from 'react';
import { Page } from '@patternfly/react-core';
import { useQuery } from '@tanstack/react-query';
import { ErrorBoundary } from 'react-error-boundary';
import { useLocation } from 'react-router-dom';

import { RESTApi } from '@API/REST.api';
import { setCollectorStartTime } from '@config/config';
Expand All @@ -12,12 +11,9 @@ import AppContent from '@layout/AppContent';
import Header from '@layout/Header';
import SideBar from '@layout/SideBar';
import Console from '@pages/shared/Errors/Console';
import { TopologyRoutesPaths } from '@pages/Topology/Topology.enum';
import { routes } from 'routes';

const App = function () {
const { pathname } = useLocation();

const { data: collector } = useQuery(['app-getPrometheusURL'], () => RESTApi.fetchCollectors());

if (collector) {
Expand All @@ -28,7 +24,7 @@ const App = function () {
<Page
header={<Header />}
sidebar={<SideBar />}
breadcrumb={pathname !== TopologyRoutesPaths.Topology && <AppMenu />}
breadcrumb={<AppMenu />}
isManagedSidebar
className="app-main-container"
>
Expand Down
Loading