first commit
This commit is contained in:
36
templates/arch/index.html
Normal file
36
templates/arch/index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Select Playbook and arguments
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="ansibleForm">
|
||||
<label for="os">Playbook</label>
|
||||
<select id="playbook" class="form-control" name="playbook" placeholder="Profile" required>
|
||||
{%for file in list %}
|
||||
<option value={{ file }}>{{ file }}</option>
|
||||
{%endfor%}
|
||||
</select><br>
|
||||
<label for="nom">Arguments</label>
|
||||
<input type="text" name="arguments" class="form-control" placeholder="-e "><br>
|
||||
<label for="nom">Hosts</label>
|
||||
<input type="text" name="arguments" class="form-control" placeholder="/path/to/inventory"><br>
|
||||
<button type="submit" class="btn btn-primary"onclick="submitForm()">Executer</button>
|
||||
</form>
|
||||
</div>
|
||||
</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 arguments = document.forms["ansibleForm"]["arguments"].value;
|
||||
|
||||
socket.emit('submit_playbook', { playbook: playbook, hosts: hosts });
|
||||
window.location.href = "/run";
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user