add some socket stuff
This commit is contained in:
parent
4c282bc16b
commit
25f5a6417d
3 changed files with 43 additions and 39 deletions
|
@ -1 +1,2 @@
|
|||
flask
|
||||
python-socketio
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
const io = require('socket.io-client');
|
||||
// or with import syntax
|
||||
import io from 'socket.io-client';
|
||||
|
||||
$(function() {
|
||||
var socket = io();
|
||||
socket.on('link_arrived', function(link_id) {
|
||||
$('#current_run').append($('<div class="item>"</div>').text(link_id));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
<html>
|
||||
<head>
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ url_for('static', filename = 'hello.js') }}"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', filename = 'index.css') }}"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<head>
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename = 'index.js') }}"></script>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename = 'index.css') }}" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="item">
|
||||
|
@ -39,5 +36,6 @@
|
|||
<div class="item">hoi</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue