Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions luci-wrtbwmon/htdocs/luci-static/wrtbwmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ var wrt = {
*/
function receiveData(once) {
var ajax = new XMLHttpRequest();
var upd_time_el = document.getElementById('updated');
ajax.onreadystatechange = function () {
// noinspection EqualityComparisonWithCoercionJS
if (this.readyState == 4 && this.status == 200) {
Expand All @@ -434,7 +435,9 @@ var wrt = {
oldValues = v;
// set old date
oldDate = new Date();
document.getElementById('updated').innerHTML = 'Last updated ' + dateToString(oldDate);

upd_time_el.innerHTML = dateToString(oldDate)
upd_time_el.parentElement.style.display = "inline";
}
}
var int = wrt.interval;
Expand Down Expand Up @@ -511,15 +514,16 @@ var wrt = {
* @param msg
*/
function setUpdateMessage(msg) {
document.getElementById('updating').innerHTML = msg;
document.getElementById('updating').style = (msg === '') ? 'none': 'inline';
document.getElementById('updating-time').innerHTML = msg;
}

/**
* Updates the 'Updating in X seconds' message
* @param start
*/
function updateSeconds(start) {
setUpdateMessage('Updating again in <b>' + start + '</b> seconds.');
setUpdateMessage(+start);
if (start > 0) {
wrt.updateTimeout = window.setTimeout(function () {
updateSeconds(start - 1);
Expand Down Expand Up @@ -559,4 +563,4 @@ var wrt = {
receiveData();
});

})();
})();
10 changes: 5 additions & 5 deletions luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local m = Map("wrtbwmon", "Usage - Configuration")
local m = Map("wrtbwmon", translate("Usage - Configuration"))

local s = m:section(NamedSection, "general", "wrtbwmon", "General settings")
local s = m:section(NamedSection, "general", "wrtbwmon", translate("General settings"))

local o = s:option(Flag, "persist", "Persist database",
"Check this to persist the database file under /etc/config. "
.. "This ensures usage is persisted even across firmware updates.")
local o = s:option(Flag, "persist", translate("Persist database"),
translate("Check this to persist the database file under /etc/config. "
.. "This ensures usage is persisted even across firmware updates."))
o.rmempty = false

function o.write(self, section, value)
Expand Down
8 changes: 4 additions & 4 deletions luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ local USER_FILE_PATH = "/etc/wrtbwmon.user"

local fs = require "nixio.fs"

local f = SimpleForm("wrtbwmon",
"Usage - Custom User File",
"This file is used to match users with MAC addresses."
.. "Each line must have the following format: \"00:aa:bb:cc:ee:ff,username\".")
local f = SimpleForm("wrtbwmon",
translate("Usage - Custom User File"),
translate("This file is used to match users with MAC addresses."
.. "Each line must have the following format: \"00:aa:bb:cc:ee:ff,username\"."))

local o = f:field(Value, "_custom")

Expand Down
17 changes: 10 additions & 7 deletions luci-wrtbwmon/luasrc/view/wrtbwmon.htm
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<%+header%>
<h2>Usage - Details</h2>
<h2><%:Usage - Details%></h2>
<p style="position:relative;">
<button id="resetDatabase" class="cbi-button" style="position:absolute;right:0;bottom:0;">Reset Database</button>
<button id="resetDatabase" class="cbi-button cbi-button-remove" style="position:absolute;right:0;bottom:0;height:28px;"><%:Reset Database%></button>
</p>
<p>
<small><span id="updated"></span> <span id="updating"></span></small>
<small style="display: none"><%:Last updated %>
<span id="updated"></span>
<span id="updating"> <%:Updating again in %><b id="updating-time"></b> <%:seconds.%></span>
</small>
<span style="float:right;text-align:right;">
<label>
<small>Auto update every</small>
<small><%:Auto update every%></small>
<select id="intervalSelect" style="width:90px;height:20px;font-size:11px;">
<option value="-1">Disabled</option>
<option value="1">1 second</option>
Expand All @@ -29,17 +32,17 @@ <h2>Usage - Details</h2>
</label>
<br/>
<label>
<small>Calculate per host totals</small>
<small><%:Calculate per host totals%></small>
<input id="perHostTotals" type="checkbox" style="vertical-align:middle;"/>
</label>
<!-- label>
<small>Show per host aggregates only</small>
<small><%:Show per host aggregates only%></small>
<input id="showPerHostTotalsOnly" type="checkbox"/>
</label -->
</span>
</p>
<table class="table">
<tbody id="tableBody"><tr><td>Loading...</td></tr></tbody>
<tbody id="tableBody"><tr><td><%:Loading...%></td></tr></tbody>
</table>
<!--suppress HtmlUnknownTarget -->
<script src="/luci-static/wrtbwmon.js"></script>
Expand Down
95 changes: 95 additions & 0 deletions luci-wrtbwmon/po/ru/wrtbwmon.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: LuCI: wrtbwmon\n"
"POT-Creation-Date: 2019-02-19 21:00+0300\n"
"PO-Revision-Date: 2019-02-23 00:09+0300\n"
"Last-Translator: Marshak Igor aka !Joy! <videomiv@ukr.net>\n"
"Language-Team: !Joy!\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Project-Info: Перевод на русский утилиты wrtbwmon"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:13
msgid "Auto update every"
msgstr "Обновление каждые"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:35
msgid "Calculate per host totals"
msgstr "Суммировать данные одного и того же MAC-адреса."

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:39
msgid "Show per host aggregates only"
msgstr "Отображать только агрегированные данные"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:7
msgid "Last updated"
msgstr "Последнее обновление "

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:8
msgid "Updating again in"
msgstr "Следующее обновление через "

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:8
msgid "seconds."
msgstr "сек."

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:6
msgid ""
"Check this to persist the database file under /etc/config. This ensures "
"usage is persisted even across firmware updates."
msgstr ""
"Установите чекбокс, чтобы сохранить файл базы данных в /etc/config. Это "
"гарантирует, что статистика сохранится даже при обновлении прошивки."

#: applications/luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:5
msgid "Details"
msgstr "Обзор"

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:3
msgid "General settings"
msgstr "Основные настройки"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:45
msgid "Loading..."
msgstr "Загрузка данных..."

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:5
msgid "Persist database"
msgstr "Постоянная база данных"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:4
msgid "Reset Database"
msgstr "Очистить Базу Данных"

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/custom.lua:7
msgid ""
"This file is used to match users with MAC addresses.Each line must have the "
"following format: \"00:aa:bb:cc:ee:ff,username\"."
msgstr ""
"Этот файл используется для сопоставления пользователей с MAC-адресами. "
"Каждая строка списка, должна быть в таком формате: \"00:aa:bb:cc:ee:ff,"
"username\"."

#: applications/luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:4
msgid "Usage"
msgstr "Статистика клиентов"

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:1
msgid "Usage - Configuration"
msgstr "Статистика клиентов - Настройки"

#: applications/luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/custom.lua:6
msgid "Usage - Custom User File"
msgstr "Статистика клиентов - Файл пользователей"

#: applications/luci-wrtbwmon/luasrc/view/wrtbwmon.htm:2
msgid "Usage - Details"
msgstr "Статистика клиентов - Обзор"

#: applications/luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:7
msgid "User file"
msgstr "Файл пользователей"
78 changes: 78 additions & 0 deletions luci-wrtbwmon/po/templates/wrtbwmon.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:13
msgid "Auto update every"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:35
msgid "Calculate per host totals"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:39
msgid "Show per host aggregates only"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:7
msgid "Last updated"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:8
msgid "Updating again in"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:8
msgid "seconds."
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:6
msgid ""
"Check this to persist the database file under /etc/config. This ensures "
"usage is persisted even across firmware updates."
msgstr ""

#: luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:5
msgid "Details"
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:3
msgid "General settings"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:45
msgid "Loading..."
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:5
msgid "Persist database"
msgstr "Постоянная база данных"

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:4
msgid "Reset Database"
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/custom.lua:7
msgid ""
"This file is used to match users with MAC addresses.Each line must have the "
"following format: \"00:aa:bb:cc:ee:ff,username\"."
msgstr ""

#: luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:4
msgid "Usage"
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/config.lua:1
msgid "Usage - Configuration"
msgstr ""

#: luci-wrtbwmon/luasrc/model/cbi/wrtbwmon/custom.lua:6
msgid "Usage - Custom User File"
msgstr ""

#: luci-wrtbwmon/luasrc/view/wrtbwmon.htm:2
msgid "Usage - Details"
msgstr ""

#: luci-wrtbwmon/luasrc/controller/wrtbwmon.lua:7
msgid "User file"
msgstr ""