[Kimchi-devel] [PATCH v2] [Kimchi 4/8] Implement the web serial console front-end
Jose Ricardo Ziviani
joserz at linux.vnet.ibm.com
Tue Feb 9 18:23:17 UTC 2016
- This is the screen that opens when the client requests the serial
console, basically a textarea and a websocket that communicates
with the server (through websockify) in order to send/receive
data from a guest serial console.
Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
ui/serial/images/favicon.ico | Bin 0 -> 15086 bytes
ui/serial/serial.html | 99 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 99 insertions(+)
create mode 100644 ui/serial/images/favicon.ico
create mode 100644 ui/serial/serial.html
diff --git a/ui/serial/images/favicon.ico b/ui/serial/images/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..1d998c2543576a16c72e49630317afb8e1373b38
GIT binary patch
literal 15086
zcmdU$e{5D)8OLu^Z8H?g=2+O2w-qR|!M3hT7zS8Zp=M4rk!2ZXZeaxKk3Sqp+-M}e
zU{xR)3S)qY8JJ9gMZ`IbTj~sL2#{?>z^QE0ND&l+!dgb;Wqa4__j7yByTj$)`~K)#
zhBx`<IrrRi&iDH~=Q-!z_rCAzc@<uzH*%yWTjzb{1D-d<^Srvcf%EOE->kZZ26JBT
zd7mETc at xz}m(*jRUdHp(F6rpr at UiL>J3lc7P_}Jny|k)s=Dx>QH}79Fr)}eBD{Z}N
z)u&$AA^g>V@^sp$Z(8t$e=~;L&z9A8k>DFJ#!JF)|FyHefj;y#V|2-mu>Gv1o!Y~>
zR;V|=)KiaU^|?jZB{0q{wx6|AKX;(w=S!{{xqZ>_58Jx1RlnPXBUty^=7m)gh4sQO
zggI{P+;-|WLRfv<)>lT2Uw3u_R_z;wZs9C_<KoLW^k**W*Y(X6{wZ{-&+~#W{4}Yr
zt3&<P3cheo{otklTDMJHnK-H6k4*pP;1$r{GHucu*DOeNR>k$DzW#~6>FSI2ZsAs9
zMclvf at n4Ntl<HWDjp`rp()WqJr_^sP at pId$?>OOr!14$V`q(lSeUqmh9UZR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z|C?kpwb-7fObvE<b#FD+tL&`|Y(-|kdd4;^tDwHZPY1T$-`&Nzj$<L)XU+rrrhf3G
z^ZrWT=YLfq3v6$#@1O6||FfDjz;e&)Ov}ot<ua}f2ym8qK9RdtZ`Lbx-Y>fXtA7;j
zm(A*vgntwV2W(GTRzI#fuYs`;<ZSReDxJ$7r at sANe+71V)>klO_16$=Cxbe+r at AwU
bLvKw_5T{H{Hi%=kc3}MAXJ2X`9G>?-JFBHw
literal 0
HcmV?d00001
diff --git a/ui/serial/serial.html b/ui/serial/serial.html
new file mode 100644
index 0000000..e3f7e21
--- /dev/null
+++ b/ui/serial/serial.html
@@ -0,0 +1,99 @@
+<!doctype html>
+<!--
+# Project Kimchi
+#
+# Copyright IBM, Corp. 2016
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+<html>
+ <head>
+ <title>Kimchi Serial Console</title>
+ <!--[if IE lte 9]><link rel="shortcut icon" href="images/favicon.ico"><![endif]-->
+ <link rel="shortcut icon" href="images/favicon.png">
+ <style>
+ html {
+ background-color: #3A393B;
+ }
+
+ body {
+ width: 50%;
+ height: 60%;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ .terminal {
+ width: 100%;
+ height: 100%;
+ border: #000 solid 3px;
+ font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;
+ font-size: 16px;
+ color: #f0f0f0;
+ background: #000;
+ }
+
+ .terminal-cursor {
+ color: #000;
+ background: #f0f0f0;
+ }
+ </style>
+ <script src="term.js"></script>
+ <script>
+ ;(function() {
+ window.onload = function() {
+ var params = new Map()
+ var query_string = window.location.href.split('?');
+ for (var i = 1; i < query_string.length; i++) {
+ query_string[i].split('&').forEach(function(val) {
+ param = val.split('=');
+ params.set(param[0], param[1]);
+ });
+ }
+
+ var url = 'wss://' + window.location.hostname + ':' + params.get('port');
+ url += '/' + params.get('path');
+ url += '?token=' + params.get('token');
+ var socket = new WebSocket(url, ['base64']);
+ var term = new Terminal({
+ cols: 80,
+ rows: 35,
+ useStyle: true,
+ screenKeys: true,
+ cursorBlink: true
+ });
+
+ term.on('data', function(data) {
+ socket.send(window.btoa(data));
+ });
+
+ socket.onopen = function() {
+ socket.send(window.btoa('\n'));
+ };
+
+ socket.onmessage = function(event) {
+ var message = event.data;
+ term.write(window.atob(message));
+ };
+
+ term.open(document.body);
+ };
+ }).call(this);
+ //# sourceURL=serial.js
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
--
1.9.1
More information about the Kimchi-devel
mailing list