2024-02-27 11:26:55 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block left_pannel %}logs{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
{%if not current_user.is_authenticated %}
|
|
|
|
<h1>Already logged in</h1>
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
<select name="select" onchange="change_logs(this.value)">
|
|
|
|
<option id="null" value="0">Choisir une config</option>
|
|
|
|
{% for i in data %}
|
|
|
|
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
<br><br>
|
2024-03-29 16:53:59 +01:00
|
|
|
<iframe type="text/html" src="{{url_for('static', filename='logs/1.txt')}}" width="100%" height="85%" id="embed"></iframe>
|
2024-02-27 11:26:55 +01:00
|
|
|
|
2024-03-29 16:53:59 +01:00
|
|
|
<script defer>
|
|
|
|
const iframe = document.getElementsByTagName("iframe")[0];
|
2024-03-25 10:41:34 +01:00
|
|
|
var script = document.createElement('script');
|
2024-03-29 16:53:59 +01:00
|
|
|
|
|
|
|
// Wait until ansi_up load
|
2024-03-25 10:41:34 +01:00
|
|
|
script.onload = function () {
|
2024-03-29 16:53:59 +01:00
|
|
|
// Wait until iframe load
|
|
|
|
iframe.onload = function() {
|
|
|
|
const subdoc = iframe.contentWindow.document;
|
|
|
|
const subBody = subdoc.getElementsByTagName("body")[0]
|
|
|
|
let ansiOutput = subBody;
|
|
|
|
// Depending on the content encoding (and maybe on the browser)
|
|
|
|
// a <pre> is added around the content of the file
|
|
|
|
if (subBody.getElementsByTagName("pre").length > 0) {
|
|
|
|
ansiOutput = subBody.getElementsByTagName("pre")[0];
|
|
|
|
}
|
|
|
|
const ansi_up = new AnsiUp();
|
|
|
|
ansiOutput.innerHTML = ansi_up.ansi_to_html(ansiOutput.innerText);
|
|
|
|
}
|
2024-03-25 10:41:34 +01:00
|
|
|
};
|
2024-03-29 16:53:59 +01:00
|
|
|
|
2024-03-25 10:41:34 +01:00
|
|
|
script.src = "https://cdn.jsdelivr.net/npm/ansi_up@4.0.4/ansi_up.js";
|
|
|
|
document.head.appendChild(script);
|
|
|
|
</script>
|
2024-02-27 11:26:55 +01:00
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|