~forest/capsul-flask

capsul-flask/capsulflask/templates/capsuls.html -rw-r--r-- 2.0 KiB
f3630fbaforest account-balance cli command 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{% extends 'base.html' %}

{% block title %}Capsuls{% endblock %}

{% block custom_flash %}
{% if created  %} 
  <div class="flash green">{{ created }} successfully created!</div>
{% endif %}
{% endblock %}

{% block content %}
<div class="row third-margin">
  <h1>Capsuls</h1>
</div>
<div class="third-margin">
  {% if has_vms %} 
  <div class="row third-margin justify-end">
    <a href="/console/create">Create Capsul</a>
  </div>
  <div class="row">
    <table>
      <thead>
        <tr>
          <th class="heart-icon"></th>
          <th>id</th>
          <th>size</th>
          <th>cpu</th>
          <th>mem</th>
          <th>ipv4</th>
          <th>os</th>
          <th>created</th>
        </tr>
      </thead>
      <tbody>
        {% for vm in vms %}
          <tr>
            {% if vm['state'] == 'starting' or vm['state'] == 'stopping'  %}
              <td class="capsul-status waiting-pulse"></td>
            {% elif vm['state'] == 'crashed' or vm['state'] == 'blocked' or vm['state'] == 'stopped'  %}
              <td class="capsul-status red"></td>
            {% elif vm['state'] == 'unknown' %}
              <td class="capsul-status-questionmark">?</td>
            {% else  %}
              <td class="capsul-status green"></td>
            {% endif  %}
            
            <td><a class="no-shadow" 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 %} 
  <div class="row">
    <p>You don't have any Capsuls running. <a href="/console/create">Create one</a> today!</p>
  </div>
  {% endif %}
</div>
{% endblock %}

{% block pagesource %}/templates/capsuls.html{% endblock %}