Ansinterface/templates/base.html

48 lines
2.6 KiB
HTML
Raw Normal View History

2023-12-19 10:32:13 +00:00
<html>
<head>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css"></link>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css"></link>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.1.2/socket.io.js"></script>
<link href="{{url_for('static', filename = 'style.css')}}" rel="stylesheet">
</head>
<body>
2023-12-19 12:48:06 +00:00
<title>Ansinterface</title>
<center><h1 class="display-6">Ansinterface</h1></center>
2023-12-19 10:32:13 +00:00
<div class="container">
2023-12-19 12:48:06 +00:00
<br><br>
2023-12-19 10:32:13 +00:00
{% block content %}{% endblock %}
</div>
<script>
var socket = io.connect('http://' + document.domain + ':' + location.port);
function submitForm() {
var playbook = document.forms["ansibleForm"]["playbook"].value;
var hosts = document.forms["ansibleForm"]["hosts"].value;
var argument = document.forms["ansibleForm"]["argument"].value;
var limitation = document.forms["ansibleForm"]["limitation"].value;
socket.emit('submit_playbook', { playbook: playbook, hosts: hosts, argument: argument, limitation: limitation });
window.location.href = "/run";
}
socket.on('ansible_output', function(data) {
var outputDiv = document.getElementById('output');
outputDiv.innerHTML += data.data + '<br>';
});
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
lineNumbers: true,
mode: 'text/x-perl',
theme: 'abbott',
});
</script>
</body>
</html>