MsRewards/Flask/templates/dev.html

31 lines
800 B
HTML
Raw Normal View History

2023-06-17 16:52:47 +02:00
{% extends "base.html" %}
2023-09-27 19:55:43 +02:00
{% block left_pannel %}{% endblock %}
2023-06-17 16:52:47 +02:00
{% block content %}
{%if not current_user.is_authenticated %}
<button class="unselected" onclick="location.href = '/login';">login</button>
{% else %}
<table>
<tr>
<td width="20%" height="90%">
<div id="console"></div>
</td>
</tr>
</table>
2023-06-17 16:52:47 +02:00
<script>
const consoleElement = document.getElementById('console');
const eventSource = new EventSource('/stream');
2023-09-27 19:38:21 +02:00
eventSource.onmessage = (event) => {
2023-10-03 00:23:06 +02:00
console.log("je ne comprend vraiment plus rien, meme git me casse les couilles");
const newOutput = document.createElement('div');
newOutput.textContent = event.data;
consoleElement.appendChild(newOutput);
};
</script>
2023-06-17 16:52:47 +02:00
{% endif %}
{% endblock %}