Update boot override UI messaging visibility
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
diff --git a/app/server-control/controllers/power-operations-controller.html b/app/server-control/controllers/power-operations-controller.html
index 2ef5323..7f61fb5 100644
--- a/app/server-control/controllers/power-operations-controller.html
+++ b/app/server-control/controllers/power-operations-controller.html
@@ -31,8 +31,11 @@
<div class="boot-options">
<label for="boot-selected">
Boot setting override</label>
- <select id="boot-selected" name="bootSelected" id="boot-selected" ng-disabled="dataService.server_unreachable || bootOverrideError"
- ng-model="boot.BootSourceOverrideTarget">
+ <select name="bootSelected"
+ id="boot-selected"
+ ng-disabled="dataService.server_unreachable || bootOverrideError"
+ ng-model="boot.BootSourceOverrideTarget"
+ ng-change="onChangeBootSetting()">
<option class="courier-bold" value="{{bootSource}}" ng-repeat="bootSource in bootSources">
{{ bootSource }}
</option>
@@ -40,9 +43,12 @@
<div class="boot-options one-time-boot-setting">
<div class="align-self-center">
<label class="control-check" id="one-time-label"> <span class="inline boot-checkbox">Enable one time boot</span>
- <input type="checkbox" name="oneTime"
- ng-disabled="dataService.server_unreachable || bootOverrideError || boot.BootSourceOverrideTarget =='None' " ng-model="boot.oneTimeBootEnabled"
- ng-change="oneTimeBootEnabled" />
+ <input type="checkbox"
+ name="oneTime"
+ ng-disabled="dataService.server_unreachable ||
+ bootOverrideError ||
+ boot.BootSourceOverrideTarget =='None'"
+ ng-model="boot.oneTimeBootEnabled"/>
<span class="control__indicator"> </span>
</label>
</div>
diff --git a/app/server-control/controllers/power-operations-controller.js b/app/server-control/controllers/power-operations-controller.js
index 89376c6..76e632b 100644
--- a/app/server-control/controllers/power-operations-controller.js
+++ b/app/server-control/controllers/power-operations-controller.js
@@ -376,6 +376,16 @@
}
};
+ /**
+ * Callback when boot setting option changed
+ */
+ $scope.onChangeBootSetting = function() {
+ const bootSetting = $scope.hostBootSettings.bootSelected.$viewValue;
+ if (bootSetting === 'None') {
+ $scope.boot.oneTimeBootEnabled = false;
+ }
+ };
+
/*
* Emitted every time the view is reloaded
*/