Add busy indicator during export #4231

Closed
opened 2025-12-29 18:34:03 +01:00 by adam · 5 comments
Owner

Originally created by @nniehoff on GitHub (Oct 30, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.9.7

Proposed Functionality

Display a busy indicator, an hourglass or a spinning wheel of some sort while NetBox is processing a large export.

Use Case

When exporting a large number (~30k) of devices (I assume this is also true for any object really) the export takes time, in this case, several minutes. During that time the user's browser is busy but NetBox has no indication that it is working. It eventually returns the export but it would be nice to have some indication to the user that work is being done.

Steps to reproduce:

  1. Create several thousand devices in NetBox.
  2. Go to https:///dcim/devices/
  3. Click the Export button

Database Changes

I don't believe there will be any

External Dependencies

None

Originally created by @nniehoff on GitHub (Oct 30, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/g/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.8 * NetBox version: 2.9.7 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Display a busy indicator, an hourglass or a spinning wheel of some sort while NetBox is processing a large export. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case When exporting a large number (~30k) of devices (I assume this is also true for any object really) the export takes time, in this case, several minutes. During that time the user's browser is busy but NetBox has no indication that it is working. It eventually returns the export but it would be nice to have some indication to the user that work is being done. Steps to reproduce: 1. Create several thousand devices in NetBox. 2. Go to https://<netbox>/dcim/devices/ 3. Click the Export button <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes I don't believe there will be any <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam closed this issue 2025-12-29 18:34:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 2, 2020):

During that time the user's browser is busy but NetBox has no indication that it is working.

The browser is responsible for conveying to the user that it is waiting on a response from the server, just as with any other synchronous request. (Note that this is in contrast to asynchronous requests, which do need to be conveyed to the user.) Adding a separate indication within NetBox itself would be redundant and unnecessary.

@jeremystretch commented on GitHub (Nov 2, 2020): > During that time the user's browser is busy but NetBox has no indication that it is working. The browser is responsible for conveying to the user that it is waiting on a response from the server, just as with any other synchronous request. (Note that this is in contrast to _asynchronous_ requests, which do need to be conveyed to the user.) Adding a separate indication within NetBox itself would be redundant and unnecessary.
Author
Owner

@nniehoff commented on GitHub (Nov 3, 2020):

I agree this is purely aesthetics when looking at the UI, however to a novice impatient user who doesn't know that the spinning icon means on their browser tab it appears NetBox is just not doing anything. The user may click export more than once in their impatience waiting for something/anything to happen. Providing them with some sort of indication that something is happening might be helpful here. There are literally thousands of examples of images/icons out there, some more humorous than others, but I was thinking a simple gif with the box from the NetBox icon spinning and simply saying "Loading..." or please wait is enough. I don't think a percentage complete indicator is required, just some indication something is happening.

@nniehoff commented on GitHub (Nov 3, 2020): I agree this is purely aesthetics when looking at the UI, however to a novice impatient user who doesn't know that the spinning icon means on their browser tab it appears NetBox is just not doing anything. The user may click export more than once in their impatience waiting for something/anything to happen. Providing them with some sort of indication that something is happening might be helpful here. There are literally thousands of [examples](https://www.google.com/search?q=loading+image&tbm=isch&source=iu&ictx=1&fir=6ZnUB-og_GUq2M%252CSZvnlFTCA1j4lM%252C_&vet=1&usg=AI4_-kSc7GYZ0wsrzc6iMm0TABZqIRDFwg&sa=X&ved=2ahUKEwiv6o7O1ObsAhWlKH0KHSSaDcwQ9QF6BAgKEFw&biw=1772&bih=1289#imgrc=PSzUce8gx5DA7M) of images/icons out there, some more humorous than others, but I was thinking a simple gif with the box from the NetBox icon spinning and simply saying "Loading..." or please wait is enough. I don't think a percentage complete indicator is required, just some indication something is happening.
Author
Owner

@mtbutler07 commented on GitHub (Nov 3, 2020):

Adding a separate indication within NetBox itself would be redundant and unnecessary.

I agree that this would be an unnecessary feature for exports that contain a small number of objects (<1000) since it only takes a few seconds for a response.

However, in cases of very large environments where there may be tens of thousands of devices and hundreds of thousands of IP addresses, the export time can increase to 5-10 minutes.


After clicking the export button, the only indication in the browser is a very small animation in the corner of the current tab.

loading

For some users, this animation can be very subtle and easy to miss. They might also be tempted to refresh the page in order to retry the export.

Besides that small animation in the browser, there really isn't any indication from NetBox that the request was received successful until a download window pops up 5-10 minutes later.

Additionally, for requests that take over 60 seconds, nginx will just return a 504 Gateway Time-out.

nginx

I found out that this can be adjusted by increasing the timeout as a work around.

server {
    location / {
        proxy_pass              http://127.0.0.1:8001;
        proxy_set_header        X-Forwarded-Host $http_host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_connect_timeout   900;
        proxy_send_timeout      900;
        proxy_read_timeout      900;
        send_timeout            900;
    }
}

I think that just flashing a simple message saying:

The export is currently being generated, please don't refresh your browser window
or something along those lines would remove any doubt of a failed request.

As an example, this is the message that a user receives after updating the export column configuration in NetBox.

netbox_preferences

In general, any type of indication that work is being done in the background would be useful.

@mtbutler07 commented on GitHub (Nov 3, 2020): > Adding a separate indication within NetBox itself would be redundant and unnecessary. I agree that this would be an unnecessary feature for exports that contain a small number of objects (<1000) since it only takes a few seconds for a response. However, in cases of very large environments where there may be tens of thousands of devices and hundreds of thousands of IP addresses, the export time can increase to 5-10 minutes. ____ After clicking the export button, the only indication in the browser is a very small animation in the corner of the current tab. ![loading](https://user-images.githubusercontent.com/33135168/98042913-01855480-1dea-11eb-911c-a37ddbfd5296.gif) For some users, this animation can be very subtle and easy to miss. They might also be tempted to refresh the page in order to retry the export. Besides that small animation in the browser, there really isn't any indication from NetBox that the request was received successful until a download window pops up 5-10 minutes later. Additionally, for requests that take over 60 seconds, nginx will just return a `504 Gateway Time-out`. [![nginx](https://user-images.githubusercontent.com/33135168/98042634-81f78580-1de9-11eb-9dea-1c960ebd4b84.PNG)](url) I found out that this can be adjusted by increasing the timeout as a work around. ```nginx server { location / { proxy_pass http://127.0.0.1:8001; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 900; proxy_send_timeout 900; proxy_read_timeout 900; send_timeout 900; } } ``` ____ I think that just flashing a simple message saying: > The export is currently being generated, please don't refresh your browser window or something along those lines would remove any doubt of a failed request. As an example, this is the message that a user receives after updating the export column configuration in NetBox. ![netbox_preferences](https://user-images.githubusercontent.com/33135168/98046093-2f20cc80-1def-11eb-9327-2fe1a342c19a.PNG) In general, any type of indication that work is being done in the background would be useful.
Author
Owner

@jeremystretch commented on GitHub (Nov 4, 2020):

When the browser initiates a synchronous request, meaning that no further action can be taken before receiving the response (e.g. clicking a normal link), any delay is indicated to the user via a means determined by the browser. In your case, it is the tab animation. This is the same for every website or web application consumed using the browser, so it is reasonable to assume that the user understands and is familiar with this notification.

The proposal here is to implement (and accept the burden of maintaining) custom Javascript in specific areas of the NetBox UI simply to duplicate this functionality. I'm sorry, I but don't see any justification for accepting this.

@jeremystretch commented on GitHub (Nov 4, 2020): When the browser initiates a synchronous request, meaning that no further action can be taken before receiving the response (e.g. clicking a normal link), any delay is indicated to the user via a means determined by the browser. In your case, it is the tab animation. This is the same for every website or web application consumed using the browser, so it is reasonable to assume that the user understands and is familiar with this notification. The proposal here is to implement (and accept the burden of maintaining) custom Javascript in specific areas of the NetBox UI simply to duplicate this functionality. I'm sorry, I but don't see any justification for accepting this.
Author
Owner

@mtbutler07 commented on GitHub (Nov 4, 2020):

Understood. Thanks for reviewing!

@mtbutler07 commented on GitHub (Nov 4, 2020): Understood. Thanks for reviewing!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4231