mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-07 04:34:05 +08:00
28 lines
853 B
HTML
28 lines
853 B
HTML
<%
|
|
local http = require "luci.http"
|
|
local dispatcher = require "luci.dispatcher"
|
|
|
|
local active_tab = http.formvalue("tab") or "usage"
|
|
local base_url = dispatcher.build_url("admin", "tools", "netstat")
|
|
|
|
local function tab_url(tab) return base_url .. "?tab=" .. tab end
|
|
|
|
local tabs_def = {
|
|
{ id="usage", label=translate("Network Usage") },
|
|
{ id="settings", label=translate("Settings") },
|
|
{ id="about", label=translate("About") },
|
|
}
|
|
|
|
%>
|
|
|
|
<%# Standard LuCI tab markup, so every theme styles it like its own tabs. %>
|
|
<ul class="cbi-tabmenu">
|
|
<% for _, tab in ipairs(tabs_def) do %>
|
|
<li class="<%= active_tab == tab.id and "cbi-tab" or "cbi-tab-disabled" %>">
|
|
<a href="<%= tab_url(tab.id) %>"><%= tab.label %></a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
|
|
<input type="hidden" name="tab" value="<%=active_tab%>" />
|