diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-07-18 16:29:20 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-07-18 16:29:20 +0300 |
commit | 9b40fbdd31f9366cf4fba4db04e85aa26e7c8a04 (patch) | |
tree | b5f328c7968a70ed1e0041b1ed67ad543fc2f5c3 /localwebsite/templates-web | |
parent | 36c90356aa291b65661b523e2f79375a72d588b0 (diff) |
lws: sms sending, inbox/outbox view, verbose modem info
Diffstat (limited to 'localwebsite/templates-web')
-rw-r--r-- | localwebsite/templates-web/index.twig | 4 | ||||
-rw-r--r-- | localwebsite/templates-web/modem_data.twig | 20 | ||||
-rw-r--r-- | localwebsite/templates-web/modem_status_page.twig | 3 | ||||
-rw-r--r-- | localwebsite/templates-web/modem_verbose_page.twig | 15 | ||||
-rw-r--r-- | localwebsite/templates-web/sms_page.twig | 40 |
5 files changed, 68 insertions, 14 deletions
diff --git a/localwebsite/templates-web/index.twig b/localwebsite/templates-web/index.twig index 620ad40..4527911 100644 --- a/localwebsite/templates-web/index.twig +++ b/localwebsite/templates-web/index.twig @@ -13,9 +13,9 @@ <h6>Интернет</h6> <ul class="list-group list-group-flush"> - <li class="list-group-item"><a href="/modem/status/">Состояние</a></li> + <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="/modem/sms/">SMS-сообщения</a></li> + <li class="list-group-item"><a href="/sms/">SMS-сообщения</a></li> </ul> <h6 class="mt-4">Другое</h6> diff --git a/localwebsite/templates-web/modem_data.twig b/localwebsite/templates-web/modem_data.twig index 55440ea..a2c00e5 100644 --- a/localwebsite/templates-web/modem_data.twig +++ b/localwebsite/templates-web/modem_data.twig @@ -1,12 +1,14 @@ {% if not loading %} -<span class="text-secondary">Сигнал:</span> {% include 'signal_level.twig' with {'level': modem_data.level} %}<br> -<span class="text-secondary">Тип сети:</span> <b>{{ modem_data.type }}</b><br> -<span class="text-secondary">RSSI:</span> {{ modem_data.rssi }}<br/> -{% if modem_data.sinr %} - <span class="text-secondary">SINR:</span> {{ modem_data.sinr }}<br/> -{% endif %} -<span class="text-secondary">Время соединения:</span> {{ modem_data.connected_time }}<br> -<span class="text-secondary">Принято/передано:</span> {{ modem_data.downloaded }} / {{ modem_data.uploaded }} + <span class="text-secondary">Сигнал:</span> {% include 'signal_level.twig' with {'level': modem_data.level} %}<br> + <span class="text-secondary">Тип сети:</span> <b>{{ modem_data.type }}</b><br> + <span class="text-secondary">RSSI:</span> {{ modem_data.rssi }}<br/> + {% if modem_data.sinr %} + <span class="text-secondary">SINR:</span> {{ modem_data.sinr }}<br/> + {% endif %} + <span class="text-secondary">Время соединения:</span> {{ modem_data.connected_time }}<br> + <span class="text-secondary">Принято/передано:</span> {{ modem_data.downloaded }} / {{ modem_data.uploaded }} + <br> + <a href="/modem/verbose/?modem={{ modem }}">Подробная информация</a> {% else %} -{% include 'spinner.twig' %} + {% include 'spinner.twig' %} {% endif %}
\ No newline at end of file diff --git a/localwebsite/templates-web/modem_status_page.twig b/localwebsite/templates-web/modem_status_page.twig index f2b999b..3f20b86 100644 --- a/localwebsite/templates-web/modem_status_page.twig +++ b/localwebsite/templates-web/modem_status_page.twig @@ -8,7 +8,8 @@ <h6 class="text-primary{% if not loop.first %} mt-4{% endif %}">{{ modem.label }}</h6> <div id="modem_data_{{ modem_key }}"> {% include 'modem_data.twig' with { - loading: true + loading: true, + modem: modem_key } %} </div> {% endfor %} diff --git a/localwebsite/templates-web/modem_verbose_page.twig b/localwebsite/templates-web/modem_verbose_page.twig new file mode 100644 index 0000000..3b4c25e --- /dev/null +++ b/localwebsite/templates-web/modem_verbose_page.twig @@ -0,0 +1,15 @@ +{% include 'bc.twig' with { + history: [ + {link: '/modem/', text: "Модемы" }, + {text: modem_name} + ] +} %} + +{% for item in data %} + {% set item_name = item[0] %} + {% set item_data = item[1] %} + <h6 class="text-primary mt-4">{{ item_name }}</h6> + {% for k, v in item_data %} + {{ k }} = {{ v }}<br> + {% endfor %} +{% endfor %}
\ No newline at end of file diff --git a/localwebsite/templates-web/sms_page.twig b/localwebsite/templates-web/sms_page.twig index f60d223..112fa64 100644 --- a/localwebsite/templates-web/sms_page.twig +++ b/localwebsite/templates-web/sms_page.twig @@ -7,14 +7,50 @@ <nav> <div class="nav nav-tabs" id="nav-tab"> {% for modem in modems_list %} - {% if selected_modem != modem %}<a href="/modem/sms/?modem={{ modem }}" class="text-decoration-none">{% endif %} + {% if selected_modem != modem %}<a href="/sms/?modem={{ modem }}" class="text-decoration-none">{% endif %} <button class="nav-link{% if modem == selected_modem %} active{% endif %}" type="button">{{ modems[modem].short_label }}</button> {% if selected_modem != modem %}</a>{% endif %} {% endfor %} </div> </nav> -<h6 class="text-primary mt-4">Последние входящие</h6> +<h6 class="text-primary mt-4">Отправить SMS</h6> + +{% if is_sent %} + <div class="alert alert-success" role="alert"> + Сообщение отправлено. + </div> +{% elseif error %} + <div class="alert alert-danger" role="alert"> + {{ error }} + </div> +{% endif %} + +<div> + <form method="post" action="/sms/"> + <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/?modem={{ selected_modem }}&outbox=1">исходящие</a> + {% else %} + <a href="/sms/?modem={{ selected_modem }}">входящие</a> <span class="text-black-50">|</span> <b>исходящие</b> + {% endif %} +</h6> {% for m in messages %} <div class="mt-3"> |