diff options
Diffstat (limited to 'web/kbn_templates')
-rw-r--r-- | web/kbn_templates/index.j2 | 4 | ||||
-rw-r--r-- | web/kbn_templates/sms.j2 | 63 |
2 files changed, 65 insertions, 2 deletions
diff --git a/web/kbn_templates/index.j2 b/web/kbn_templates/index.j2 index e3ab421..c356326 100644 --- a/web/kbn_templates/index.j2 +++ b/web/kbn_templates/index.j2 @@ -23,9 +23,9 @@ <h6 class="mt-4">Другое</h6> <ul class="list-group list-group-flush"> - <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="/inverter.cgi">Инвертор</a> (<a href="{{ inverter_grafana_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> + <li class="list-group-item"><a href="/sensors.cgi">Датчики</a> (<a href="{{ sensors_grafana_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/sms.j2 b/web/kbn_templates/sms.j2 new file mode 100644 index 0000000..6de9d42 --- /dev/null +++ b/web/kbn_templates/sms.j2 @@ -0,0 +1,63 @@ +{% extends "base.j2" %} + +{% block content %} +{{ breadcrumbs([{'text': 'SMS-сообщения'}]) }} + +<nav> + <div class="nav nav-tabs" id="nav-tab"> + {% for modem in modems.keys() %} + {% if selected_modem != modem %}<a href="/sms.cgi?id={{ modem }}" class="text-decoration-none">{% endif %} + <button class="nav-link{% if modem == selected_modem %} active{% endif %}" type="button">{{ modems.getshortname(modem) }}</button> + {% if selected_modem != modem %}</a>{% endif %} + {% endfor %} + </div> +</nav> + +<h6 class="text-primary mt-4">Отправить SMS</h6> + +{% if is_sent %} + <div class="alert alert-success" role="alert"> + Сообщение отправлено. + </div> +{% elif error %} + <div class="alert alert-danger" role="alert"> + {{ error }} + </div> +{% endif %} + +<div> + <form method="post" action="/sms.cgi"> + <input type="hidden" name="modem" value="{{ selected_modem }}"> + <div class="form-floating mb-3"> + <input type="text" name="phone" class="form-control" id="inputPhone" placeholder="+7911xxxyyzz"> + <label for="inputPhone">Телефон</label> + </div> + <div class="form-floating"> + <textarea class="form-control" id="inputTA" name="text" placeholder="Hello world" style="height: 100px"></textarea> + <label for="inputTA">Текст сообщения</label> + </div> + <div class="mt-3"> + <button type="submit" class="btn btn-primary">Отправить</button> + </div> + </form> +</div> + +<h6 class="text-primary mt-4"> + Последние + {% if not is_outbox %} + <b>входящие</b> <span class="text-black-50">|</span> <a href="/sms.cgi?id={{ selected_modem }}&outbox=1">исходящие</a> + {% else %} + <a href="/sms.cgi?id={{ selected_modem }}">входящие</a> <span class="text-black-50">|</span> <b>исходящие</b> + {% endif %} +</h6> + +{% for m in messages %} + <div class="mt-3"> + <b>{{ m.Phone }}</b> <span class="text-secondary">({{ m.Date }})</span><br/> + {{ m.Content }} + </div> +{% else %} + <span class="text-secondary">Сообщений нет.</span> +{% endfor %} + +{% endblock %}
\ No newline at end of file |