summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js114
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi/edit.gifbin280 -> 272 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi/fieldadd.gifbin379 -> 371 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi/file.gifbin371 -> 267 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/bridge.pngbin838 -> 681 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/bridge_disabled.pngbin517 -> 405 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/encryption.pngbin1224 -> 920 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/encryption_disabled.pngbin1197 -> 888 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/ethernet.pngbin814 -> 701 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/ethernet_disabled.pngbin508 -> 399 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/loading.gifbin1787 -> 1786 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/port_down.pngbin982 -> 769 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/port_up.pngbin1401 -> 1151 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-0-25.pngbin495 -> 462 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-0.pngbin478 -> 439 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-25-50.pngbin501 -> 465 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-50-75.pngbin500 -> 467 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-75-100.pngbin485 -> 457 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/signal-none.pngbin681 -> 639 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/switch.pngbin794 -> 680 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/switch_disabled.pngbin505 -> 398 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/tunnel.pngbin533 -> 343 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/tunnel_disabled.pngbin546 -> 235 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/vlan.pngbin794 -> 680 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/vlan_disabled.pngbin505 -> 398 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/wifi.pngbin1037 -> 767 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/wifi_big.pngbin2865 -> 2276 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/wifi_big_disabled.pngbin2853 -> 1512 bytes
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/icons/wifi_disabled.pngbin980 -> 494 bytes
29 files changed, 104 insertions, 10 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 5e31bf2099..1c4123bdad 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js
@@ -139,10 +139,11 @@ var cbi_validators = {
return (this.match(/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/) != null);
},
- 'host': function()
+ 'host': function(ipv4only)
{
return cbi_validators.hostname.apply(this) ||
- cbi_validators.ipaddr.apply(this);
+ ((ipv4only != 1) && cbi_validators.ipaddr.apply(this)) ||
+ ((ipv4only == 1) && cb_validators.ip4addr.apply(this));
},
'hostname': function()
@@ -161,6 +162,49 @@ var cbi_validators = {
cbi_validators.host.apply(this);
},
+ 'hostport': function(ipv4only)
+ {
+ var hp = this.split(/:/);
+
+ if (hp.length == 2)
+ return (cbi_validators.host.apply(hp[0], ipv4only) &&
+ cbi_validators.port.apply(hp[1]));
+
+ return false;
+ },
+
+ 'ip4addrport': function()
+ {
+ var hp = this.split(/:/);
+
+ if (hp.length == 2)
+ return (cbi_validators.ipaddr.apply(hp[0]) &&
+ cbi_validators.port.apply(hp[1]));
+ return false;
+ },
+
+ 'ipaddrport': function(bracket)
+ {
+ if (this.match(/^([^\[\]:]+):([^:]+)$/)) {
+ var addr = RegExp.$1
+ var port = RegExp.$2
+ return (cbi_validators.ip4addr.apply(addr) &&
+ cbi_validators.port.apply(port));
+ } else if ((bracket == 1) && (this.match(/^\[(.+)\]:([^:]+)$/))) {
+ var addr = RegExp.$1
+ var port = RegExp.$2
+ return (cbi_validators.ip6addr.apply(addr) &&
+ cbi_validators.port.apply(port));
+ } else if ((bracket != 1) && (this.match(/^([^\[\]]+):([^:]+)$/))) {
+ var addr = RegExp.$1
+ var port = RegExp.$2
+ return (cbi_validators.ip6addr.apply(addr) &&
+ cbi_validators.port.apply(port));
+ } else {
+ return false;
+ }
+ },
+
'wpakey': function()
{
var v = this;
@@ -300,6 +344,47 @@ var cbi_validators = {
'phonedigit': function()
{
return (this.match(/^[0-9\*#!\.]+$/) != null);
+ },
+ 'timehhmmss': function()
+ {
+ return (this.match(/^[0-6][0-9]:[0-6][0-9]:[0-6][0-9]$/) != null);
+ },
+ 'dateyyyymmdd': function()
+ {
+ if (this == null) {
+ return false;
+ }
+ if (this.match(/^(\d\d\d\d)-(\d\d)-(\d\d)/)) {
+ var year = RegExp.$1;
+ var month = RegExp.$2;
+ var day = RegExp.$2
+
+ var days_in_month = [ 31, 28, 31, 30, 31, 30, 31, 31, 30 , 31, 30, 31 ];
+ function is_leap_year(year) {
+ return ((year % 4) == 0) && ((year % 100) != 0) || ((year % 400) == 0);
+ }
+ function get_days_in_month(month, year) {
+ if ((month == 2) && is_leap_year(year)) {
+ return 29;
+ } else {
+ return days_in_month[month];
+ }
+ }
+ /* Firewall rules in the past don't make sense */
+ if (year < 2015) {
+ return false;
+ }
+ if ((month <= 0) || (month > 12)) {
+ return false;
+ }
+ if ((day <= 0) || (day > get_days_in_month(month, year))) {
+ return false;
+ }
+ return true;
+
+ } else {
+ return false;
+ }
}
};
@@ -545,7 +630,7 @@ function cbi_browser_init(id, respath, url, defpath)
cbi_bind(btn, 'click', cbi_browser_btnclick);
}
-function cbi_dynlist_init(name, respath, datatype, optional, choices)
+function cbi_dynlist_init(name, respath, datatype, optional, url, defpath, choices)
{
var input0 = document.getElementsByName(name)[0];
var prefix = input0.name;
@@ -606,6 +691,11 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices)
parent.appendChild(t);
parent.appendChild(b);
+ if (datatype == 'file')
+ {
+ cbi_browser_init(t.id, respath, url, defpath);
+ }
+
parent.appendChild(document.createElement('br'));
if (datatype)
@@ -616,13 +706,13 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices)
if (choices)
{
cbi_combobox_init(t.id, choices[0], '', choices[1]);
- t.nextSibling.index = i;
+ b.index = i;
- cbi_bind(t.nextSibling, 'keydown', cbi_dynlist_keydown);
- cbi_bind(t.nextSibling, 'keypress', cbi_dynlist_keypress);
+ cbi_bind(b, 'keydown', cbi_dynlist_keydown);
+ cbi_bind(b, 'keypress', cbi_dynlist_keypress);
if (i == focus || -i == focus)
- t.nextSibling.focus();
+ b.focus();
}
else
{
@@ -758,20 +848,24 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices)
ev = ev ? ev : window.event;
var se = ev.target ? ev.target : ev.srcElement;
+ var input = se.previousSibling;
+ while (input && input.name != name) {
+ input = input.previousSibling;
+ }
if (se.src.indexOf('remove') > -1)
{
- se.previousSibling.value = '';
+ input.value = '';
cbi_dynlist_keydown({
- target: se.previousSibling,
+ target: input,
keyCode: 8
});
}
else
{
cbi_dynlist_keydown({
- target: se.previousSibling,
+ target: input,
keyCode: 13
});
}
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi/edit.gif b/modules/luci-base/htdocs/luci-static/resources/cbi/edit.gif
index 7b02b6e72a..e06e37c750 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi/edit.gif
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi/edit.gif
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi/fieldadd.gif b/modules/luci-base/htdocs/luci-static/resources/cbi/fieldadd.gif
index 431ff64d1f..eebe0fffe0 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi/fieldadd.gif
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi/fieldadd.gif
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi/file.gif b/modules/luci-base/htdocs/luci-static/resources/cbi/file.gif
index 3b1217dd65..342a8463d2 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi/file.gif
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi/file.gif
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/bridge.png b/modules/luci-base/htdocs/luci-static/resources/icons/bridge.png
index 4c163bf692..7faadecf92 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/bridge.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/bridge.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/bridge_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/bridge_disabled.png
index 0f367c5369..b3e620b3a1 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/bridge_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/bridge_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/encryption.png b/modules/luci-base/htdocs/luci-static/resources/icons/encryption.png
index 41d2ba9ace..7762833604 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/encryption.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/encryption.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/encryption_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/encryption_disabled.png
index f2e05a4251..9a8721b02c 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/encryption_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/encryption_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/ethernet.png b/modules/luci-base/htdocs/luci-static/resources/icons/ethernet.png
index a02538124c..e3d24f2791 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/ethernet.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/ethernet.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/ethernet_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/ethernet_disabled.png
index 2bb02e455a..d8792df54b 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/ethernet_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/ethernet_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/loading.gif b/modules/luci-base/htdocs/luci-static/resources/icons/loading.gif
index 5bb90fd6a4..7154314832 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/loading.gif
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/loading.gif
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/port_down.png b/modules/luci-base/htdocs/luci-static/resources/icons/port_down.png
index 25ea172324..5a2b235d0a 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/port_down.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/port_down.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/port_up.png b/modules/luci-base/htdocs/luci-static/resources/icons/port_up.png
index e063037910..8105e77d08 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/port_up.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/port_up.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-0-25.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-0-25.png
index 2e5dff4663..b3a8118afc 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-0-25.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-0-25.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-0.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-0.png
index 114583a676..333b1557ba 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-0.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-0.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-25-50.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-25-50.png
index ee8cc4f1ce..b465de3f57 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-25-50.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-25-50.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-50-75.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-50-75.png
index 26bcbf715d..cd7bcaf9a6 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-50-75.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-50-75.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-75-100.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-75-100.png
index 5cffaa1b84..f7a3658df8 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-75-100.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-75-100.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/signal-none.png b/modules/luci-base/htdocs/luci-static/resources/icons/signal-none.png
index b77585c0f0..4a11356af2 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/signal-none.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/signal-none.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/switch.png b/modules/luci-base/htdocs/luci-static/resources/icons/switch.png
index 5c99ba5684..be99b19bad 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/switch.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/switch.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/switch_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/switch_disabled.png
index b8c84c8dc4..54588d24d1 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/switch_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/switch_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/tunnel.png b/modules/luci-base/htdocs/luci-static/resources/icons/tunnel.png
index c5a09dd685..63eabfef59 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/tunnel.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/tunnel.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/tunnel_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/tunnel_disabled.png
index ad9856cfec..ca79d81707 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/tunnel_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/tunnel_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/vlan.png b/modules/luci-base/htdocs/luci-static/resources/icons/vlan.png
index 5c99ba5684..be99b19bad 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/vlan.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/vlan.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/vlan_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/vlan_disabled.png
index b8c84c8dc4..54588d24d1 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/vlan_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/vlan_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/wifi.png b/modules/luci-base/htdocs/luci-static/resources/icons/wifi.png
index 528ce2b4e9..80a23e8e9a 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/wifi.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/wifi.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big.png b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big.png
index d73a5e7401..9e466aebf4 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big_disabled.png
index af93b37b7a..6f9fff3813 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_big_disabled.png
Binary files differ
diff --git a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_disabled.png b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_disabled.png
index 338a34f78c..e989a2bd3d 100644
--- a/modules/luci-base/htdocs/luci-static/resources/icons/wifi_disabled.png
+++ b/modules/luci-base/htdocs/luci-static/resources/icons/wifi_disabled.png
Binary files differ