aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/templates/status/pod.html.j2
blob: d92220670f1fa154df80ce7dd84afcb2a1104d4f (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{% macro container_table(title, containers_list) %}
<div class="container">
  <h1 class="title is-1">{{ title }}</h1>
  <div class="table-container">
    <table class="table is-fullwidth is-striped is-hoverable">
      <thead>
        <tr>
          <th>Name</th>
          <th>Image</th>
          <th>State</th>
          <th>Ready</th>
          <th>Restart Count</th>
        </tr>
      <tbody>
        {% for container in containers_list %}
        <tr>
          <td><a href="./pod-{{ pod.name }}-{{ container.name }}-logs.html" title="{{ pod.name }}-{{ container.name }}-logs">{{ container.name }}</a></td>
          <td>{{ container.image }}</td>
          <td>{{ container.status }}</td>
          <td>{{ container.ready }}</td>
          <td>{{ container.restart_count }}</td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endmacro %}

{% extends "base.html.j2" %}
{% block title %}Pod {{ pod.name }}{% endblock %}
{% block content %}
    {{ two_level_breadcrumb('Pod', pod.name) | indent(width=4) }}

    {{ summary('Pod', pod.name, [
      {
        'title': 'Init containers',
        'failing': ((pod.init_containers | length) - pod.runned_init_containers),
        'total': (pod.init_containers | length)
      },
      {
        'title': 'Containers',
        'failing': ((pod.containers | length) - pod.running_containers),
        'total': (pod.containers | length)
      }])
    }}

    <section class="section">
      {{ description(pod.k8s) | indent(width=6) }}

      {% if (pod.init_containers | length) > 0 %}
      {{ container_table("Init Containers", pod.init_containers) | indent(width=6) }}
      {% endif %}


      {% if (pod.containers | length) > 0 %}
      {{ container_table("Containers", pod.containers) | indent(width=8) }}
      {% endif %}

      {% if pod.k8s.spec.volumes %}
      <div class="container">
        <h1 class="title is-1">Volumes</h1>
        <div class="table-container">
          <table class="table is-fullwidth is-striped is-hoverable">
            <thead>
              <tr>
                <th>Name</th>
                <th>Type</th>
                <th>Properties</th>
              </tr>
            </thead>
            <tbody>
            {% for volume_name, volume in pod.volumes.items() %}
            {%   for volume_type, details in volume.items() %}
              <tr>
                <td>{{ volume_name }}</td>
                <td>{{ volume_type }}</td>
                <td>
                  <table class="table is-narrow">
                    <tbody>
                    {% for key, value in details.items() %}
                      <tr>
                        <th>{{ key }}</th>
                        <td>{{ value }}</td>
                      </tr>
                    {% endfor %}
                    </tbody>
                  </table>
                </td>
              </tr>
            {%   endfor %}
            {% endfor %}
            </tbody>
          </table>
       </div>
      </div>
      {% endif %}

      {{ events(pod.events) }}
    </section>
{% endblock %}