Fix issue on IE cannot open SOL page
The root cause is that TextEncoder/TextDecoder does not support IE
More detail at https://caniuse.com/#feat=textencoder
One workable solution is to include text-encoder lib,
as this patch did.
Tested:
IE visit BMC and navigate to "#/server-control/remote-console"
SOL page is working well.
Change-Id: I5019c626afcf67916252db4115af7616c7a9759b
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
diff --git a/app/common/directives/serial-console.js b/app/common/directives/serial-console.js
index 27917a5..045503d 100644
--- a/app/common/directives/serial-console.js
+++ b/app/common/directives/serial-console.js
@@ -35,6 +35,16 @@
return rect;
}
+/*
+TextEncoder/TextDecoder does not support IE.
+Use text-encoding instead in IE
+More detail at https://caniuse.com/#feat=textencoder
+*/
+import {TextDecoder} from 'text-encoding';
+if (!window['TextDecoder']) {
+ window['TextDecoder'] = TextDecoder;
+}
+
window.angular && (function(angular) {
'use strict';
diff --git a/package-lock.json b/package-lock.json
index 65e97ed..415818a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8996,6 +8996,11 @@
}
}
},
+ "text-encoding": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz",
+ "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA=="
+ },
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
diff --git a/package.json b/package.json
index 8211487..5d291cd 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,8 @@
"ng-toast": "2.0.0",
"pkg-dir": "4.2.0",
"regenerator-runtime": "0.13.3",
- "xterm": "3.14.5"
+ "xterm": "3.14.5",
+ "text-encoding": "0.7.0"
},
"peerDependencies": {},
"devDependencies": {