mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-04 22:49:47 +00:00
Revamped the attach addon
Also updated docs with proper attach url
This commit is contained in:
parent
a1717fdd8d
commit
01e48b7406
@ -5,8 +5,61 @@
|
|||||||
<link rel="stylesheet" href="../../demo/style.css" />
|
<link rel="stylesheet" href="../../demo/style.css" />
|
||||||
<script src="../../src/xterm.js"></script>
|
<script src="../../src/xterm.js"></script>
|
||||||
<script src="attach.js"></script>
|
<script src="attach.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2 {
|
||||||
|
color: #444;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, button {
|
||||||
|
line-height: 22px;
|
||||||
|
font-size: 16px;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 2px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 22px;
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
height: 28px;
|
||||||
|
background-color: #ccc;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
xterm.js: socket attach
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
Attach the terminal to a WebSocket terminal stream with ease. Perfect for attaching to your
|
||||||
|
Docker containers.
|
||||||
|
</p>
|
||||||
|
<h2>
|
||||||
|
Socket information
|
||||||
|
</h2>
|
||||||
<form id="socket-form">
|
<form id="socket-form">
|
||||||
<input id="socket-url"
|
<input id="socket-url"
|
||||||
type="text"
|
type="text"
|
||||||
@ -17,6 +70,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div id="terminal-container"></div>
|
<div id="terminal-container"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var term = new Terminal(),
|
var term = new Terminal(),
|
||||||
container = document.getElementById('terminal-container'),
|
container = document.getElementById('terminal-container'),
|
||||||
|
@ -19,7 +19,8 @@ Getting started
|
|||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
var term = new Terminal(),
|
var term = new Terminal(),
|
||||||
socket = new WebSocket('ws://docker/containers/mycontainer/attach/ws');
|
url = 'ws://docker/containers/mycontainer/attach/ws/?stdin=1&stdout=1&stderr=1&logs=1',
|
||||||
|
socket = new WebSocket(url);
|
||||||
|
|
||||||
term.open(document.body);
|
term.open(document.body);
|
||||||
term.on('data', function (data) {
|
term.on('data', function (data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user