Merge pull request #1658 from dibdot/travelmate
authorDirk Brenken <dev@brenken.org>
Sat, 3 Mar 2018 07:44:07 +0000 (08:44 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Mar 2018 07:44:07 +0000 (08:44 +0100)
luci-app-travelmate: sync with release 1.1.3

15 files changed:
applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua
applications/luci-app-adblock/po/it/adblock.po
applications/luci-app-adblock/po/ja/adblock.po
applications/luci-app-adblock/po/pt-br/adblock.po
applications/luci-app-adblock/po/ru/adblock.po
applications/luci-app-adblock/po/sv/adblock.po
applications/luci-app-adblock/po/templates/adblock.pot
applications/luci-app-adblock/po/zh-cn/adblock.po
applications/luci-app-adblock/po/zh-tw/adblock.po
applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua
applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
contrib/package/community-profiles/files/etc/config/profile_potsdam
modules/luci-base/luasrc/model/network.lua
modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua

index dc5ab62..aef0a9f 100644 (file)
@@ -251,7 +251,7 @@ e9.rmempty = true
 
 e10 = e:option(Flag, "adb_notify", translate("Email Notification"),
        translate("Send notification emails in case of a processing error or if domain count is &le; 0.<br />")
-       .. translate("Please note: this needs additional 'mstmp' package installation and setup."))
+       .. translate("Please note: this needs additional 'msmtp' package installation and setup."))
 e10.default = e10.disabled
 e10.rmempty = true
 
index 21b717f..88adcc8 100644 (file)
@@ -236,7 +236,7 @@ msgstr ""
 "Per favore modifica questo file direttamente in una sessione al terminale."
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -275,7 +275,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index 5929a2b..60c5a9a 100644 (file)
@@ -256,9 +256,9 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "ターミナル セッションで直接このファイルを編集してください。"
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
-"注意: これには、追加で 'mstmp' のインストールとセットアップが必要です。"
+"注意: これには、追加で 'msmtp' のインストールとセットアップが必要です。"
 
 msgid "Please update your adblock config file to use this package.<br />"
 msgstr ""
@@ -301,7 +301,7 @@ msgstr ""
 "処理エラーまたはドメイン カウントが0以下の場合、メールを送信します。<br />"
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 "ダウンロードの制御とリストの処理を同時並行的に行うダウンロード キューのサイズ"
index aae6562..7eb6e3e 100644 (file)
@@ -229,7 +229,7 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "Por favor edite esse arquivo direto em uma sessão de terminal."
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -267,7 +267,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index 50eb945..6e80e80 100644 (file)
@@ -260,8 +260,8 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "Отредактируйте данный файл, строго в терминале."
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
-msgstr "Внимание: это потребует дополнительной установки пакета 'mstmp'."
+"Please note: this needs additional 'msmtp' package installation and setup."
+msgstr "Внимание: это потребует дополнительной установки пакета 'msmtp'."
 
 msgid "Please update your adblock config file to use this package.<br />"
 msgstr "Обновите config файл Adblock, чтобы использовать этот пакет.<br />"
@@ -303,7 +303,7 @@ msgstr ""
 "&le; 0.<br />"
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 "Значение очереди загрузки для выполнения параллельных загрузок (по умолчанию "
index 4b23e3f..d875a69 100644 (file)
@@ -218,7 +218,7 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "Vänligen redigera den här filen direkt i en terminal-session."
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -256,7 +256,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index 4a65e2d..5a93f8f 100644 (file)
@@ -210,7 +210,7 @@ msgid "Please edit this file directly in a terminal session."
 msgstr ""
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -248,7 +248,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index 3dc4faf..1d7dc2b 100644 (file)
@@ -228,7 +228,7 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "请在终端会话中直接编辑此文件。"
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -266,7 +266,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index d668ebd..da00842 100644 (file)
@@ -228,7 +228,7 @@ msgid "Please edit this file directly in a terminal session."
 msgstr "請在終端會話中直接編輯此檔案。"
 
 msgid ""
-"Please note: this needs additional 'mstmp' package installation and setup."
+"Please note: this needs additional 'msmtp' package installation and setup."
 msgstr ""
 
 msgid "Please update your adblock config file to use this package.<br />"
@@ -266,7 +266,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Size of the download queue to handle downloads & list processing in parallel "
+"Size of the download queue to handle downloads &amp; list processing in parallel "
 "(default '4').<br />"
 msgstr ""
 
index 920dc6a..4b1a070 100644 (file)
@@ -93,7 +93,7 @@ function configCheck()
 
                        local trackingNumber = uci:get("mwan3", iface, "track_ip")
                        overview[iface]["tracking"] = 0
-                       if #trackingNumber > 0 then
+                       if trackingNumber and #trackingNumber > 0 then
                                overview[iface]["tracking"] = #trackingNumber
                                overview[iface]["reliability"] = false
                                local reliabilityNumber = tonumber(uci:get("mwan3", iface, "reliability"))
index 6dc3d12..86b5ac6 100644 (file)
@@ -15,30 +15,27 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
                                for ( var iface in status.interfaces)
                                {
                                        var state = '';
-                                       var css = '';
                                        switch (status.interfaces[iface].status)
                                        {
                                                case 'online':
                                                        state = '<%:Online (tracking active)%>';
-                                                       css = 'wanon';
                                                        break;
                                                case 'notMonitored':
                                                        state = '<%:Online (tracking off)%>';
-                                                       css = 'wanon';
                                                        break;
                                                case 'offline':
                                                        state = '<%:Offline%>';
-                                                       css = 'wanoff';
                                                        break;
                                                default:
                                                        state = '<%:Disabled%>';
-                                                       css = 'wanoff';
                                                        break;
                                        }
                                        statusview += String.format(
-                                               '<span class="%s"><strong>%s</strong><br />%s</span>',
-                                               css,
-                                               iface,
+                                               '<div><strong>Interface: </strong>%s</div>',
+                                               iface
+                                       );
+                                       statusview += String.format(
+                                               '<div><strong>Status: </strong>%s</div></br></br>',
                                                state
                                        );
                                }
@@ -53,36 +50,8 @@ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_
 //]]></script>
 
 <fieldset id="interface_field" class="cbi-section">
-       <legend><%:MWAN Interface Live Status%></legend>
-       <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+       <legend><%:MWAN Interfaces%></legend>
+       <div id="mwan_status_text">
+               <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%>
+       </div>
 </fieldset>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: 1044px;
-  }
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-</style>
index 21e59a8..cb47696 100644 (file)
 </ul>
 
 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
-               function(x, status)
-               {
-                       var legend = document.getElementById('diag-rc-legend');
-                       var statusDiv = document.getElementById('diag-rc-output');
-                       legend.style.display = 'none';
-                       if (status.interfaces)
-                       {
-                               var statusview = '';
-                               for ( var iface in status.interfaces)
-                               {
-                                       var state = '';
-                                       var css = '';
-                                       switch (status.interfaces[iface].status)
-                                       {
-                                               case 'online':
-                                                       state = '<%:Online (tracking active)%>';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'notMonitored':
-                                                       state = '<%:Online (tracking off)%>';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'offline':
-                                                       state = '<%:Offline%>';
-                                                       css = 'wanoff';
-                                                       break;
-                                               default:
-                                                       state = '<%:Disabled%>';
-                                                       css = 'wanoff';
-                                                       break;
-                                       }
-                                       statusview += String.format(
-                                               '<span class="%s"><strong>%s</strong><br />%s</span>',
-                                               css,
-                                               iface,
-                                               state
-                                       );
-                               }
-                               statusDiv.innerHTML = statusview;
-                       }
-                       else
-                       {
-                               statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
-                       }
-               }
-       );
-//]]></script>
 
-<div class="cbi-map">
-       <h2 name="content"><%:MWAN Status - Interface%></h2>
-       <%if not require("luci.sys").init.enabled("mwan3") then%>
-       <div><strong><%:INFO: MWAN not running%></strong></div>
-       <%end%>
-       <fieldset class="cbi-section">
-               <legend id="diag-rc-legend"><%:Collecting data...%></legend>
-               <span id="diag-rc-output">
-                       <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" />
-               </span>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-  #mwan_statuslog_text {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
+<%+mwan/overview_status_interface%>
 
 <%+footer%>
index 9bdb603..6a8f1f1 100644 (file)
@@ -1,7 +1,7 @@
 config 'community' 'profile'
        option 'name' 'Freifunk Potsdam'
        option 'homepage' 'http://potsdam.freifunk.net'
-       option 'ssid' 'Freifunk-Potsdam-XXX-YYY'
+       option 'ssid' 'freifunk-potsdam.de'
        option 'mesh_network' '10.22.0.0/16'
        option 'splash_network' '192.168.22.0/24'
        option 'splash_prefix' '24'
index 9ea8e36..c8ec536 100644 (file)
@@ -543,6 +543,9 @@ end
 function del_network(self, n)
        local r = _uci:delete("network", n)
        if r then
+               _uci:delete_all("luci", "ifstate",
+                       function(s) return (s.interface == n) end)
+
                _uci:delete_all("network", "alias",
                        function(s) return (s.interface == n) end)
 
@@ -998,7 +1001,10 @@ function protocol.ip6addrs(self)
 
        if type(addrs) == "table" then
                for n, addr in ipairs(addrs) do
-                       if type(addr["local-address"]) == "table" then
+                       if type(addr["local-address"]) == "table" and
+                          type(addr["local-address"].mask) == "number" and
+                          type(addr["local-address"].address) == "string"
+                       then
                                rv[#rv+1] = "%s/%d" %{
                                        addr["local-address"].address,
                                        addr["local-address"].mask
index 4fc71ce..8e7a3b0 100644 (file)
@@ -16,6 +16,7 @@ local has_firewall = fs.access("/etc/config/firewall")
 m = Map("network", translate("Interfaces") .. " - " .. arg[1]:upper(), translate("On this page you can configure the network interfaces. You can bridge several interfaces by ticking the \"bridge interfaces\" field and enter the names of several network interfaces separated by spaces. You can also use <abbr title=\"Virtual Local Area Network\">VLAN</abbr> notation <samp>INTERFACE.VLANNR</samp> (<abbr title=\"for example\">e.g.</abbr>: <samp>eth0.1</samp>)."))
 m.redirect = luci.dispatcher.build_url("admin", "network", "network")
 m:chain("wireless")
+m:chain("luci")
 
 if has_firewall then
        m:chain("firewall")
@@ -27,18 +28,52 @@ fw.init(m.uci)
 
 local net = nw:get_network(arg[1])
 
+local function set_ifstate(name, option, value)
+       local found = false
+
+       m.uci:foreach("luci", "ifstate", function (s)
+               if s.interface == name then
+                       m.uci:set("luci", s[".name"], option, value)
+                       found = true
+                       return false
+               end
+       end)
+
+       if not found then
+               local sid = m.uci:add("luci", "ifstate")
+               m.uci:set("luci", sid, "interface", name)
+               m.uci:set("luci", sid, option, value)
+       end
+
+       m.uci:save("luci")
+end
+
+local function get_ifstate(name, option)
+       local val
+
+       m.uci:foreach("luci", "ifstate", function (s)
+               if s.interface == name then
+                       val = m.uci:get("luci", s[".name"], option)
+                       return false
+               end
+       end)
+
+       return val
+end
+
 local function backup_ifnames(is_bridge)
-       if not net:is_floating() and not m:get(net:name(), "_orig_ifname") then
+       if not net:is_floating() and not get_ifstate(net:name(), "ifname") then
                local ifcs = net:get_interfaces() or { net:get_interface() }
                if ifcs then
                        local _, ifn
                        local ifns = { }
                        for _, ifn in ipairs(ifcs) do
-                               ifns[#ifns+1] = ifn:name()
+                               local wif = ifn:get_wifinet()
+                               ifns[#ifns+1] = wif and wif:id() or ifn:name()
                        end
                        if #ifns > 0 then
-                               m:set(net:name(), "_orig_ifname", table.concat(ifns, " "))
-                               m:set(net:name(), "_orig_bridge", tostring(net:is_bridge()))
+                               set_ifstate(net:name(), "ifname", table.concat(ifns, " "))
+                               set_ifstate(net:name(), "bridge", tostring(net:is_bridge()))
                        end
                end
        end
@@ -84,10 +119,10 @@ if m:formvalue("cbid.network.%s._switch" % net:name()) then
                elseif net:is_floating() and not proto:is_floating() then
                        -- if we have backup data, then re-add all orphaned interfaces
                        -- from it and restore the bridge choice
-                       local br = (m:get(net:name(), "_orig_bridge") == "true")
+                       local br = (get_ifstate(net:name(), "bridge") == "true")
                        local ifn
                        local ifns = { }
-                       for ifn in ut.imatch(m:get(net:name(), "_orig_ifname")) do
+                       for ifn in ut.imatch(get_ifstate(net:name(), "ifname")) do
                                ifn = nw:get_interface(ifn)
                                if ifn and not ifn:get_network() then
                                        proto:add_interface(ifn)
@@ -114,9 +149,7 @@ if m:formvalue("cbid.network.%s._switch" % net:name()) then
                for k, v in pairs(m:get(net:name())) do
                        if k:sub(1,1) ~= "." and
                           k ~= "type" and
-                          k ~= "ifname" and
-                          k ~= "_orig_ifname" and
-                          k ~= "_orig_bridge"
+                          k ~= "ifname"
                        then
                                m:del(net:name(), k)
                        end