summaryrefslogtreecommitdiffstats
path: root/app/server-control/controllers/power-operations-controller.js
Commit message (Collapse)AuthorAgeFilesLines
* Update boot override UI messaging visibilityYoshie Muranaka2019-09-251-0/+10
| | | | | | | | | | | | When a user changes the boot setting override option to 'None' on the Server power operations page, the Enable one time boot checkbox should not be checked and 'Pending one time boot' message should not be displayed. - Removed duplicate id and unused ng-change attributes Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: Ia8771c2984fe41c64dde9b0c702b82a3d8305d7f
* Add boot option override and TPM enable toggleDixsie Wolmers2019-08-211-94/+246
| | | | | | | | | | | | | | | | | - Adds ability to set a bootsource override to allowable target value - Adds ability to enable or disable TPM required policy - Replaces power operations confirm directive with bootstrap modal Tested: Confirmed override settings saved to redfish but unable to verify if settings are automatically set to disabled by petitboot after a one time boot. Passes DAP. Resolves openbmc/phosphor-webui#82 Resolves openbmc/phosphor-webui#90 Signed-off-by: Dixsie Wolmers <dixsiew@gmail.com> Change-Id: If0ffd6f9328939d70c7958ee11fb90bd20a1e685 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Refactor power operationsYoshie Muranaka2019-07-291-115/+118
| | | | | | | | | | | | | | | | | | Refactored power operations to use checkHostStatus function that checks host_status property provided by dataService, instead of polling for host/chassis status. Added property to check when a power operation is in progress. This property will show/hide the in progress message and make other operations unavailable until the operation completes. We were previously checking whether the server_state property was set to 'Unreachable', which enables the Power on button in the middle of a reboot, since the server_state changes to 'Off' during reboot. - Removed unused $timeout service Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I234749a9a875c7370b52bd23ed74d6e9617cf5e2
* Fix cold reboot errorYoshie Muranaka2019-06-261-16/+42
| | | | | | | | | | | | Cold reboot will check the host status by referring to the server_state property in the dataService instead of making API requests to check host/chassis status. TODO: Refactor other power control options to follow a similar pattern. Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I74b1b78fa39caee514fbaea8492c8a5ad6f8145b
* Remove unused interpolateGunnar Mills2019-05-201-3/+3
| | | | | | | | | | | Interpolate was used prior to the ngToast. https://github.com/openbmc/phosphor-webui/commit/92d13b62f56fa302a8231690e7371c6ae04f50ba#diff-bbc57e73eb8aa4f1c2de7b8e033393e3 moved to ngToast and removed the use of interpolate. Tested: Build this and the commits below and loaded onto a Witherspoon system. Did a power on, warm reboot, and immediate shutdown. Change-Id: I99c2f3705df413fc744066dd34ba38a383c174fc Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Added comments to help clarify "confirm"Gunnar Mills2019-05-171-0/+3
| | | | | | | For the next person digging in this code. :) Change-Id: Ib6c21da3fb53a4277a90bf2e5cab90ed29496724 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove done TODOGunnar Mills2019-05-171-2/+0
| | | | | | | This TODO is complete, remote it. Change-Id: Ifb775aa932bf54e790ff60352611a716f2d7fb02 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove unused testStateGunnar Mills2019-05-171-8/+1
| | | | | Change-Id: I9235c146fcd1288add4eeaa209d0f7b12f4d394e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove unused powerOnConfirm and powerConfirmGunnar Mills2019-05-171-8/+0
| | | | | | | | There is no confirm for Powering on the system. These were unused. Change-Id: I4f5c3eb0a7676877ccbb0fef687ab525e585e428 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Rename variables to follow lowerCamelCaseGunnar Mills2019-05-171-12/+12
| | | | | | | | | | OpenBMC follows Google JavaScript Style Guide. https://google.github.io/styleguide/jsguide.html#naming-local-variable-names https://github.com/openbmc/docs/blob/master/CONTRIBUTING.md#javascript Change-Id: I0be270d8cb8f219f048626591e6b623c4307eef7 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add role alert to toastsbeccabroek2019-02-061-7/+9
| | | | | | | | | | For accessibility reasons, 'role="alert" is required for toast messages. This notifies screen readers that an error or success message has appeared. Adds a service layer for toast messages that adds the role attribute to the message. Change-Id: Ic4dbf5556337eea589de5692c1b4c3323e771813 Signed-off-by: beccabroek <beccabroek@gmail.com>
* Add toast to Power Operations pagebeccabroek2019-01-151-42/+9
| | | | | | | | Replaces error messages with tast notifications on the Power Operations page. Change-Id: If92bcb18fc96e9dbd74807faf27feb9c82b6fc59 Signed-off-by: beccabroek <beccabroek@gmail.com>
* Activate image and reboot hostbeccabroek2018-09-191-75/+4
| | | | | | | | | | | | | | | | | | | When activating a host image, gives the option to: a) Activate image without booting b) Activate image and boot host. If server is in 'off' status the option is to power on. If the server is in 'unavailable', 'on', or 'error' status the option is to reboot Also updated polling during boot and reboot to use /subscribe API. Resolves openbmc/openbmc#3323 Tested: The GUI displays the options and boots / reboots appropriately based on server status. Change-Id: I62c19e094ecc7112263c26844fcd30b2bf3c2b84 Signed-off-by: beccabroek <rebecca.shaw@ibm.com>
* Have loader wait for Last Power OperationGunnar Mills2018-09-101-11/+16
| | | | | | | | The loader (blue spinning half circle) should wait for the call to get the Last Power Operation Time. Change-Id: I105a5742244fb417cd3ab609e2c14771c28792cb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Last power operationbeccabroek2018-08-111-1/+12
| | | | | | | | | | | | | | | Displays correct power operation time. In the case that there has not been a power operation, 'not available' is displayed. Resolves openbmc/openbmc#2957 Tested: The GUI displayed 'not available' when it received a 0 value and the correct date when an epoch was recieved. Signed-off-by: beccabroek <rebecca.shaw@ibm.com> Change-Id: I9573a1cdcd31ba4c02888bd46d195c91fdb916a7
* Update the server power state dynamically in GUIJayashankar Padath2018-06-281-12/+0
| | | | | | | | | | | | | | | | | | | This uses websocket mechanism to retrieve the server power state and update the same. Resolves openbmc/openbmc#3102 Tested: Running GUI locally and verified the following scenarios: - Power on operation from GUI and host command line - Power off operation from host command line - Warm reboot operation from GUI - Cold reboot operation from GUI - Immediate shutdown operation from GUI - Orderly shutdown operation from GUI In all of the above scenarios state change is notified to GUI at right time. Change-Id: I1c97ae10419078dfe16a1d097082580c29827fb7 Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com>
* Format code using clang-format-5.0Andrew Geissler2018-05-241-271/+298
| | | | | | | | Once merged, this repository will have CI enforce the coding guidelines in the .clang-format file. Change-Id: I96a05972665f9c67625c6850c3da25edc540be06 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Run js-beautify and fixjsstyle on codeAndrew Geissler2018-05-241-274/+288
| | | | | | | | | | | Found this pointer on stackoverflow: https://stackoverflow.com/a/31660434/5508494 End goal is to get the code formatted well enough that clang format will run correctly against it. Change-Id: I80053e78d253d8eee49233e42d55e5807ae8fdc8 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Remove the version from each fileGunnar Mills2018-04-301-1/+0
| | | | | | | | Already have a Web UI version, no need to track the version of each file. These have not been getting updated. Change-Id: I1cd3a2c2d67b24ded5edcca9dbfd3f6806d93ed4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add fixes for power operationsCamVan Nguyen2018-04-261-42/+127
| | | | | | | | | | | | | | | | | | | | | | | Fixes applies to 'Power on', 'Warm reboot', 'Orderly shutdown', and 'Immediate shutdown' power operations. Fixes include: - Verifying that the chassis and host transition through the expected states for each power operation. During which time a spinner will be displayed. A timeout of 5 minutes for each state transition has been added. - Displaying the current state of the host in the 'Server power' and 'Current status' bar. The state displayed will change as the host transition through different states even as the spinner continues to spin. - Displaying an error pop-up with reason for failure when the power operation fails. Resolves openbmc/openbmc#2758 Resolves openbmc/openbmc#2787 Resolves openbmc/openbmc#2803 Change-Id: I514e030f9df7bd4d8b53634408f0449cd9abada9 Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
* Add fixes for cold rebootIftekharul Islam2018-04-191-6/+82
| | | | | | | | | | | | | | | | This fixes the cold reboot issue with the following steps - It applies the command to shut off the chassis. - Then verify the chassis is off. It checks for every 5 seconds. During this time the spinner displays. A 5min timeout has been added. - Once the chassis is off, it turns on the host. fixes openbmc/openbmc#2795 Change-Id: I119a1c95e57c10ccee27be1512a1fc38cde307fa Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com> Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
* Remove trailing spaces from filesGunnar Mills2018-03-051-4/+4
| | | | | | Tested: Manually tested GUI for any regressions Change-Id: I8c0922b7bd67b03b07e8880bc4dba3b862220b33 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Warm Reboot should call the host reboot objectGunnar Mills2018-02-121-8/+4
| | | | | | | | | | | | | | | | From https://github.com/openbmc/docs/blob/master/host-management.md: To reboot the host: curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Host.Transition.Reboot"}' https://${bmc}/xyz/openbmc_project/state/host0/attr/RequestedHostTransition Resolves openbmc/openbmc#2797 Tested: Pointed the local GUI to a Witherspoon system and verfied the correct rest call was made and the system warm rebooted. Change-Id: If073ef4447b323777603e886668212bd04791eea Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Have Immediate Shutdown call the chassis objectGunnar Mills2018-02-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | "Immediate Shutdown" on the GUI should be a hard power off and differ from the "Orderly shutdown". From https://github.com/openbmc/docs/blob/master/host-management.md: To issue a hard power off (accomplished by powering off the chassis): curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT \ -d '{"data": "xyz.openbmc_project.State.Chassis.Transition.Off"}' \ https://${bmc}/xyz/openbmc_project/state/chassis0/attr/RequestedPowerTransition There was already an unused "chassisPowerOff" function, reworked it to call the chassis object. Resolves openbmc/openbmc#2890 Tested: Pointed the local GUI to a Witherspoon system and verfied the correct rest call was made and the system hard powered off. Change-Id: Ibdb712656930a62e34603daa17df0d3116c86d92 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* fix problems reported by sonar scannerIftekharul Islam2017-09-201-1/+0
| | | | | Change-Id: Ic351745aed9d670c51a33a21c5c0b5cde77a0e0e Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
* Change navigation structureIftekharul Islam2017-09-201-0/+134
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18 Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
OpenPOWER on IntegriCloud