metrics are working!!!

This commit is contained in:
2020-05-13 00:28:53 -05:00
parent 7337375ae8
commit 30464ac8e5
25 changed files with 601 additions and 81 deletions

View File

@ -3,7 +3,7 @@
{% block title %}Account Balance{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>Account Balance: ${{ account_balance }}</h1>
</div>
<div class="half-margin">
@ -11,7 +11,7 @@
<div class="row">
{% if has_payments %}
<div>
<div class="third-margin">
<div class="row third-margin">
<h1>Payments</h1>
</div>
@ -52,33 +52,36 @@
{% if has_vms %}
<div class="third-margin">
<div class="row third-margin">
<h1>Capsuls Billed</h1>
</div>
<table class="small">
<thead>
<tr>
<th>id</th>
<th>created</th>
<th>deleted</th>
<th>$/month</th>
<th>months</th>
<th>$ billed</th>
</tr>
</thead>
<tbody>
{% for vm in vms_billed %}
<div class="row">
<table class="small">
<thead>
<tr>
<td>{{ vm["id"] }}</td>
<td>{{ vm["created"] }}</td>
<td>{{ vm["deleted"] }}</td>
<td>${{ vm["dollars_per_month"] }}</td>
<td>{{ vm["months"] }}</td>
<td>${{ vm["dollars"] }}</td>
<th>id</th>
<th>created</th>
<th>deleted</th>
<th>$/month</th>
<th>months</th>
<th>$ billed</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for vm in vms_billed %}
<tr>
<td>{{ vm["id"] }}</td>
<td>{{ vm["created"] }}</td>
<td>{{ vm["deleted"] }}</td>
<td>${{ vm["dollars_per_month"] }}</td>
<td>{{ vm["months"] }}</td>
<td>${{ vm["dollars"] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,38 @@
{% extends 'base.html' %}
{% block title %}Pay with Cryptocurrency{% endblock %}
{% block content %}
<div class="row third-margin">
<h1>Pay with Cryptocurrency</h1>
</div>
<div class="row half-margin">
<form method="POST" action="https://btcpay.cyberia.club/api/v1/invoices">
<input type="hidden" name="storeId" value="FgYNGKEHKm2tBhwejo1zdSQ15DknPWvip2pXLKBv96wc">
<input type="hidden" name="currency" value="USD">
<div class="row">
<label for="btcpay-input-price">$</label>
<input
id="btcpay-input-price"
name="price"
type="number"
min="0"
max="2000"
oninput="event.preventDefault();isNaN(event.target.value) || event.target.value <= 0 ? document.querySelector('#btcpay-input-price').value = 0 : event.target.value"
/>
<input type="image" class="submit" name="submit"
src="https://btcpay.cyberia.club/img/paybutton/pay.svg"
style="width:168px"
alt="Pay with BtcPay"
/>
</div>
</form>
</div>
{% endblock %}
{% block pagesource %}/templates/btcpay.html{% endblock %}

View File

@ -3,10 +3,11 @@
{% block title %}{{ vm['id'] }}{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>{{ vm['id'] }}</h1>
</div>
<div class="half-margin">
<div class="row wrap grid-large third-margin">
<div class="row justify-start">
<label class="align" for="created">Created</label>
<span id=created>{{ vm['created'] }}</span>
@ -47,7 +48,57 @@
<label class="align" for="ssh_public_keys">SSH Public Keys</label>
<a id=ssh_public_keys href="/console/ssh">{{ vm['ssh_public_keys'] }}</a>
</div>
</div>
<div class="row ">
<hr/>
</div>
<div class="row third-margin">
{% for d in durations %}
<a href="/console/{{ vm['id'] }}?duration={{ d }}">
{% if d == duration %}
<span class="code">{{ d }}</span>
{% else %}
{{ d }}
{% endif %}
</a>
{% endfor %}
</div>
<div class="row wrap grid-small justify-end">
<div class="metric">
<h1>cpu</h1>
<a href="/metrics/html/cpu/{{ vm['id'] }}/{{ duration }}">
<img src="/metrics/cpu/{{ vm['id'] }}/{{ duration }}/m"/>
</a>
</div>
<div class="metric">
<h1>memory</h1>
<a href="/metrics/html/memory/{{ vm['id'] }}/{{ duration }}">
<img src="/metrics/memory/{{ vm['id'] }}/{{ duration }}/m"/>
</a>
</div>
<div class="metric">
<h1>network_in</h1>
<a href="/metrics/html/network_in/{{ vm['id'] }}/{{ duration }}">
<img src="/metrics/network_in/{{ vm['id'] }}/{{ duration }}/m"/>
</a>
</div>
<div class="metric">
<h1>network_out</h1>
<a href="/metrics/html/network_out/{{ vm['id'] }}/{{ duration }}">
<img src="/metrics/network_out/{{ vm['id'] }}/{{ duration }}/m"/>
</a>
</div>
<div class="metric">
<h1>disk</h1>
<a href="/metrics/html/disk/{{ vm['id'] }}/{{ duration }}">
<img src="/metrics/disk/{{ vm['id'] }}/{{ duration }}/m"/>
</a>
</div>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Capsuls{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>Capsuls</h1>
</div>
<div class="third-margin">
@ -11,30 +11,37 @@
<div class="row third-margin justify-end">
<a href="/console/create">Create Capsul</a>
</div>
<table>
<thead>
<tr>
<th>id</th>
<th>size</th>
<th>ipv4</th>
<th>os</th>
<th>created</th>
</tr>
</thead>
<tbody>
{% for vm in vms %}
<div class="row">
<table>
<thead>
<tr>
<td><a href="/console/{{ vm['id'] }}">{{ vm["id"] }}</a></td>
<td>{{ vm["size"] }}</td>
<td class="{{ vm['ipv4_status'] }}">{{ vm["ipv4"] }}</td>
<td>{{ vm["os"] }}</td>
<td>{{ vm["created"] }}</td>
<th>id</th>
<th>size</th>
<th>cpu</th>
<th>mem</th>
<th>ipv4</th>
<th>os</th>
<th>created</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for vm in vms %}
<tr>
<td><a href="/console/{{ vm['id'] }}">{{ vm["id"] }}</a></td>
<td>{{ vm["size"] }}</td>
<td class="metrics"><img src="/metrics/cpu/{{ vm['id'] }}/5m/s"/></td>
<td class="metrics"><img src="/metrics/memory/{{ vm['id'] }}/5m/s"/></td>
<td class="{{ vm['ipv4_status'] }}">{{ vm["ipv4"] }}</td>
<td>{{ vm["os"] }}</td>
<td>{{ vm["created"] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
You don't have any Capsuls running. <a href="/console/create">Create one</a> today!
<div class="row">You don't have any Capsuls running. <a href="/console/create">Create one</a> today!</div>
{% endif %}
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Changelog{% endblock %}
{% block content %}
<div class="full-margin"><h1>CHANGELOG</h1></div>
<div class="row full-margin"><h1>CHANGELOG</h1></div>
{% endblock %}
{% block subcontent %}
<p>

View File

@ -3,10 +3,11 @@
{% block title %}Create{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>Create Capsul</h1>
</div>
<div class="third-margin">
<div class="row third-margin"><div>
{% if created_os %}
<p>
Your Capsul was successfully created! You should already see it listed on the
@ -46,7 +47,8 @@
* net is calculated as a per-month average
* all VMs come standard with one public IPv4 addr</pre>
<pre>
Your <a href="/console/account-balance">account balance</a>: ${{ account_balance }}</div>
Your <a href="/console/account-balance">account balance</a>: ${{ account_balance }}
</pre>
<form method="post">
<div class="row justify-start">
@ -79,12 +81,13 @@
<input type="submit" value="Create">
</div>
</form>
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
</div></div>
{% endblock %}
{% block subcontent %}

View File

@ -0,0 +1,31 @@
{% extends 'base.html' %}
{% block title %}{{ vm['id'] }} - {{ metric }} - {{ duration }}{% endblock %}
{% block content %}
<div class="row half-margin">
<h1>{{ vm['id'] }} - {{ metric }} - {{ duration }}</h1>
</div>
<div class="row third-margin">
{% for d in durations %}
<a href="/metrics/html/{{ metric }}/{{ vm['id'] }}/{{ d }}">
{% if d == duration %}
<span class="code">{{ d }}</span>
{% else %}
{{ d }}
{% endif %}
</a>
{% endfor %}
</div>
<div class="row">
<div>
<h1>cpu</h1>
<img src="/metrics/{{ metric }}/{{ vm['id'] }}/{{ duration }}/l"/>
</div>
</div>
{% endblock %}
{% block pagesource %}/templates/display-metric.html{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}FAQ{% endblock %}
{% block content %}
<div class="full-margin"><h1>Frequently Asked Questions</h1></div>
<div class="row full-margin"><h1>Frequently Asked Questions</h1></div>
{% endblock %}
{% block subcontent %}

View File

@ -12,6 +12,7 @@
\ /
`"`
</pre>
<img src="/metrics/cpu/capsul-yi9ffqbjly/5m/l"/>
<span>Simple, fast, private compute by <a href="https://cyberia.club">cyberia.club</a></span>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}check your email{% endblock %}
{% block content %}
<div class="full-margin">Check your email. A login link has been sent to {{ email }}</div>
<div class="row full-margin">Check your email. A login link has been sent to {{ email }}</div>
{% endblock %}
{% block pagesource %}/templates/login-landing.html{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}login{% endblock %}
{% block content %}
<div class="half-margin">
<div class="row half-margin">
<h1>LOGIN</h1>
</div>
<form method="post" class="half-margin">

View File

@ -3,10 +3,10 @@
{% block title %}SSH Public Keys{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>SSH PUBLIC KEYS</h1>
</div>
<div class="third-margin">
<div class="row third-margin"><div>
{% if has_ssh_public_keys %} <hr/> {% endif %}
{% for ssh_public_key in ssh_public_keys %}
@ -51,7 +51,7 @@
<input type="submit" value="Upload">
</div>
</form>
</div>
</div></div>
{% endblock %}
{% block pagesource %}/templates/ssh-public-keys.html{% endblock %}

View File

@ -1,11 +1,11 @@
{% extends 'base.html' %}
{% block title %}Capsuls{% endblock %}
{% block title %}Pay with Stripe{% endblock %}
{% block head %}<script src="https://js.stripe.com/v3/"></script>{% endblock %}
{% block content %}
<div class="third-margin">
<div class="row third-margin">
<h1>PAY WITH STRIPE</h1>
</div>
<div class="row half-margin">

View File

@ -3,10 +3,10 @@
{% block title %}Support{% endblock %}
{% block content %}
<div class="half-margin">
<div class="row half-margin">
<h1>SUPPORT</h1>
</div>
<div class="half-margin">
<div class="row half-margin">
<a href="mailto:support@cyberia.club?subject=Please%20halp!">support@cyberia.club</a>
</div>
{% endblock %}