capsul-flask/capsulflask/templates/admin.html

196 lines
6.0 KiB
HTML
Raw Permalink Normal View History

{% extends 'base.html' %}
{% block title %}Capsul Admin{% endblock %}
{% block content %}
<style nonce="{{csp_inline_style_nonce}}">
{{inline_style}}
</style>
<div class="row third-margin">
<h1>Capsul Admin</h1>
</div>
<div class="third-margin">
{% for display_host in display_hosts %}
<div class="row">
<h1>{{ display_host["name"] }}</h1>
</div>
{% for network in display_host["networks"] %}
<div class="row network-row">
<i>{{ network["network_name"] }}</i>
<span>{{ network["public_ipv4_cidr_block"] }}</span>
<div class="network-display">
{% for allocation in network["allocations"] %}
{# This outer div is used as an abs position container & selected by CSS so don't remove it pls. #}
<div>
<div class="{{allocation}}">
</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
<hr/>
{% endfor %}
2021-12-09 20:38:17 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% if in_db_but_not_in_virt|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
2021-12-09 20:38:17 +00:00
<h1>🚨 in the database but not in the virtualization model 🚨</h1>
2021-12-09 20:41:25 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% for vm in in_db_but_not_in_virt %}
<div class="row">
{{vm['id']}} ({{vm['email']}}) {{vm['public_ipv4']}}
</div>
2021-12-09 20:38:17 +00:00
{% endfor %}
<hr/>
{% endif %}
{% if state_not_equal_to_desired_state|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
2021-12-09 20:38:17 +00:00
<h1>😴 vm state != desired state 😴</h1>
2021-12-09 20:41:25 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% for vm in state_not_equal_to_desired_state %}
<div class="row">
<div>{{vm['id']}} ({{vm['email']}}): state={{vm['state']}} desired_state={{vm['desired_state']}}</div>
2021-12-09 20:38:17 +00:00
<form method="post">
<input type="hidden" name="action" value="start_or_stop"></input>
2021-12-09 20:38:17 +00:00
<input type="hidden" name="id" value="{{vm['id']}}"></input>
<input type="hidden" name="desired_state" value="{{vm['desired_state']}}"></input>
2021-12-09 20:38:17 +00:00
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="submit" value="🚦 START/STOP"/>
</form>
</div>
2021-12-09 20:38:17 +00:00
{% endfor %}
<hr/>
{% endif %}
2021-12-09 20:38:17 +00:00
{% if has_no_desired_ip_address|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
<h1>🐣 has no desired ip address 🐣</h1>
</div>
{% for vm in has_no_desired_ip_address %}
<div class="row">
{{vm['id']}} ({{vm['email']}})
</div>
{% endfor %}
<hr/>
{% endif %}
{% if has_not_aquired_ip_address_yet|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
<h1>🏃 hasn't aquired an ip address yet 🏃</h1>
</div>
{% for vm in has_not_aquired_ip_address_yet %}
<div class="row">
{{vm['id']}} ({{vm['email']}}) desired_ipv4={{vm['public_ipv4']}}
</div>
{% endfor %}
<hr/>
{% endif %}
2021-12-09 20:38:17 +00:00
{% if stole_someone_elses_ip_and_own_ip_avaliable|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
2021-12-09 20:38:17 +00:00
<h1>👻 stole someone elses ip and own desired ip is avaliable 👻</h1>
2021-12-09 20:41:25 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% for vm in stole_someone_elses_ip_and_own_ip_avaliable %}
<div class="row">
<div>{{vm['id']}} ({{vm['email']}}): current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
2021-12-09 20:38:17 +00:00
<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>
2021-12-09 20:38:17 +00:00
{% endfor %}
<hr/>
{% endif %}
{% if has_wrong_ip|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
2021-12-09 20:38:17 +00:00
<h1>🥴 has wrong ip address 🥴</h1>
2021-12-09 20:41:25 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% for vm in has_wrong_ip %}
<div class="row">
<div>{{vm['id']}} ({{vm['email']}}): current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
2021-12-09 20:38:17 +00:00
<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>
2021-12-09 20:38:17 +00:00
{% endfor %}
<hr/>
{% endif %}
2021-12-09 20:38:17 +00:00
{% if stole_someone_elses_ip_but_own_ip_also_stolen|length > 0 %}
2021-12-09 21:12:48 +00:00
<div class="row third-margin">
2021-12-09 20:38:17 +00:00
<h1>💀 stole someone elses ip but own desired ip was also stolen 💀</h1>
2021-12-09 20:41:25 +00:00
</div>
2021-12-09 20:38:17 +00:00
{% for vm in stole_someone_elses_ip_but_own_ip_also_stolen %}
<div class="row">
<div>{{vm['id']}} ({{vm['email']}}): current_ipv4={{vm['current_ipv4']}} desired_ipv4={{vm['desired_ipv4']}}</div>
2021-12-09 20:38:17 +00:00
<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/>
{% endif %}
2022-04-11 19:42:47 +00:00
<div class="third-margin">
<div class="row">
<h1>📰 Sitewide Banner: Post a temporary message across the site 📰</h1>
</div>
<div class="row">
<form method="post" class="megaphone">
<input type="hidden" name="action" value="set_broadcast_message"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
<input type="text" name="message" placeholder="blahblahblah..." />
<input type="submit" value="SET"/>
</form>
</div>
<div class="third-margin">
<div class="row">
2022-08-05 01:24:13 +00:00
<h1>📢 Admin Megaphone: Email capsul users 📢</h1>
</div>
<div class="row">
<form method="post" class="megaphone">
<input type="hidden" name="action" value="megaphone"></input>
<input type="hidden" name="csrf-token" value="{{ csrf_token }}"/>
2022-08-05 01:24:13 +00:00
<div class="row">
<label for="bcc">bcc</label>
<input type="text" id="bcc" name="bcc" placeholder="list of email addresses (or leave empty for all users)" />
</div>
<div class="row">
<label for="subject">subject</label>
<input type="text" id="subject" name="subject" placeholder="Capsul Maintenance blahblahblah" />
</div>
<textarea name="body" placeholder="Hello, ..."></textarea>
<input type="submit" value="SEND"/>
</form>
</div>
</div>
2021-12-09 20:38:17 +00:00
{% endblock %}
{% block pagesource %}/templates/admin.html{% endblock %}