Merge pull request #3929 from PolynomialDivision/fix/stop_adding_config_files
authorDirk Brenken <dev@brenken.org>
Sun, 19 Apr 2020 08:46:26 +0000 (10:46 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Apr 2020 08:46:26 +0000 (10:46 +0200)
luci-app-dawn: stop adding not used config files

1  2 
applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua

index 29bcb2f1126fb41930a60a60c65c90e2e978828b,eb3ddb31ec9321b3706023e885acc1ba07aade6d..844fa72c430be387846e3ed2172fcb273a225c1e
@@@ -1,4 -1,4 +1,4 @@@
- m = Map("Hearing Map", translate("Hearing Map"))
+ m = Map("dawn", "Hearing Map", translate("Hearing Map"))
  m.pageaction = false
  
  s = m:section(NamedSection, "__hearingmap__")
@@@ -6,67 -6,59 +6,67 @@@
  function s.render(self, sid)
      local tpl = require "luci.template"
      tpl.render_string([[
 -        <ul>
 -                  <%
 -            local utl = require "luci.util"
 -            local status = require "luci.tools.ieee80211"
 -            local stat = utl.ubus("dawn", "get_hearing_map", { })
 -            local name, macs
 -            for name, macs in pairs(stat) do
 -            %>
 -                <li>
 -                    <strong>SSID is: </strong><%= name %><br />
 -                </li>
 -                <ul>
 +        <%
 +        local utl = require "luci.util"
 +        local status = require "luci.tools.ieee80211"
 +        local stat = utl.ubus("dawn", "get_hearing_map", { })
 +        local name, macs
 +
 +        for name, macs in pairs(stat) do
 +        %>
 +        <div class="cbi-section-node">
 +              <h3>SSID: <%= name %></h3>
 +            <div class="table" id="dawn_hearing_map">
 +                      <div class="tr table-titles">
 +                    <div class="th">Client MAC</div>
 +                    <div class="th">AP MAC</div>
 +                    <div class="th">Frequency</div>
 +                    <div class="th">HT Sup</div>
 +                    <div class="th">VHT Sup</div>
 +                    <div class="th">Signal</div>
 +                    <div class="th">RCPI</div>
 +                    <div class="th">RSNI</div>
 +                    <div class="th">Channel Utilization</div>
 +                    <div class="th">Station connect to AP</div>
 +                    <div class="th">Score</div>
 +                </div>
                  <%
                  local mac, data
                  for mac, data in pairs(macs) do
 +                    local mac2, data2
 +                    local count_loop = 0
 +
 +                    for mac2, data2 in pairs(data) do
                  %>
 -                <li>
 -                    <strong>Client MAC is: </strong><%= mac %><br />
 -                </li>
 -                <ul>
 -                <%
 -                local mac2, data2
 -                for mac2, data2 in pairs(data) do
 -                %>
 -                    <li>
 -                        <strong>AP is: </strong><%= mac2 %><br />
 -                        <strong>Frequency is: </strong><%= "%.3f" %( data2.freq / 1000 ) %> GHz (Channel: <%= "%d" %( status.frequency_to_channel(data2.freq) ) %>)<br />
 -                        <strong>HT support is: </strong><%= (data2.ht_capabilities == true and data2.ht_support == true) and "available" or "not available" %><br />
 -                        <strong>VHT support is: </strong><%= (data2.vht_capabilities == true and data2.vht_support == true) and "available" or "not available" %><br />
 -                        <!--
 -                        <strong>AP HT support is: </strong><%= (data2.ht_support == true) and "available" or "not available" %><br />
 -                        <strong>AP VHT support is: </strong><%= (data2.vht_support == true) and "available" or "not available" %><br />
 -                        <strong>Client HT support is: </strong><%= (data2.ht_capabilities == true) and "available" or "not available" %><br />
 -                        <strong>Client VHT support is: </strong><%= (data2.vht_capabilities == true) and "available" or "not available" %><br />
 -                        --!>
 -                        <strong>Signal is: </strong><%= "%d" %data2.signal %><br />
 -                        <strong>Channel Utilization is: </strong><%= "%d" %data2.channel_utilization %><br />
 -                        <strong>Station connected to AP is: </strong><%= "%d" %data2.num_sta %><br />
 -                        <strong>Score is: </strong><%= "%d" %data2.score %><br />
 -                    </li>
 -                <%
 +                        <div class="tr">
 +                            <% if (count_loop == 0) then %>
 +                                <div class="td"><%= mac %></div>
 +                            <% else %>
 +                                <div></div>
 +                            <% end %>
 +                            <div class="td"><%= mac2 %></div>
 +                            <div class="td"><%= "%.3f" %( data2.freq / 1000 ) %> GHz Channel: <%= "%d" %( status.frequency_to_channel(data2.freq) ) %></div>
 +                            <div class="td"><%= (data2.ht_capabilities == true and data2.ht_support == true) and "True" or "False" %></div>
 +                            <div class="td"><%= (data2.vht_capabilities == true and data2.vht_support == true) and "True" or "False" %></div>
 +                            <div class="td"><%= "%d" %data2.signal %></div>
 +                            <div class="td"><%= "%d" %data2.rcpi %></div>
 +                            <div class="td"><%= "%d" %data2.rsni %></div>
 +                            <div class="td"><%= "%.2f" %(data2.channel_utilization / 2.55) %> %</div>
 +                            <div class="td"><%= "%d" %data2.num_sta %></div>
 +                            <div class="td"><%= "%d" %data2.score %></div>
 +                        </div>
 +                          <%
 +                                  count_loop = count_loop + 1
 +                    end
                  end
                  %>
 -                </ul>
 -            <%
 -            end
 -            %>
 -            </ul>
 +            </div>
 +        </div>
          <%
          end
          %>
 -              </ul>
 -      ]])
 +    </div>
 +    ]])
  end
  
  return m