Added battleship files
This commit is contained in:
27
Battleships/battleships-137-main/views/index.html
Normal file
27
Battleships/battleships-137-main/views/index.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<body>
|
||||
<button onclick="window.location.reload()">Run Program</button>
|
||||
<div id="terminal"></div>
|
||||
|
||||
<script>
|
||||
var term = new Terminal({
|
||||
cols: 80,
|
||||
rows: 24
|
||||
});
|
||||
term.open(document.getElementById('terminal'));
|
||||
term.writeln('Running startup command: python3 run.py');
|
||||
term.writeln('');
|
||||
|
||||
var ws = new WebSocket(location.protocol.replace('http', 'ws') + '//' + location.hostname + (location.port ? (
|
||||
':' + location.port) : '') + '/');
|
||||
|
||||
ws.onopen = function () {
|
||||
new attach.attach(term, ws);
|
||||
};
|
||||
|
||||
ws.onerror = function (e) {
|
||||
console.log(e);
|
||||
};
|
||||
// Set focus in the terminal
|
||||
document.getElementsByClassName("xterm-helper-textarea")[0].focus();
|
||||
</script>
|
||||
</body>
|
||||
Reference in New Issue
Block a user