-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added overview and details table for scenario-3
- Loading branch information
1 parent
8913ef9
commit e775ef6
Showing
11 changed files
with
279 additions
and
31 deletions.
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
3 changes: 3 additions & 0 deletions
3
frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
.mq-tables-container { | ||
width: 100%; | ||
height: 100%; | ||
|
||
.mq-table-title { | ||
display: flex; | ||
align-items: center; | ||
|
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
33 changes: 33 additions & 0 deletions
33
frontend/src/pages/MessagingQueues/MQDetails/MQTables/getTopicThroughputDetails.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,33 @@ | ||
import axios from 'api'; | ||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler'; | ||
import { AxiosError } from 'axios'; | ||
import { SOMETHING_WENT_WRONG } from 'constants/api'; | ||
import { ErrorResponse, SuccessResponse } from 'types/api'; | ||
|
||
import { | ||
MessagingQueueServicePayload, | ||
MessagingQueuesPayloadProps, | ||
} from './getConsumerLagDetails'; | ||
|
||
export const getTopicThroughputDetails = async ( | ||
props: MessagingQueueServicePayload, | ||
): Promise< | ||
SuccessResponse<MessagingQueuesPayloadProps['payload']> | ErrorResponse | ||
> => { | ||
const { detailType, ...rest } = props; | ||
const endpoint = `/messaging-queues/kafka/topic-throughput/${detailType}`; | ||
try { | ||
const response = await axios.post(endpoint, { | ||
...rest, | ||
}); | ||
|
||
return { | ||
statusCode: 200, | ||
error: null, | ||
message: response.data.status, | ||
payload: response.data.data, | ||
}; | ||
} catch (error) { | ||
return ErrorResponseHandler((error as AxiosError) || SOMETHING_WENT_WRONG); | ||
} | ||
}; |
37 changes: 37 additions & 0 deletions
37
frontend/src/pages/MessagingQueues/MQDetails/MQTables/getTopicThroughputOverview.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,37 @@ | ||
import axios from 'api'; | ||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler'; | ||
import { AxiosError } from 'axios'; | ||
import { SOMETHING_WENT_WRONG } from 'constants/api'; | ||
import { ErrorResponse, SuccessResponse } from 'types/api'; | ||
|
||
import { | ||
MessagingQueueServicePayload, | ||
MessagingQueuesPayloadProps, | ||
} from './getConsumerLagDetails'; | ||
|
||
export const getTopicThroughputOverview = async ( | ||
props: Omit<MessagingQueueServicePayload, 'variables'>, | ||
): Promise< | ||
SuccessResponse<MessagingQueuesPayloadProps['payload']> | ErrorResponse | ||
> => { | ||
const { detailType, start, end } = props; | ||
console.log(detailType); | ||
try { | ||
const response = await axios.post( | ||
`messaging-queues/kafka/topic-throughput/${detailType}`, | ||
{ | ||
start, | ||
end, | ||
}, | ||
); | ||
|
||
return { | ||
statusCode: 200, | ||
error: null, | ||
message: response.data.status, | ||
payload: response.data.data, | ||
}; | ||
} catch (error) { | ||
return ErrorResponseHandler((error as AxiosError) || SOMETHING_WENT_WRONG); | ||
} | ||
}; |
Oops, something went wrong.