trying to get admin tools in place

This commit is contained in:
2021-12-09 14:38:17 -06:00
parent fd0d112834
commit 2ce638ab29
5 changed files with 201 additions and 112 deletions

View File

@ -36,29 +36,98 @@
<hr/>
{% endfor %}
<div class="row">
<h1>db_vms_by_host_and_network</h1>
</div>
<div class="row">
<pre>
{{db_vms_by_host_and_network}}
</pre>
</div>
<div class="row">
<h1>virt_vms_by_host_and_network</h1>
</div>
<div class="row">
<pre>
{{virt_vms_by_host_and_network}}
</pre>
</div>
</div>
{% if in_db_but_not_in_virt|length > 0 %}
<div class="third-margin">
<h1>🚨 in the database but not in the virtualization model 🚨</h1>
{% for vm in in_db_but_not_in_virt %}
<div class="row">
{{vm['id']}} {{vm['public_ipv4']}}
</div>
{% endfor %}
<hr/>
</div>
{% endif %}
{% if state_not_equal_to_desired_state|length > 0 %}
<div class="third-margin">
<h1>😴 vm state != desired state 😴</h1>
{% for vm in state_not_equal_to_desired_state %}
<div class="row">
<div>{{vm['id']}}: state={{vm['state']}} desired_state={{vm['desired_state']}}</div>
<form method="post">
<input type="hidden" name="action" value="set_state"></input>
<input type="hidden" name="id" value="{{vm['id']}}"></input>
<input type="hidden" name="state" value="{{vm['desired_state']}}"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="submit" value="🚦 START/STOP"/>
</form>
</div>
{% endfor %}
<hr/>
</div>
{% endif %}
{% if stole_someone_elses_ip_and_own_ip_avaliable|length > 0 %}
<div class="third-margin">
<h1>👻 stole someone elses ip and own desired ip is avaliable 👻</h1>
{% for vm in stole_someone_elses_ip_and_own_ip_avaliable %}
<div class="row">
<div>{{vm['id']}}: current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
<form method="post">
<input type="hidden" name="action" value="dhcp_reset"></input>
<input type="hidden" name="id" value="{{vm['id']}}"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="submit" value="🔨 DHCP RESET"/>
</form>
</div>
{% endfor %}
<hr/>
</div>
{% endif %}
{% if has_wrong_ip|length > 0 %}
<div class="third-margin">
<h1>🥴 has wrong ip address 🥴</h1>
{% for vm in has_wrong_ip %}
<div class="row">
<div>{{vm['id']}}: current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
<form method="post">
<input type="hidden" name="action" value="dhcp_reset"></input>
<input type="hidden" name="id" value="{{vm['id']}}"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="submit" value="🔨 DHCP RESET"/>
</form>
</div>
{% endfor %}
<hr/>
</div>
{% endif %}
{% if stole_someone_elses_ip_but_own_ip_also_stolen|length > 0 %}
<div class="third-margin">
<h1>💀 stole someone elses ip but own desired ip was also stolen 💀</h1>
{% for vm in stole_someone_elses_ip_but_own_ip_also_stolen %}
<div class="row">
<div>{{vm['id']}}: current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
<form method="post">
<input type="hidden" name="action" value="stop_and_expire"></input>
<input type="hidden" name="id" value="{{vm['id']}}"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="submit" value="🛑 STOP AND EXPIRE DHCP LEASE"/>
</form>
</div>
{% endfor %}
<hr/>
</div>
{% endif %}
<div class="third-margin">
<div class="row">
<h1>📢 Admin Megaphone: Email All Users With Active Capsuls 📢</h1>
@ -74,6 +143,7 @@
</div>
</div>
{% endblock %}
{% block pagesource %}/templates/admin.html{% endblock %}