summaryrefslogtreecommitdiff
path: root/web/kbn_templates
diff options
context:
space:
mode:
Diffstat (limited to 'web/kbn_templates')
-rw-r--r--web/kbn_templates/base.html25
-rw-r--r--web/kbn_templates/base.j244
-rw-r--r--web/kbn_templates/index.j2 (renamed from web/kbn_templates/index.html)14
-rw-r--r--web/kbn_templates/loading.j214
-rw-r--r--web/kbn_templates/modems.j212
5 files changed, 77 insertions, 32 deletions
diff --git a/web/kbn_templates/base.html b/web/kbn_templates/base.html
deleted file mode 100644
index 43f7d2a..0000000
--- a/web/kbn_templates/base.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>{{ title }}</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <script>
- window.onerror = function(error) {
- window.console && console.error(error);
- }
- </script>
- {{ head_static | safe }}
-</head>
-<body>
-<div class="container py-3">
-
-{% block content %} {% endblock %}
-
-{% if js %}
-<script>{{ js|raw }}</script>
-{% endif %}
-
-</div>
-</body>
-</html>
diff --git a/web/kbn_templates/base.j2 b/web/kbn_templates/base.j2
new file mode 100644
index 0000000..d43a08b
--- /dev/null
+++ b/web/kbn_templates/base.j2
@@ -0,0 +1,44 @@
+{% macro breadcrumbs(history) %}
+ <nav aria-label="breadcrumb">
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item"><a href="main.cgi">Главная</a></li>
+ {% for item in history %}
+ <li class="breadcrumb-item"{% if loop.last %} aria-current="page"{% endif %}>
+ {% if item.link %}<a href="{{ item.link }}">{% endif %}
+ {% if item.html %}
+ {% raw %}{{ item.html }}{% endraw %}
+ {% else %}
+ {{ item.text }}
+ {% endif %}
+ {% if item.link %}</a>{% endif %}
+ </li>
+ {% endfor %}
+ </ol>
+ </nav>
+{% endmacro %}
+
+<!doctype html>
+<html>
+<head>
+ <title>{{ title }}</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+ <script>
+ window.onerror = function(error) {
+ window.console && console.error(error);
+ }
+ </script>
+ {{ head_static | safe }}
+</head>
+<body>
+<div class="container py-3">
+
+{% block content %}{% endblock %}
+
+{% if js %}
+<script>{{ js|raw }}</script>
+{% endif %}
+
+</div>
+</body>
+</html>
diff --git a/web/kbn_templates/index.html b/web/kbn_templates/index.j2
index 1921b87..e3ab421 100644
--- a/web/kbn_templates/index.html
+++ b/web/kbn_templates/index.j2
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "base.j2" %}
{% block content %}
<div class="container py-4">
@@ -16,16 +16,16 @@
<h6>Интернет</h6>
<ul class="list-group list-group-flush">
- <li class="list-group-item"><a href="/modem/">Модемы</a></li>
- <li class="list-group-item"><a href="/routing/">Маршрутизация</a></li>
- <li class="list-group-item"><a href="/sms/">SMS-сообщения</a></li>
+ <li class="list-group-item"><a href="/modems.cgi">Модемы</a></li>
+ <li class="list-group-item"><a href="/routing.cgi">Маршрутизация</a></li>
+ <li class="list-group-item"><a href="/sms.cgi">SMS-сообщения</a></li>
</ul>
<h6 class="mt-4">Другое</h6>
<ul class="list-group list-group-flush">
- <li class="list-group-item"><a href="/inverter/">Инвертор</a> (<a href="{{ grafana_inverter_url }}">Grafana</a>)</li>
- <li class="list-group-item"><a href="/pump/">Насос</a></li>
- <li class="list-group-item"><a href="/sensors/">Датчики</a> (<a href="{{ grafana_sensors_url }}">Grafana</a>)</li>
+ <li class="list-group-item"><a href="/inverter.cgi">Инвертор</a> (<a href="{{ grafana_inverter_url }}">Grafana</a>)</li>
+ <li class="list-group-item"><a href="/pump.cgi">Насос</a></li>
+ <li class="list-group-item"><a href="/sensors.cgi">Датчики</a> (<a href="{{ grafana_sensors_url }}">Grafana</a>)</li>
</ul>
<h6 class="mt-4"><a href="/cams/"><b>Все камеры</b></a> (<a href="/cams/?high=1">HQ</a>)</h6>
diff --git a/web/kbn_templates/loading.j2 b/web/kbn_templates/loading.j2
new file mode 100644
index 0000000..d064a48
--- /dev/null
+++ b/web/kbn_templates/loading.j2
@@ -0,0 +1,14 @@
+<div class="sk-fading-circle">
+ <div class="sk-circle1 sk-circle"></div>
+ <div class="sk-circle2 sk-circle"></div>
+ <div class="sk-circle3 sk-circle"></div>
+ <div class="sk-circle4 sk-circle"></div>
+ <div class="sk-circle5 sk-circle"></div>
+ <div class="sk-circle6 sk-circle"></div>
+ <div class="sk-circle7 sk-circle"></div>
+ <div class="sk-circle8 sk-circle"></div>
+ <div class="sk-circle9 sk-circle"></div>
+ <div class="sk-circle10 sk-circle"></div>
+ <div class="sk-circle11 sk-circle"></div>
+ <div class="sk-circle12 sk-circle"></div>
+</div> \ No newline at end of file
diff --git a/web/kbn_templates/modems.j2 b/web/kbn_templates/modems.j2
new file mode 100644
index 0000000..f148140
--- /dev/null
+++ b/web/kbn_templates/modems.j2
@@ -0,0 +1,12 @@
+{% extends "base.j2" %}
+
+{% block content %}
+{{ breadcrumbs([{'text': 'Модемы'}]) }}
+
+{% for modem in modems %}
+<h6 class="text-primary{% if not loop.first %} mt-4{% endif %}">{{ modems.getfullname(modem) }}</h6>
+<div id="modem_data_{{ modem }}">
+ {% include "loading.j2" %}
+</div>
+{% endfor %}
+{% endblock %} \ No newline at end of file