aboutsummaryrefslogtreecommitdiffstats
path: root/templates/services.jinja
blob: 9ea1d3f605be08cdceda77e35dcb8536f1eafe3b (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
102
103
104
105
106
107
108
109
110
111
112
113
{% extends "template.html" %}
{% block content %}
<article id=statusTables>
    <section id=docker>
        <h2>docker</h2>
        {% if docker == None %}
            <p>Couldn't access the docker API. Is sherpa running?</p>
        {% else %}
            <table>
                {% for name, status in docker.items() %}
                    <tr>
                        <td>{{name}}</td>
                        {% if status == "running" %}
                            <td class=running>{{status}}</td>
                        {% else %}
                            <td class=notRunning>{{status}}</td>
                        {% endif %}
                    </tr>
                {% endfor %}
            </table>
        {% endif %}
    </section>
    <section id="torrents">
        <h2>qbittorrent</h2>
        {% if qbit == None %}
            <p>Couldn't access the qbittorrent API. Is docker container running?</p>
        {% else %}
            <table>
                <tr>
                    <td>downloaded</td>
                    <td>{{qbit["bytes_dl"]}}</td>
                </tr>
                <tr>
                    <td>uploaded</td>
                    <td>{{qbit["bytes_up"]}}</td>
                </tr>
                <tr>
                    <td>torrents</td>
                    <td>{{qbit["num"]}}</td>
                </tr>
                <tr>
                    <td>ratio</td>
                    <td>{{qbit["ratio"]}}</td>
                </tr>
            </table>
        {% endif %}
        <h2>transmission</h2>
        {% if trans == None %}
            <p>Couldn't access the transmission API. Is docker container running?</p>
        {% else %}
            <table>
                <tr>
                    <td>downloaded</td>
                    <td>{{trans["bytes_dl"]}}</td>
                </tr>
                <tr>
                    <td>uploaded</td>
                    <td>{{trans["bytes_up"]}}</td>
                </tr>
                <tr>
                    <td>torrents</td>
                    <td>{{trans["num"]}}</td>
                </tr>
                <tr>
                    <td>ratio</td>
                    <td>{{trans["ratio"]}}</td>
                </tr>
            </table>
        {% endif %}
    </section>
    <section id=pihole>
        <h2>pihole</h2>
        {% if pihole == None %}
            <p>Couldn't access the pihole API. Is docker container running?</p>
        {% else %}
            <table>
                <tr>
                    <td>status</td>
                    {% if pihole["status"] == "enabled" %}
                        <td class=running>{{pihole["status"]}}</td>
                    {% else %}
                        <td class=notRunning>{{pihole["status"]}}</td>
                    {% endif %}
                </tr>
                <tr>
                    <td>queries</td>
                    <td>{{pihole["queries"]}}</td>
                </tr>
                <tr>
                    <td>clients</td>
                    <td>{{pihole["clients"]}}</td>
                </tr>
                <tr>
                    <td>percentage blocked</td>
                    <td>{{pihole["percentage"]}}%</td>
                </tr>
                <tr>
                    <td>blocked requests</td>
                    <td>{{pihole["blocked"]}}</td>
                </tr>
                <tr>
                    <td>domains in blocklist</td>
                    <td>{{pihole["domains"]}}</td>
                </tr>
                <tr>
                    <td>last updated</td>
                    <td>{{pihole["last_updated"]}}</td>
                </tr>
            </table>
        {% endif %}
    </section>
</article>
{% endblock %}