From e42779fcabec3995b87a50e233e95a2f3f7bc466 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 14 Aug 2008 11:50:44 +0000 Subject: [PATCH] User interface improvements part #3 --- i18n/english/luasrc/i18n/admin-core.en.lua | 2 + i18n/german/luasrc/i18n/admin-core.de.lua | 2 + libs/cbi/htdocs/luci-static/resources/cbi.js | 41 +++++++++++--- .../luci-static/resources/cbi/download.gif | Bin 0 -> 189 bytes .../htdocs/luci-static/resources/cbi/key.gif | Bin 0 -> 230 bytes .../htdocs/luci-static/resources/cbi/link.gif | Bin 0 -> 291 bytes .../htdocs/luci-static/resources/cbi/user.gif | Bin 0 -> 246 bytes modules/admin-core/luasrc/view/sysauth.htm | 8 +-- .../luasrc/model/cbi/admin_network/dhcp.lua | 11 +++- .../luasrc/model/cbi/admin_network/ifaces.lua | 9 ++-- .../luasrc/model/cbi/admin_wifi/networks.lua | 2 + .../htdocs/luci-static/fledermaus/cascade.css | 50 ++++++++++++++---- .../luci-static/openwrt-light/cascade.css | 50 ++++++++++++++---- .../luci-static/openwrt.org/cascade.css | 50 ++++++++++++++---- 14 files changed, 182 insertions(+), 43 deletions(-) create mode 100644 libs/cbi/htdocs/luci-static/resources/cbi/download.gif create mode 100644 libs/cbi/htdocs/luci-static/resources/cbi/key.gif create mode 100644 libs/cbi/htdocs/luci-static/resources/cbi/link.gif create mode 100644 libs/cbi/htdocs/luci-static/resources/cbi/user.gif diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua index 762fc5017..767608722 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/i18n/english/luasrc/i18n/admin-core.en.lua @@ -159,8 +159,10 @@ a_w_apisolation1 = "Prevents Client to Client communication" a_w_hideessid = "Hide ESSID" a_w_ap = "Access Point" a_w_adhoc = "Ad-Hoc" +a_w_ahdemo = "Pseudo Ad-Hoc (ahdemo)" a_w_client = "Client" a_w_wds = "WDS" +a_w_monitor = "Monitor" dhcp_desc = "Dnsmasq is a combined DHCP-Server and DNS-Forwarder for NAT firewalls" dhcp_dnsmasq_domainneeded = "Domain required" diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua index a1ea18308..8a06f7098 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.lua +++ b/i18n/german/luasrc/i18n/admin-core.de.lua @@ -145,6 +145,8 @@ Kommunikation.]] a_w_ap = "Access Point" a_w_adhoc = "Ad-Hoc" a_w_client = "Client" +a_w_ahdemo = "Pseudo Ad-Hoc (ahdemo)" +a_w_monitor = "Monitor" a_w_wds = "WDS" accept = [[Annehmen]] aliases = [[Aliasse]] diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index e42193cff..78a9e90bf 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -7,7 +7,16 @@ function cbi_d_add(field, target, value) { if (!cbi_d[target][value]) { cbi_d[target][value] = []; } - cbi_d[target][value].push(field); + + var obj = document.getElementById(field); + if (obj) { + var entry = { + "node": obj, + "parent": obj.parentNode, + "next": obj.nextSibling + } + cbi_d[target][value].unshift(entry); + } } function cbi_d_update(target) { @@ -17,16 +26,34 @@ function cbi_d_update(target) { for (var x in cbi_d[target]) { for (var i=0; ik&+Z^fq|bvhXDvcW-zd1eeis_YHo#<8bh&USm7b|HfiTo^1C<- zB2&*9?YY;WqkfgAr7?@)##fnMrp5vd5e9?B>jf-W))_Q3ne(cwV{E9XUS-Jmz%6-U ohKzU%--1K~l{<@Algzi@uNL9X;o>Z>(Bsa^YtS>66lAal0Is`BfB*mh literal 0 HcmV?d00001 diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/key.gif b/libs/cbi/htdocs/luci-static/resources/cbi/key.gif new file mode 100644 index 0000000000000000000000000000000000000000..e3853e5afd54d40a853e4cb7934917316f073e7d GIT binary patch literal 230 zcmZ?wbhEHb6krfwI3mt)cB=6G?XEvwEV;5k@%#*tlih-MHikVr5_NB*)q`F6Z*J|r zvPAsmO8wiLbI(i?dbrK;$sVs`?flOVdj0+R=-Z?2x2F^Tg8>5$p!k!8k%2*+K?fuc zvXg-|`GIQRqSUCAs4#&;3tm~By~MCQ%rwwORo7gy-yy?BWny%m`4$Z=kEQF}JtY=+ zUfLA?(#?Ar^XBeQKBmcC4v)^p`DK_cQ206RTqffIk;3UrB1Hyj7R*hC%3_Rs)g7Jc Jeaeaq)&Qp@T0Z~) literal 0 HcmV?d00001 diff --git a/libs/cbi/htdocs/luci-static/resources/cbi/link.gif b/libs/cbi/htdocs/luci-static/resources/cbi/link.gif new file mode 100644 index 0000000000000000000000000000000000000000..1b2a923a5ae58535adacd1fd5cf3012689d47ce9 GIT binary patch literal 291 zcmV+;0o?vaNk%w1VGsZi0K^{v^7i^Riqn*|(Ui&hB5tsaz3NwRk*U-Bbd<5|@%C(_ z)a2{**68-L*!sxb@ocvCNmXl4meV_y=EKO)Qek_|$wnh9QU)Bxzhz$f7iv*4t8j>EA1eb211p@;b9g_eA pVtI5VArX{>gpqy}ZQ3xBIb z?{>Ooo8TtXQxO=NV3P1sT@;64^wK0*F2c
<%:username%>
-
+
<%:password%>
-
+

- - + +
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua index b50b05cb3..1c9ae396a 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua @@ -47,7 +47,8 @@ s:option(Flag, "dynamicdhcp").rmempty = true s:option(Value, "name", translate("name")).optional = true -s:option(Flag, "ignore").optional = true +ignore = s:option(Flag, "ignore") +ignore.optional = true s:option(Value, "netmask", translate("netmask")).optional = true @@ -58,6 +59,14 @@ for i, line in pairs(luci.util.execl("dnsmasq --help dhcp")) do s:option(Value, "dhcp"..k, v).optional = true end + +for i, n in ipairs(s.children) do + if n ~= iface and n ~= ignore then + n:depends("ignore", "") + end +end + + m2 = Map("luci_ethers", translate("luci_ethers")) s = m2:section(TypedSection, "static_lease", "") diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index ae5f2aeab..6d1fb4f39 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -113,6 +113,11 @@ mtu.isinteger = true mac = s:option(Value, "macaddr", translate("macaddress")) mac.optional = true + +srv = s:option(Value, "server", translate("network_interface_server")) +srv:depends("proto", "pptp") +srv.rmempty = true + user = s:option(Value, "username", translate("username")) user.rmempty = true user:depends("proto", "pptp") @@ -139,10 +144,6 @@ demand.rmempty = true demand:depends("proto", "pptp") demand:depends("proto", "pppoe") -srv = s:option(Value, "server", translate("network_interface_server")) -srv:depends("proto", "pptp") -srv.rmempty = true - diff --git a/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua b/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua index ae4f84b9f..4b2179a8f 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua @@ -37,8 +37,10 @@ luci.model.uci.foreach("network", "interface", mode = s:option(ListValue, "mode", translate("mode")) mode:value("ap", translate("a_w_ap")) mode:value("adhoc", translate("a_w_adhoc")) +mode:value("ahdemo", translate("a_w_ahdemo")) mode:value("sta", translate("a_w_client")) mode:value("wds", translate("a_w_wds")) +mode:value("monitor", translate("a_w_monitor")) s:option(Value, "bssid", "BSSID").optional = true diff --git a/themes/fledermaus/htdocs/luci-static/fledermaus/cascade.css b/themes/fledermaus/htdocs/luci-static/fledermaus/cascade.css index c12a9e406..537b2ea8e 100644 --- a/themes/fledermaus/htdocs/luci-static/fledermaus/cascade.css +++ b/themes/fledermaus/htdocs/luci-static/fledermaus/cascade.css @@ -248,7 +248,7 @@ select:focus, select:hover, textarea:focus, textarea:hover { - background: #f2f3f9; + background-color: #f2f3f9; } select, @@ -263,35 +263,67 @@ td input[type=password] { width: 99%; } -input.cbi-button { +input.cbi-input-user { + background: url('../resources/cbi/user.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; +} + +input.cbi-input-key { + background: url('../resources/cbi/key.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; - padding-right: 1px; } +input.cbi-input-add, input.cbi-button-add { - background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-fieldadd, input.cbi-button-fieldadd { - background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-reset, input.cbi-button-reset { - background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-save, input.cbi-button-save { - background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-apply, input.cbi-button-apply { - background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-remove, div.cbi-section-remove input { - background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; padding-right: 1px; +} + +div.cbi-section-remove input { border-bottom: none; } diff --git a/themes/openwrt-light/htdocs/luci-static/openwrt-light/cascade.css b/themes/openwrt-light/htdocs/luci-static/openwrt-light/cascade.css index 25d5e2741..ddc3bdc06 100644 --- a/themes/openwrt-light/htdocs/luci-static/openwrt-light/cascade.css +++ b/themes/openwrt-light/htdocs/luci-static/openwrt-light/cascade.css @@ -233,7 +233,7 @@ select:focus, select:hover, textarea:focus, textarea:hover { - background: #ffffff; + background-color: #ffffff; } select, @@ -248,35 +248,67 @@ td input[type=password] { width: 99%; } -input.cbi-button { +input.cbi-input-user { + background: url('../resources/cbi/user.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; +} + +input.cbi-input-key { + background: url('../resources/cbi/key.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; - padding-right: 1px; } +input.cbi-input-add, input.cbi-button-add { - background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-fieldadd, input.cbi-button-fieldadd { - background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-reset, input.cbi-button-reset { - background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-save, input.cbi-button-save { - background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-apply, input.cbi-button-apply { - background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-remove, div.cbi-section-remove input { - background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; padding-right: 1px; +} + +div.cbi-section-remove input { border-bottom: none; } diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css index 2b1946c0f..f86a837ee 100644 --- a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css @@ -241,7 +241,7 @@ select:focus, select:hover, textarea:focus, textarea:hover { - background: #ffffff; + background-color: #ffffff; } select, @@ -256,35 +256,67 @@ td input[type=password] { width: 99%; } -input.cbi-button { +input.cbi-input-user { + background: url('../resources/cbi/user.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; +} + +input.cbi-input-key { + background: url('../resources/cbi/key.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; - padding-right: 1px; } +input.cbi-input-add, input.cbi-button-add { - background: transparent url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/add.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-fieldadd, input.cbi-button-fieldadd { - background: transparent url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background: url(../resources/cbi/fieldadd.gif) no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-reset, input.cbi-button-reset { - background: transparent url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/reset.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-save, input.cbi-button-save { - background: transparent url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/save.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-apply, input.cbi-button-apply { - background: transparent url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/apply.gif') no-repeat scroll 1px center; + background-color: inherit; + padding-left: 17px; + padding-right: 1px; } +input.cbi-input-remove, div.cbi-section-remove input { - background: transparent url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background: url('../resources/cbi/remove.gif') no-repeat scroll 1px center; + background-color: inherit; padding-left: 17px; padding-right: 1px; +} + +div.cbi-section-remove input { border-bottom: none; } -- 2.25.1