Add Activate firmware and reboot button

Added a radio button to activate firmware and reboot the BMC.
If the "Activate firmware and reboot" option is selected, reboot
the BMC after activating the firmware. The user is then logged
out.

Resolves openbmc/openbmc#3027

Tested: When "Activate firmware and reboot" option is selected,
the BMC reboots after activating. When it is not selected,
the BMC image just activates.
Change-Id: I07293dc8a6ddfac4cf58ba2c1d1352c9afd6fa8d
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/configuration/controllers/firmware-controller.js b/app/configuration/controllers/firmware-controller.js
index 8fe0e83..127a7c2 100644
--- a/app/configuration/controllers/firmware-controller.js
+++ b/app/configuration/controllers/firmware-controller.js
@@ -48,6 +48,7 @@
                     $scope.confirm_priority = false;
                     $scope.file_empty = true;
                     $scope.uploading = false;
+                    $scope.activate = { reboot: true };
 
                     var pollActivationTimer = undefined;
 
@@ -119,6 +120,17 @@
                             desc: JSON.stringify(error.data),
                             type: 'Error'
                           });
+                        }).then(function(state){
+                          if($scope.activate.reboot){
+                            APIUtils.bmcReboot(function(response){}, function(error){
+                              $scope.displayError({
+                                modal_title: 'Error during BMC reboot',
+                                title: 'Error during BMC reboot',
+                                desc: JSON.stringify(error.data),
+                                type: 'Error'
+                              });
+                            });
+                          }
                         });
                       });
                       $scope.activate_confirm = false;