2024-02-27 11:26:55 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block left_pannel %}override{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
{% if not current_user.is_authenticated %}
|
|
|
|
<button class="unselected" onclick="location.href = '/login';">login</button>
|
|
|
|
{% else %}
|
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='node_modules/xterm/css/xterm.css') }}"/>
|
|
|
|
<script src="{{ url_for('static', filename='node_modules/xterm/lib/xterm.js') }}"></script>
|
2024-02-28 11:53:23 +01:00
|
|
|
<script src="{{ url_for('static', filename='node_modules/xterm-addon-fit/lib/xterm-addon-fit.js') }}"></script>
|
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td width="20%" height="90%">
|
|
|
|
<div id="console"></div>
|
|
|
|
</td>
|
|
|
|
<td width="80%">
|
|
|
|
<iframe src="/novnc/vnc.html?resize=scale&path=novnc/websockify&autoconnect=true&view_only"
|
|
|
|
width="100%" height="100%" frameborder="0"></iframe>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-02-27 11:26:55 +01:00
|
|
|
|
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
var term = new Terminal();
|
2024-02-28 12:09:32 +01:00
|
|
|
const fitAddon = new FitAddon.FitAddon();
|
2024-02-28 11:53:23 +01:00
|
|
|
term.loadAddon(fitAddon);
|
|
|
|
term.open(document.getElementById('console'));
|
2024-02-28 12:00:19 +01:00
|
|
|
fitAddon.fit()
|
|
|
|
|
2024-02-28 11:53:23 +01:00
|
|
|
document.getElementById("console").style.textAlign = "left"
|
2024-02-28 11:41:13 +01:00
|
|
|
const eventSource = new EventSource('/stream');
|
2024-02-27 11:26:55 +01:00
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
eventSource.onmessage = (event) => {
|
|
|
|
term.writeln(event.data)
|
|
|
|
};
|
2024-02-27 11:26:55 +01:00
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
</script>
|
2024-02-27 11:26:55 +01:00
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
{% endif %}
|
2024-02-27 11:26:55 +01:00
|
|
|
|
2024-02-28 11:41:13 +01:00
|
|
|
{% endblock %}
|