-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: added the host list view and filters #6210
Merged
Merged
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f8eeec6
feat: added the host list view and filters
rahulkeswani101 ae014d1
feat: removed group by filter and added autocomplete for where clause
rahulkeswani101 08512b9
feat: updated the table view and added the pagination
rahulkeswani101 3d57dde
feat: pass updated filters to api to get filtered data in the list
rahulkeswani101 689440b
feat: added global time range and order by for cpu,memory,iowait,load
rahulkeswani101 403fe9d
feat: added order by and color codes for cpu and memory usage progres…
rahulkeswani101 6648e84
refactor: removed inline styles
rahulkeswani101 4581cba
Host lists improvement (#6366)
rahulkeswani101 1af121d
feat: added the host detail view (#6267)
rahulkeswani101 a30bb58
Host containers (#6297)
rahulkeswani101 5aa2f03
Show host metrics panels in metrics tab. (#6306)
rahulkeswani101 fc43930
Metrics time selection (#6360)
rahulkeswani101 8ace84c
feat: added logs and traces tab in host metrics detail view (#6359)
rahulkeswani101 318f0ae
refactor: removed unused code and added comments
rahulkeswani101 e94de69
refactor: added new code for host metric attribute keys
rahulkeswani101 dc3c19a
feat: reset query data once we are on infra monitoring page
rahulkeswani101 1dcb0ad
chore: remove optional parameter from get attributes and groupby inte…
YounixM bdea4d9
feat: update ui as per the designs
YounixM 67e1a2e
fix: logs list, time select and other ui issues
YounixM 480d142
feat: update title for infra monitoring page
YounixM c70d7ba
feat: update copies
YounixM 894e3bc
feat: update styles for light mode
YounixM 58a46c9
fix: reset page size on filter, open explorers in new tab, enable hor…
YounixM fce529c
feat: traces tab updates
YounixM 9ef3d05
feat: move infra monitoring behind ff
YounixM a69f9c9
fix: remove sorting from host listing page
YounixM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { ApiBaseInstance } from 'api'; | ||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler'; | ||
import { AxiosError } from 'axios'; | ||
import { ErrorResponse, SuccessResponse } from 'types/api'; | ||
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse'; | ||
import { TagFilter } from 'types/api/queryBuilder/queryBuilderData'; | ||
|
||
export interface HostListPayload { | ||
filters: TagFilter; | ||
groupBy: BaseAutocompleteData[]; | ||
offset?: number; | ||
limit?: number; | ||
} | ||
|
||
export interface TimeSeriesValue { | ||
timestamp: number; | ||
value: string; | ||
} | ||
|
||
export interface TimeSeries { | ||
labels: Record<string, string>; | ||
labelsArray: Array<Record<string, string>>; | ||
values: TimeSeriesValue[]; | ||
} | ||
|
||
export interface HostData { | ||
hostName: string; | ||
active: boolean; | ||
os: string; | ||
cpu: number; | ||
cpuTimeSeries: TimeSeries; | ||
memory: number; | ||
memoryTimeSeries: TimeSeries; | ||
wait: number; | ||
waitTimeSeries: TimeSeries; | ||
load15: number; | ||
load15TimeSeries: TimeSeries; | ||
} | ||
|
||
export interface HostListResponse { | ||
status: string; | ||
data: { | ||
type: string; | ||
records: HostData[]; | ||
groups: null; | ||
total: number; | ||
}; | ||
} | ||
|
||
export const getHostLists = async ( | ||
props: HostListPayload, | ||
signal?: AbortSignal, | ||
headers?: Record<string, string>, | ||
): Promise<SuccessResponse<HostListResponse> | ErrorResponse> => { | ||
try { | ||
const response = await ApiBaseInstance.post('/hosts/list', props, { | ||
signal, | ||
headers, | ||
}); | ||
|
||
return { | ||
statusCode: 200, | ||
error: null, | ||
message: 'Success', | ||
payload: response.data, | ||
params: props, | ||
}; | ||
} catch (error) { | ||
return ErrorResponseHandler(error as AxiosError); | ||
} | ||
}; |
38 changes: 38 additions & 0 deletions
38
frontend/src/api/infraMonitoring/getInfraAttributeValues.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ApiBaseInstance } from 'api'; | ||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler'; | ||
import { AxiosError } from 'axios'; | ||
import createQueryParams from 'lib/createQueryParams'; | ||
import { ErrorResponse, SuccessResponse } from 'types/api'; | ||
import { | ||
IAttributeValuesResponse, | ||
IGetAttributeValuesPayload, | ||
} from 'types/api/queryBuilder/getAttributesValues'; | ||
|
||
export const getInfraAttributesValues = async ({ | ||
dataSource, | ||
attributeKey, | ||
filterAttributeKeyDataType, | ||
tagType, | ||
searchText, | ||
}: IGetAttributeValuesPayload): Promise< | ||
SuccessResponse<IAttributeValuesResponse> | ErrorResponse | ||
> => { | ||
try { | ||
const response = await ApiBaseInstance.get( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above. |
||
`/hosts/attribute_values?${createQueryParams({ | ||
dataSource, | ||
attributeKey, | ||
searchText, | ||
})}&filterAttributeKeyDataType=${filterAttributeKeyDataType}&tagType=${tagType}`, | ||
); | ||
|
||
return { | ||
statusCode: 200, | ||
error: null, | ||
message: response.data.status, | ||
payload: response.data.data, | ||
}; | ||
} catch (error) { | ||
return ErrorResponseHandler(error as AxiosError); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
frontend/src/container/HostMetricsLoading/HostMetricsLoading.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.loading-host-metrics { | ||
padding: 24px 0; | ||
height: 600px; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
.loading-host-metrics-content { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
|
||
.loading-gif { | ||
height: 72px; | ||
margin-left: -24px; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
frontend/src/container/HostMetricsLoading/HostMetricsLoading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import './HostMetricsLoading.styles.scss'; | ||
|
||
import { Typography } from 'antd'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { DataSource } from 'types/common/queryBuilder'; | ||
|
||
export function HostMetricsLoading(): JSX.Element { | ||
const { t } = useTranslation('common'); | ||
return ( | ||
<div className="loading-host-metrics"> | ||
<div className="loading-host-metrics-content"> | ||
<img | ||
className="loading-gif" | ||
src="/Icons/loading-plane.gif" | ||
alt="wait-icon" | ||
/> | ||
|
||
<Typography> | ||
{t('pending_data_placeholder', { | ||
dataSource: `host ${DataSource.METRICS}`, | ||
})} | ||
</Typography> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try catch block doesn't propagate the errors to the consuming component and we have to extract the success / error data from the successResponse.