modules/admin-core: Added several cross-references to relevant configuration pages

This commit is contained in:
Steven Barth 2008-08-14 14:51:06 +00:00
parent 8c246e8174
commit 2c09564d76
17 changed files with 45 additions and 31 deletions

View file

@ -12,6 +12,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
m = Map("ddns", translate("ddns"), translate("ddns_desc")) m = Map("ddns", translate("ddns"), translate("ddns_desc"))
s = m:section(TypedSection, "service", "") s = m:section(TypedSection, "service", "")
@ -40,12 +41,7 @@ src:value("web", "URL")
iface = s:option(ListValue, "ip_network", translate("network")) iface = s:option(ListValue, "ip_network", translate("network"))
iface:depends("ip_source", "network") iface:depends("ip_source", "network")
iface.rmempty = true iface.rmempty = true
luci.model.uci.foreach("network", "interface", luci.tools.webadmin.cbi_add_networks(iface)
function (section)
if section[".name"] ~= "loopback" then
iface:value(section[".name"])
end
end)
iface = s:option(ListValue, "ip_interface", translate("interface")) iface = s:option(ListValue, "ip_interface", translate("interface"))
iface:depends("ip_source", "interface") iface:depends("ip_source", "interface")

View file

@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
m = Map("firewall", translate("fw_fw"), translate("fw_fw1")) m = Map("firewall", translate("fw_fw"), translate("fw_fw1"))
s = m:section(TypedSection, "defaults") s = m:section(TypedSection, "defaults")
@ -52,12 +53,7 @@ s:option(Flag, "masq")
net = s:option(MultiValue, "network") net = s:option(MultiValue, "network")
net.widget = "select" net.widget = "select"
net.rmempty = true net.rmempty = true
luci.model.uci.foreach("network", "interface", luci.tools.webadmin.cbi_add_networks(net)
function (section)
if section[".name"] ~= "loopback" then
net:value(section[".name"])
end
end)
function net.cfgvalue(self, section) function net.cfgvalue(self, section)
local value = MultiValue.cfgvalue(self, section) local value = MultiValue.cfgvalue(self, section)

View file

@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
require("luci.fs") require("luci.fs")
m = Map("olsr", "OLSR") m = Map("olsr", "OLSR")
@ -85,13 +86,7 @@ i.addremove = true
i.dynamic = true i.dynamic = true
network = i:option(ListValue, "Interface", translate("network")) network = i:option(ListValue, "Interface", translate("network"))
network:value("") luci.tools.webadmin.cbi_add_networks(network)
luci.model.uci.foreach("network", "interface",
function (section)
if section[".name"] ~= "loopback" then
network:value(section[".name"])
end
end)
i:option(Value, "Ip4Broadcast") i:option(Value, "Ip4Broadcast")
i:option(Value, "HelloInterval") i:option(Value, "HelloInterval")

View file

@ -30,7 +30,7 @@ s.addremove = true
s.template = "cbi/tblsection" s.template = "cbi/tblsection"
s:option(Value, "name", translate("name")) s:option(Value, "name", translate("name"))
s:option(Value, "path") s:option(Value, "path").titleref = luci.dispatcher.build_url("admin", "system", "fstab")
s:option(Value, "users").rmempty = true s:option(Value, "users").rmempty = true

View file

@ -7,3 +7,4 @@ cbi_optional = " (optional)"
cbi_sectempty = "This section contains no values yet" cbi_sectempty = "This section contains no values yet"
cbi_manual = "-- custom --" cbi_manual = "-- custom --"
cbi_select = "-- Please choose --" cbi_select = "-- Please choose --"
cbi_gorel = "Go to relevant configuration page"

View file

@ -5,4 +5,5 @@ cbi_missing = "Fehler: Dieses Feld muss ausgefüllt werden"
cbi_addopt = "-- Zusätzliches Feld --" cbi_addopt = "-- Zusätzliches Feld --"
cbi_sectempty = "Diese Sektion enthält noch keine Einträge" cbi_sectempty = "Diese Sektion enthält noch keine Einträge"
cbi_manual = "-- benutzerdefiniert --" cbi_manual = "-- benutzerdefiniert --"
cbi_select = "-- Bitte auswählen --" cbi_select = "-- Bitte auswählen --"
cbi_gorel = "Gehe zu relevanter Konfigurationsseite"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 279 B

View file

@ -15,7 +15,7 @@ $Id$
<div class="cbi-value" id="cbi-<%=self.config.."-"..section.."-"..self.option%>"> <div class="cbi-value" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
<label class="cbi-value-title"<%= attr("for", cbid) %>> <label class="cbi-value-title"<%= attr("for", cbid) %>>
<%- if self.titleref then -%><a class="cbi-title-ref" href="<%=self.titleref%>"><%- end -%> <%- if self.titleref then -%><a title="<%=self.titledesc or translate('cbi_gorel')%>" class="cbi-title-ref" href="<%=self.titleref%>"><%- end -%>
<%-=self.title-%> <%-=self.title-%>
<%- if self.titleref then -%></a><%- end -%> <%- if self.titleref then -%></a><%- end -%>
</label> </label>

View file

@ -35,7 +35,7 @@ end
<%- end -%> <%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%> <%- for i, k in pairs(self.children) do if not k.optional then -%>
<th class="cbi-section-table-cell"> <th class="cbi-section-table-cell">
<%- if k.titleref then -%><a class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%> <%- if k.titleref then -%><a title="<%=self.titledesc or translate('cbi_gorel')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
<%-=k.title-%> <%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%> <%- if k.titleref then -%></a><%- end -%>
</th> </th>

View file

@ -13,7 +13,7 @@ $Id$
-%> -%>
<%+cbi/valueheader%> <%+cbi/valueheader%>
<textarea onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.size, "cols") .. ifattr(self.rows, "rows") %>> <textarea onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.size, "cols") .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") %>>
<%-=luci.util.pcdata(self:cfgvalue(section))-%> <%-=luci.util.pcdata(self:cfgvalue(section))-%>
</textarea> </textarea>
<%+cbi/valuefooter%> <%+cbi/valuefooter%>

View file

@ -76,6 +76,7 @@ function cbi_add_networks(field)
end end
end end
) )
field.titleref = luci.dispatcher.build_url("admin", "network", "network")
end end
function cbi_add_knownips(field) function cbi_add_knownips(field)

View file

@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
require("luci.model.uci") require("luci.model.uci")
require("luci.sys") require("luci.sys")
require("luci.util") require("luci.util")
@ -22,11 +23,12 @@ s.addremove = true
s.anonymous = true s.anonymous = true
iface = s:option(ListValue, "interface", translate("interface")) iface = s:option(ListValue, "interface", translate("interface"))
luci.tools.webadmin.cbi_add_networks(iface)
luci.model.uci.foreach("network", "interface", luci.model.uci.foreach("network", "interface",
function (section) function (section)
if section[".name"] ~= "loopback" then if section[".name"] ~= "loopback" then
iface.default = iface.default or section[".name"] iface.default = iface.default or section[".name"]
iface:value(section[".name"])
s:depends("interface", section[".name"]) s:depends("interface", section[".name"])
end end
end) end)

View file

@ -52,9 +52,11 @@ end
ifname = s:option(DummyValue, "ifname", translate("device")) ifname = s:option(DummyValue, "ifname", translate("device"))
ifname.stateful = true ifname.stateful = true
ifname.titleref = luci.dispatcher.build_url("admin", "network", "vlan")
if luci.model.uci.load("firewall") then if luci.model.uci.load("firewall") then
zone = s:option(DummyValue, "_zone", translate("zone")) zone = s:option(DummyValue, "_zone", translate("zone"))
zone.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "zones")
function zone.cfgvalue(self, section) function zone.cfgvalue(self, section)
local zones = luci.tools.webadmin.network_get_zones(section) local zones = luci.tools.webadmin.network_get_zones(section)

View file

@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
m = Map("wireless", translate("networks"), translate("a_w_networks1")) m = Map("wireless", translate("networks"), translate("a_w_networks1"))
s = m:section(TypedSection, "wifi-iface", "") s = m:section(TypedSection, "wifi-iface", "")
@ -27,12 +28,7 @@ luci.model.uci.foreach("wireless", "wifi-device",
network = s:option(ListValue, "network", translate("network"), translate("a_w_network1")) network = s:option(ListValue, "network", translate("network"), translate("a_w_network1"))
network:value("") network:value("")
luci.model.uci.foreach("network", "interface", luci.tools.webadmin.cbi_add_networks(network)
function (section)
if section[".name"] ~= "loopback" then
network:value(section[".name"])
end
end)
mode = s:option(ListValue, "mode", translate("mode")) mode = s:option(ListValue, "mode", translate("mode"))
mode:value("ap", translate("a_w_ap")) mode:value("ap", translate("a_w_ap"))

View file

@ -221,6 +221,14 @@ div#content ul {
font-size: 95%; font-size: 95%;
} }
.cbi-title-ref {
color: inherit;
text-decoration: none;
padding-right: 18px;
background: url('../resources/cbi/link.gif') no-repeat scroll right center;
background-color: inherit;
}
input[type=submit], input[type=submit],
input[type=reset], input[type=reset],
input[type=image], input[type=image],

View file

@ -206,6 +206,14 @@ div#content ul {
font-size: 95%; font-size: 95%;
} }
.cbi-title-ref {
color: inherit;
text-decoration: none;
padding-right: 18px;
background: url('../resources/cbi/link.gif') no-repeat scroll right center;
background-color: inherit;
}
input[type=submit], input[type=submit],
input[type=reset], input[type=reset],
input[type=image], input[type=image],

View file

@ -214,6 +214,14 @@ div#content ul {
font-size: 95%; font-size: 95%;
} }
.cbi-title-ref {
color: inherit;
text-decoration: none;
padding-right: 18px;
background: url('../resources/cbi/link.gif') no-repeat scroll right center;
background-color: inherit;
}
input[type=submit], input[type=submit],
input[type=reset], input[type=reset],
input[type=image], input[type=image],