diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-04-15 23:42:44 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-04-17 19:13:25 +0300 |
commit | 816d793003e93c1e5eec0a2e90fbd8b9dde9f7a5 (patch) | |
tree | 341534fed9a2de460ded7f8231ca1cbb178bb2ca /meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui | |
parent | a75bff085ba9443315222231c42692745e5781e9 (diff) | |
download | openbmc-816d793003e93c1e5eec0a2e90fbd8b9dde9f7a5.tar.xz |
Update 4-15-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui')
4 files changed, 287 insertions, 76 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0004-Implement-force-boot-to-bios-in-server-power-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0004-Implement-force-boot-to-bios-in-server-power-control.patch new file mode 100644 index 000000000..0e2d400a3 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0004-Implement-force-boot-to-bios-in-server-power-control.patch @@ -0,0 +1,199 @@ +From a4f948f98e9bfd8b019699b4e23281448f7b7313 Mon Sep 17 00:00:00 2001 +From: Kuiying Wang <kuiying.wang@intel.com> +Date: Wed, 27 Mar 2019 19:35:12 +0800 +Subject: [PATCH] Implement force to BIOS + +UI page review use below link: +https://projects.invisionapp.com/share/UER87D98GPM#/screens + +Tested: + Switch on "Boot To BIOS", could enter BIOS setup page directly + when power on system. + +Change-Id: Ib46dc5d84df51d31cc5ff8635fa0c0f52de0e194 +Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> +--- + app/common/services/api-utils.js | 49 +++++++++++++++++++ + app/common/services/constants.js | 4 ++ + app/common/services/dataService.js | 1 + + .../power-operations-controller.html | 12 +++++ + .../power-operations-controller.js | 32 ++++++++++++ + 5 files changed, 98 insertions(+) + +diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js +index 840db8e..193c172 100644 +--- a/app/common/services/api-utils.js ++++ b/app/common/services/api-utils.js +@@ -31,6 +31,7 @@ window.angular && (function(angular) { + HOST_STATE: Constants.HOST_STATE, + LED_STATE: Constants.LED_STATE, + LED_STATE_TEXT: Constants.LED_STATE_TEXT, ++ FORCE_TO_BIOS_STATE_TEXT: Constants.FORCE_TO_BIOS_STATE_TEXT, + HOST_SESSION_STORAGE_KEY: Constants.API_CREDENTIALS.host_storage_key, + getChassisState: function() { + var deferred = $q.defer(); +@@ -451,6 +452,32 @@ window.angular && (function(angular) { + }); + return deferred.promise; + }, ++ getForceToBIOSState: function() { ++ var deferred = $q.defer(); ++ ++ if (DataService.configJson.redfishSupportEnabled == true) { ++ $http({ ++ method: 'GET', ++ url: ++ DataService.getHost() + '/redfish/v1/Systems/system', ++ withCredentials: true ++ }).then( ++ function(response) { ++ var json = JSON.stringify(response.data); ++ var content = JSON.parse(json); ++ deferred.resolve(content.Boot.BootSourceOverrideTarget); ++ }, ++ function(error) { ++ console.log(error); ++ deferred.reject(error); ++ }); ++ } else { ++ var err = "Redfish is not enabled!"; ++ console.log(err); ++ deferred.reject(err); ++ } ++ return deferred.promise; ++ }, + login: function(username, password, callback) { + $http({ + method: 'POST', +@@ -872,6 +899,28 @@ window.angular && (function(angular) { + } + }); + }, ++ setForceToBIOSState: function(state) { ++ if (DataService.configJson.redfishSupportEnabled == true) { ++ var data = JSON.stringify({'Boot': ++ { ++ 'BootSourceOverrideTarget': state ++ } ++ }); ++ return $http({ ++ method: 'PATCH', ++ url: ++ DataService.getHost() + '/redfish/v1/Systems/system', ++ withCredentials: true, ++ data: data ++ }); ++ } else { ++ var deferred = $q.defer(); ++ var err = "Redfish is not enabled!"; ++ console.log(err); ++ deferred.reject(err); ++ return deferred.promise; ++ } ++ }, + getLastRebootTime: function() { + return $http({ + method: 'GET', +diff --git a/app/common/services/constants.js b/app/common/services/constants.js +index 9931f01..8da0b12 100644 +--- a/app/common/services/constants.js ++++ b/app/common/services/constants.js +@@ -38,6 +38,10 @@ window.angular && (function(angular) { + HOST_STATE: {on: 1, off: -1, error: 0, unreachable: -2}, + LED_STATE: {on: true, off: false}, + LED_STATE_TEXT: {on: 'on', off: 'off'}, ++ FORCE_TO_BIOS_STATE_TEXT: { ++ on: 'BiosSetup', ++ off: 'None' ++ }, + SEVERITY_TO_PRIORITY_MAP: { + Emergency: 'High', + Alert: 'High', +diff --git a/app/common/services/dataService.js b/app/common/services/dataService.js +index 76ab381..bcd7142 100644 +--- a/app/common/services/dataService.js ++++ b/app/common/services/dataService.js +@@ -18,6 +18,7 @@ window.angular && (function(angular) { + this.server_status = -2; + this.chassis_state = 'On'; + this.LED_state = Constants.LED_STATE_TEXT.off; ++ this.ForceToBIOS_state = Constants.FORCE_TO_BIOS_STATE_TEXT.off; + this.last_updated = new Date(); + + this.loading = false; +diff --git a/app/server-control/controllers/power-operations-controller.html b/app/server-control/controllers/power-operations-controller.html +index 3dc69d2..1f00f4a 100644 +--- a/app/server-control/controllers/power-operations-controller.html ++++ b/app/server-control/controllers/power-operations-controller.html +@@ -10,6 +10,18 @@ + <div class="row column"> + <div id="power-indicator-bar" class="power__indicator-bar" ng-class="{'power__state-on': dataService.server_state == 'Running', 'power__state-off': dataService.server_state == 'Off', 'power__state-indet': dataService.server_state == 'Standby', 'power__state-error': dataService.server_state == 'Quiesced'}"> + <p class="inline">{{dataService.hostname}} - {{dataService.server_id}}</p> ++ <div class="toggle float-right"> ++ <input id="toggle__switch-round" ++ class="toggle-switch toggle-switch__round-flat" ++ type="checkbox" ++ tabindex="0" ++ ng-click="toggleForceToBIOS()" ++ ng-checked="dataService.ForceToBIOS_state == 'BiosSetup'" ++ ng-disabled="dataService.server_unreachable"> ++ <label for="toggle__switch-round" tabindex="0"> </label> ++ <h3 class="inline">Boot to BIOS</h3> ++ </div> ++ + <h3 class="power__state inline no-margin h3"><span>{{dataService.server_state | quiescedToError}}</span></h3> + </div> + </div> +diff --git a/app/server-control/controllers/power-operations-controller.js b/app/server-control/controllers/power-operations-controller.js +index 1a1f355..9a832e8 100644 +--- a/app/server-control/controllers/power-operations-controller.js ++++ b/app/server-control/controllers/power-operations-controller.js +@@ -26,6 +26,17 @@ window.angular && (function(angular) { + + var pollChassisStatusTimer = undefined; + var pollStartTime = null; ++ APIUtils.getForceToBIOSState().then( ++ function(data) { ++ if (data == APIUtils.FORCE_TO_BIOS_STATE_TEXT.on) { ++ dataService.ForceToBIOS_state = APIUtils.FORCE_TO_BIOS_STATE_TEXT.on; ++ } else { ++ dataService.ForceToBIOS_state = APIUtils.FORCE_TO_BIOS_STATE_TEXT.off; ++ } ++ }, ++ function(error) { ++ console.log(JSON.stringify(error)); ++ }); + + //@TODO: call api and get proper state + +@@ -50,6 +61,27 @@ window.angular && (function(angular) { + (dataService.server_state == 'Running') ? 'Off' : 'Running'; + }; + ++ $scope.toggleForceToBIOS = function() { ++ var toggleState = ++ (dataService.ForceToBIOS_state == APIUtils.FORCE_TO_BIOS_STATE_TEXT.on) ? ++ APIUtils.FORCE_TO_BIOS_STATE_TEXT.off : ++ APIUtils.FORCE_TO_BIOS_STATE_TEXT.on; ++ dataService.ForceToBIOS_state = ++ (dataService.ForceToBIOS_state == APIUtils.FORCE_TO_BIOS_STATE_TEXT.on) ? ++ APIUtils.FORCE_TO_BIOS_STATE_TEXT.off : ++ APIUtils.FORCE_TO_BIOS_STATE_TEXT.on; ++ APIUtils.setForceToBIOSState(toggleState) ++ .then( ++ function(response) {}, ++ function(errors) { ++ toastService.error( ++ 'Failed to set Boot to BIOS '); ++ console.log(JSON.stringify(errors)); ++ // Reload to get correct current state ++ $route.reload(); ++ }) ++ }; ++ + $scope.powerOn = function() { + $scope.loading = true; + dataService.setUnreachableState(); +-- +2.19.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch deleted file mode 100644 index 31d810cb6..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 5a3750377629725890f949d68e7e0ba7d4752825 Mon Sep 17 00:00:00 2001 -From: Mirage Su <mirage.su@mic.com.tw> -Date: Fri, 8 Mar 2019 17:12:46 +0800 -Subject: [PATCH] Fix some page keeps loading on IE11 - ---- - app/index.js | 1 + - package-lock.json | 19 +++++++++++++++++++ - package.json | 1 + - 3 files changed, 21 insertions(+) - mode change 100644 => 100755 package-lock.json - -diff --git a/app/index.js b/app/index.js -index c9fed83..c51203e 100644 ---- a/app/index.js -+++ b/app/index.js -@@ -8,6 +8,7 @@ - */ - import 'angular/angular-csp.css'; - import 'bootstrap/dist/css/bootstrap.css'; -+import 'babel-polyfill'; - - import angular from 'angular'; - import angular_animate from 'angular-animate'; -diff --git a/package-lock.json b/package-lock.json -old mode 100644 -new mode 100755 -index 2d9d31b..61e9787 ---- a/package-lock.json -+++ b/package-lock.json -@@ -1500,6 +1500,25 @@ - "babel-runtime": "6.26.0" - } - }, -+ "babel-polyfill": { -+ "version": "6.26.0", -+ "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", -+ "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", -+ "dev": true, -+ "requires": { -+ "babel-runtime": "^6.26.0", -+ "core-js": "^2.5.0", -+ "regenerator-runtime": "^0.10.5" -+ }, -+ "dependencies": { -+ "regenerator-runtime": { -+ "version": "0.10.5", -+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", -+ "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", -+ "dev": true -+ } -+ } -+ }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", -diff --git a/package.json b/package.json -index 35c6b78..1bdf934 100644 ---- a/package.json -+++ b/package.json -@@ -50,6 +50,7 @@ - "autoprefixer": "9.1.5", - "babel-core": "6.26.3", - "babel-loader": "8.0.2", -+ "babel-polyfill": "^6.26.0", - "compression-webpack-plugin": "2.0.0", - "copy-webpack-plugin": "4.5.2", - "csp-html-webpack-plugin": "^2.5.0", diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch new file mode 100644 index 000000000..77bf662dc --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch @@ -0,0 +1,88 @@ +From 7ea99450a96ac6eb5815ed5f1b7a17e055365b78 Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo <jae.hyun.yoo@intel.com> +Date: Sat, 6 Apr 2019 00:15:04 -0700 +Subject: [PATCH] Pull the latest novnc package + +Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> +--- + package-lock.json | 18 +++++++++++------- + package.json | 2 +- + 2 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/package-lock.json b/package-lock.json +index c79a26c8229c..337383551a96 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -808,9 +808,8 @@ + } + }, + "@novnc/novnc": { +- "version": "1.0.0", +- "resolved": "https://registry.npmjs.org/@novnc/novnc/-/novnc-1.0.0.tgz", +- "integrity": "sha1-drDonm+HOMqBVBlbr1uOaoC8kQU=" ++ "version": "git+https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5", ++ "from": "git+https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5" + }, + "@types/node": { + "version": "10.12.18", +@@ -3965,7 +3964,8 @@ + "ansi-regex": { + "version": "2.1.1", + "bundled": true, +- "dev": true ++ "dev": true, ++ "optional": true + }, + "aproba": { + "version": "1.2.0", +@@ -4380,7 +4380,8 @@ + "safe-buffer": { + "version": "5.1.1", + "bundled": true, +- "dev": true ++ "dev": true, ++ "optional": true + }, + "safer-buffer": { + "version": "2.1.2", +@@ -4436,6 +4437,7 @@ + "version": "3.0.1", + "bundled": true, + "dev": true, ++ "optional": true, + "requires": { + "ansi-regex": "2.1.1" + } +@@ -4479,12 +4481,14 @@ + "wrappy": { + "version": "1.0.2", + "bundled": true, +- "dev": true ++ "dev": true, ++ "optional": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, +- "dev": true ++ "dev": true, ++ "optional": true + } + } + }, +diff --git a/package.json b/package.json +index 0a880571d617..be816c8ece03 100644 +--- a/package.json ++++ b/package.json +@@ -30,7 +30,7 @@ + "dependencies": { + "angular": "^1.7.5", + "angular-animate": "^1.7.5", +- "@novnc/novnc": "^1.0.0", ++ "@novnc/novnc": "https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5", + "angular-clipboard": "^1.6.2", + "angular-cookies": "^1.7.5", + "angular-messages": "^1.7.6", +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json deleted file mode 100644 index 1543a6249..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "customKeyEnable": true, - "keyType" : "VT100+", - "customConsoleDisplaySize": { - "width": 100, - "height": 32 - } -} |