How to cancel the sorting of requests (APIs) in web UI? #3337
-
|
I encountered a scenario where all requests have their own order, and I need them to be displayed on the web page in the order of the requests. However, in the web UI, they are sorted alphabetically by default. I tried to modify the sort_stats function in the source code to cancel the sorting, but the sorting was still done in the web UI. Is there any way to achieve it? What should I do? Alternatively, in the future, a configuration or simple method can be added that allows everyone to make adjustments as they please. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
WEb UI not only refers to the display order in web pages, but also in statistical results(reports). |
Beta Was this translation helpful? Give feedback.
-
|
Not sure there is a way, as it is designed with beingng deterministic as a priority. A workaround would be to name your requests explicitly with a prefix (1, 2, 3…) so they end up the way you want them to. |
Beta Was this translation helpful? Give feedback.
This is a method, but I don't want to change the original requests name because other personnel sometimes don't know the specific requests name.
Today I looked at the source code on GitHub and found that the "webui/src/books/useSortByField.ts" file is sorted by name as the keyword.
export default function useSortByField<Row>( rows: Row[], { hasTotalRow = false, defaultSortKey = 'name' as keyof Row }: ISortByFieldOptions<Row> = { hasTotalRow: false, defaultSortKey: 'name' as keyof Row, }, ) ......So only need to modify here, there are two methods:
one is to modify the source code and recompile "locust", but this requires consideration of dependencies in Windows or LINUX environments, whic…