luci-mod-admin-full: tweak interface and wireless overview markup

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-07-13 09:37:53 +02:00
parent 5722105007
commit 4f0dfb6ab0
2 changed files with 48 additions and 41 deletions

View file

@ -38,10 +38,11 @@ local tpl_networks = tpl.Template(nil, [[
</div> </div>
</div> </div>
</div> </div>
<div class="td col-5 left" id="<%=net[1]%>-ifc-description"> <div class="td col-5 left middle" id="<%=net[1]%>-ifc-description">
<em><%:Collecting data...%></em> <em><%:Collecting data...%></em>
</div> </div>
<div class="td cbi-section-actions"> <div class="td cbi-section-actions">
<div>
<input type="button" class="cbi-button cbi-button-neutral" onclick="iface_reconnect('<%=net[1]%>')" title="<%:Reconnect this interface%>" value="<%:Restart%>"<%=ifattr(disabled or dynamic, "disabled", "disabled")%> /> <input type="button" class="cbi-button cbi-button-neutral" onclick="iface_reconnect('<%=net[1]%>')" title="<%:Reconnect this interface%>" value="<%:Restart%>"<%=ifattr(disabled or dynamic, "disabled", "disabled")%> />
<% if disabled then %> <% if disabled then %>
@ -58,11 +59,13 @@ local tpl_networks = tpl.Template(nil, [[
<input type="submit" name="cbi.apply" class="cbi-button cbi-button-negative" onclick="iface_delete(event)" value="<%:Delete%>"<%=ifattr(dynamic, "disabled", "disabled")%> /> <input type="submit" name="cbi.apply" class="cbi-button cbi-button-negative" onclick="iface_delete(event)" value="<%:Delete%>"<%=ifattr(dynamic, "disabled", "disabled")%> />
</div> </div>
</div> </div>
</div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="cbi-section-create">
<input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=url("admin/network/iface_add")%>'" /> <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=url("admin/network/iface_add")%>'" />
</div>
]]) ]])
local _, net local _, net

View file

@ -69,14 +69,15 @@ local tpl_radio = tpl.Template(nil, [[
<div class="table"> <div class="table">
<!-- physical device --> <!-- physical device -->
<div class="tr cbi-rowstyle-2"> <div class="tr cbi-rowstyle-2">
<div class="td col-2 center"> <div class="td col-2 center middle">
<span class="ifacebadge"><img src="<%=resource%>/icons/wifi_toggled.png" id="<%=dev:name()%>-iw-upstate" /> <%=dev:name()%></span> <span class="ifacebadge"><img src="<%=resource%>/icons/wifi_toggled.png" id="<%=dev:name()%>-iw-upstate" /> <%=dev:name()%></span>
</div> </div>
<div class="td col-7 left"> <div class="td col-7 left middle">
<big><strong><%=hw%></strong></big><br /> <big><strong><%=hw%></strong></big><br />
<span id="<%=dev:name()%>-iw-devinfo"></span> <span id="<%=dev:name()%>-iw-devinfo"></span>
</div> </div>
<div class="td cbi-section-actions"> <div class="td middle cbi-section-actions">
<div>
<input type="button" class="cbi-button cbi-button-neutral" title="<%:Restart radio interface%>" value="<%:Restart%>" onclick="wifi_restart(event)" data-radio="<%=dev:name()%>" /> <input type="button" class="cbi-button cbi-button-neutral" title="<%:Restart radio interface%>" value="<%:Restart%>" onclick="wifi_restart(event)" data-radio="<%=dev:name()%>" />
<form action="<%=url('admin/network/wireless_join')%>" method="post" class="inline"> <form action="<%=url('admin/network/wireless_join')%>" method="post" class="inline">
@ -91,19 +92,21 @@ local tpl_radio = tpl.Template(nil, [[
</form> </form>
</div> </div>
</div> </div>
</div>
<!-- /physical device --> <!-- /physical device -->
<!-- network list --> <!-- network list -->
<% if #wnets > 0 then %> <% if #wnets > 0 then %>
<% for i, net in ipairs(wnets) do local disabled = (dev:get("disabled") == "1" or net:get("disabled") == "1") %> <% for i, net in ipairs(wnets) do local disabled = (dev:get("disabled") == "1" or net:get("disabled") == "1") %>
<div class="tr cbi-rowstyle-<%=1 + ((i-1) % 2)%>"> <div class="tr cbi-rowstyle-<%=1 + ((i-1) % 2)%>">
<div class="td col-2 center" id="<%=net:id()%>-iw-signal"> <div class="td col-2 center middle" id="<%=net:id()%>-iw-signal">
<span class="ifacebadge" title="<%:Not associated%>"><img src="<%=resource%>/icons/signal-<%= disabled and "none" or "0" %>.png" /> 0%</span> <span class="ifacebadge" title="<%:Not associated%>"><img src="<%=resource%>/icons/signal-<%= disabled and "none" or "0" %>.png" /> 0%</span>
</div> </div>
<div class="td col-7 left" id="<%=net:id()%>-iw-status" data-network="<%=net:id()%>" data-disabled="<%= disabled and "true" or "false" %>"> <div class="td col-7 left middle" id="<%=net:id()%>-iw-status" data-network="<%=net:id()%>" data-disabled="<%= disabled and "true" or "false" %>">
<em><%= disabled and translate("Wireless is disabled") or translate("Collecting data...") %></em> <em><%= disabled and translate("Wireless is disabled") or translate("Collecting data...") %></em>
</div> </div>
<div class="td cbi-section-actions"> <div class="td middle cbi-section-actions">
<div>
<% if disabled then %> <% if disabled then %>
<input name="cbid.wireless.<%=net:name()%>.__disable__" type="hidden" value="1" /> <input name="cbid.wireless.<%=net:name()%>.__disable__" type="hidden" value="1" />
<input name="cbi.apply" type="submit" class="cbi-button cbi-button-neutral" title="<%:Enable this network%>" value="<%:Enable%>" onclick="this.previousElementSibling.value='0'" /> <input name="cbi.apply" type="submit" class="cbi-button cbi-button-neutral" title="<%:Enable this network%>" value="<%:Enable%>" onclick="this.previousElementSibling.value='0'" />
@ -118,6 +121,7 @@ local tpl_radio = tpl.Template(nil, [[
<input name="cbi.apply" type="submit" class="cbi-button cbi-button-negative" title="<%:Delete this network%>" value="<%:Remove%>" onclick="wifi_delete(event)" /> <input name="cbi.apply" type="submit" class="cbi-button cbi-button-negative" title="<%:Delete this network%>" value="<%:Remove%>" onclick="wifi_delete(event)" />
</div> </div>
</div> </div>
</div>
<% end %> <% end %>
<% else %> <% else %>
<div class="tr cbi-rowstyle-2"> <div class="tr cbi-rowstyle-2">