mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 19:01:56 +00:00
luci-app-radicale3: use ip6 bracket notation
Update iphostport validation to use bracket notation for ipv6 IP addresses. Radicale understands it, and it is the preferred notation when using an IP address and port, together. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
This commit is contained in:
committed by
Paul Donald
parent
b72dad0a00
commit
637c075193
@@ -53,11 +53,11 @@ return view.extend({
|
||||
|
||||
button = '';
|
||||
|
||||
if ((radicale_address == '127.0.0.1') || (radicale_address == '::1')) {
|
||||
if ((radicale_address == '127.0.0.1') || (radicale_address == '[::1]') || radicale_host == 'localhost') {
|
||||
ui.addNotification(_('Need a listen address'),
|
||||
_('Radicale needs a non-loopback IP address for your browser to access the web interface'));
|
||||
} else {
|
||||
if (radicale_address == '0.0.0.0' || radicale_address == '::') {
|
||||
if (radicale_address == '0.0.0.0' || radicale_address == '[::]') {
|
||||
radicale_address = window.location.hostname;
|
||||
}
|
||||
radicale_port = radicale_host.substring(radicale_host.lastIndexOf(':') + 1) || '5232';
|
||||
@@ -84,8 +84,8 @@ return view.extend({
|
||||
|
||||
o = s.taboption('main', form.DynamicList, 'host', _('Host:port'));
|
||||
o.optional = true;
|
||||
o.datatype = 'or(hostport(0),ipaddrport(0))';
|
||||
o.default = ['127.0.0.1:5232', '::1:5232'];
|
||||
o.datatype = 'or(hostport(0),ipaddrport(1))';
|
||||
o.default = ['127.0.0.1:5232', '[::1]:5232'];
|
||||
|
||||
s.tab('advanced', _('Advanced'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user