Refresh the firmware page after downloading image

Fix includes
- Polling the number of software objects for a new image. During
  which time the 'Downloading in progress' status bar will be
  displayed. A 2-minute timeout is used.
- Displaying a 'Download complete' message if the download succeeds
  and refreshing the firmware page to show the new image once it is
  downloaded.
- Displaying an error pop-up with reason for failure when the
  download fails.

Resolves openbmc/openbmc#3054

Change-Id: I79a8b8c661c01474a12cef4af524cafdc2cee1fe
Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index 6d3bcd6..8b51341 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -116,10 +116,12 @@
                 },
                 POLL_INTERVALS: {
                     ACTIVATION: 5000,
+                    DOWNLOAD_IMAGE: 5000,
                     POWER_OP: 5000,
                 },
                 TIMEOUT: {
                     ACTIVATION: 1000 * 60 * 10, // 10 mins
+                    DOWNLOAD_IMAGE: 1000 * 60 * 2, // 2 mins
                     CHASSIS_OFF: 1000 * 60 * 5, // 5 mins
                     HOST_ON: 1000 * 60 * 5, // 5 mins
                     HOST_OFF: 1000 * 60 * 5, // 5 mins
@@ -130,6 +132,7 @@
                         HOST_ON_TIMEOUT: 'Time out. System did not reach Running state in allotted time.',
                         HOST_OFF_TIMEOUT: 'Time out. System did not reach Off state in allotted time.',
                         HOST_QUIESCED: 'System is in Error state.',
+                        DOWNLOAD_IMAGE_TIMEOUT: 'Time out. Did not download image in allotted time.',
                     },
                     POWER_OP: {
                         POWER_ON_FAILED: 'Power On Failed',