summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-04-02 15:25:36 -0500
committerGunnar Mills <gmills@us.ibm.com>2018-04-09 14:55:49 +0000
commit6d7b4a8d9da5f27acce5a96ea5b512674c24ecf8 (patch)
tree633b54a73ff41e6fc016bb444307152282829a6a /app/configuration/controllers
parent6d9ef5ac6c345930c5695634118fc783ab4717ef (diff)
downloadphosphor-webui-6d7b4a8d9da5f27acce5a96ea5b512674c24ecf8.tar.gz
phosphor-webui-6d7b4a8d9da5f27acce5a96ea5b512674c24ecf8.zip
Display error if TFTP field empty
If either TFTP Server IP Address or File Name is empty for the "Download image file from TFTP server" function, return and display an error. Tested: Verified I see this error if either field is empty. Change-Id: I3da3353dad7cfb0f765d8a662412c3adb3fa4efd Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/configuration/controllers')
-rw-r--r--app/configuration/controllers/firmware-controller.html1
-rw-r--r--app/configuration/controllers/firmware-controller.js6
2 files changed, 7 insertions, 0 deletions
diff --git a/app/configuration/controllers/firmware-controller.html b/app/configuration/controllers/firmware-controller.html
index dc85606..c30b4d2 100644
--- a/app/configuration/controllers/firmware-controller.html
+++ b/app/configuration/controllers/firmware-controller.html
@@ -46,6 +46,7 @@
</div>
</div>
<div class="inline uploading" ng-show="downloading">Downloading in progress...</div>
+ <p class="download_error error-msg" ng-show="download_error_msg" role="alert">{{download_error_msg}}</p>
</fieldset>
</div>
</form>
diff --git a/app/configuration/controllers/firmware-controller.js b/app/configuration/controllers/firmware-controller.js
index 127a7c2..29d0412 100644
--- a/app/configuration/controllers/firmware-controller.js
+++ b/app/configuration/controllers/firmware-controller.js
@@ -49,6 +49,7 @@ window.angular && (function (angular) {
$scope.file_empty = true;
$scope.uploading = false;
$scope.activate = { reboot: true };
+ $scope.download_error_msg = "";
var pollActivationTimer = undefined;
@@ -156,6 +157,11 @@ window.angular && (function (angular) {
}
$scope.download = function(){
+ $scope.download_error_msg = "";
+ if(!$scope.download_host || !$scope.download_filename){
+ $scope.download_error_msg = "Field is required!";
+ return false;
+ }
$scope.downloading = true;
APIUtils.downloadImage($scope.download_host, $scope.download_filename).then(function(response){
var data = response.data;
OpenPOWER on IntegriCloud