-
Notifications
You must be signed in to change notification settings - Fork 3
/
index-kube.html
25 lines (25 loc) · 957 Bytes
/
index-kube.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="node_modules/xterm/css/xterm.css" />
<script src="node_modules/xterm/lib/xterm.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" integrity="sha512-v8ng/uGxkge3d1IJuEo6dJP8JViyvms0cly9pnbfRxT6/31c3dRWxIiwGnMSWwZjHKOuY3EVmijs7k1jz/9bLA==" crossorigin="anonymous"></script>
</head>
<body>
<div id="terminal"></div>
<script>
let config = {msgId: "pod01", podName: "tiller-deploy-6d8dfbb696-z8g6l", namespace: "kube-system"};
const socket = io('http://localhost:8000');
const term = new Terminal();
term.open(document.getElementById('terminal'));
term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m')
term.onData(function(data) {
socket.emit(config.msgId, data);
})
socket.on(config.msgId, function (data) {
term.write(data)
})
socket.emit('createNewPod', config);
</script>
</body>
</html>