summaryrefslogtreecommitdiffstats
path: root/app/common/directives/firmware-list.html
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-09-19 16:14:31 -0500
committerEd Tanous <ed.tanous@intel.com>2018-10-09 02:09:52 +0000
commit02012ea59a1e0edbfb7dadd2b7f47849d0356ff2 (patch)
treec035f39749bd44c1439de8fddfb7de5195c2a240 /app/common/directives/firmware-list.html
parent9e397721f99767cfabc8c277d4c6212a26758298 (diff)
downloadphosphor-webui-02012ea59a1e0edbfb7dadd2b7f47849d0356ff2.tar.gz
phosphor-webui-02012ea59a1e0edbfb7dadd2b7f47849d0356ff2.zip
Fix setting image priority
Let's say there are 2 images, A and B. A has a priority of 0 and B has a priority of 50. Lowest priority is the image used to boot from and appears at the top of the image tables (A in this case). If the user wanted image B to be the image with the lowest priority, they would have to hit the up arrow 50 times in the old logic. Move to setting the priority based on the image above, for the up arrow, or below, for the down arrow. If 2 images have the same priority, the image whose priority is being updated wins and the image who already has that priority gets bumped up 1, this is why when moving an image down we set to the below image's priority +1, but don't need this -1 when moving an image up in the table. Tested: Can still change the priority. Change-Id: If87e1d863ab909c276247072cc45e40b67cf686b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/common/directives/firmware-list.html')
-rw-r--r--app/common/directives/firmware-list.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/common/directives/firmware-list.html b/app/common/directives/firmware-list.html
index 55dd22e..00fb8f2 100644
--- a/app/common/directives/firmware-list.html
+++ b/app/common/directives/firmware-list.html
@@ -25,11 +25,11 @@
<div class="table__cell">
<span class="table__cell-label">Boot priority:</span>
<div class="icon icon__up-arrow" aria-hidden="true" ng-class="{'icon-as-spacer':$first}"
- ng-click="!$first && changePriority(firmware.imageId, firmware.Version, firmware.Priority, firmware.Priority - 1)"
+ ng-click="!$first && changePriority(firmware.imageId, firmware.Version, firmware.Priority, imageList[$index-1].Priority)"
ng-show="firmware.activationStatus == 'Functional' || firmware.activationStatus == 'Active'">
<span class="accessible-text">firmware up in priority</span></div>
<div class="icon icon__down-arrow" aria-hidden="true" ng-class="{'icon-as-spacer':$last || !['Active', 'Functional'].includes(imageList[$index+1].activationStatus)}"
- ng-click="(!$last && ['Active', 'Functional'].includes(imageList[$index + 1].activationStatus)) && changePriority(firmware.imageId, firmware.Version, firmware.Priority, firmware.Priority + 2)"
+ ng-click="(!$last && ['Active', 'Functional'].includes(imageList[$index + 1].activationStatus)) && changePriority(firmware.imageId, firmware.Version, firmware.Priority, imageList[$index+1].Priority + 1)"
ng-show="firmware.activationStatus == 'Functional' || firmware.activationStatus == 'Active'">
<span class="accessible-text">firmware down in priority</span></div>
</div>
OpenPOWER on IntegriCloud