luci-app-ddns: refactoring translation and source styling
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
139c6a1481
commit
809d085ada
1 changed files with 137 additions and 181 deletions
|
@ -501,51 +501,44 @@ return view.extend({
|
||||||
s.tab('timer', _('Timer Settings'));
|
s.tab('timer', _('Timer Settings'));
|
||||||
s.tab('logview', _('Log File Viewer'));
|
s.tab('logview', _('Log File Viewer'));
|
||||||
|
|
||||||
// TAB: BASIC
|
o = s.taboption('basic', form.Flag, 'enabled',
|
||||||
|
_('Enabled'),
|
||||||
// enabled
|
_("If this service section is disabled it could not be started.")
|
||||||
o = s.taboption('basic', form.Flag, 'enabled', _('Enabled'),_("If this service section is disabled it could not be started." + "<br />" +
|
+ "<br />" +
|
||||||
"Neither from LuCI interface nor from console"));
|
_("Neither from LuCI interface nor from console."));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.default = '1';
|
o.default = '1';
|
||||||
|
|
||||||
// lookup_host
|
o = s.taboption('basic', form.Value, 'lookup_host',
|
||||||
|
_("Lookup Hostname"),
|
||||||
o = s.taboption('basic', form.Value, 'lookup_host', _("Lookup Hostname"),
|
|
||||||
_("Hostname/FQDN to validate, if IP update happen or necessary"));
|
_("Hostname/FQDN to validate, if IP update happen or necessary"));
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.placeholder = "myhost.example.com";
|
o.placeholder = "myhost.example.com";
|
||||||
o.datatype = 'and(minlength(3),hostname("strict"))';
|
o.datatype = 'and(minlength(3),hostname("strict"))';
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
// use_ipv6
|
o = s.taboption('basic', form.ListValue, 'use_ipv6',
|
||||||
|
_("IP address version"),
|
||||||
o = s.taboption('basic', form.ListValue, 'use_ipv6', _("IP address version"),
|
|
||||||
_("Defines which IP address 'IPv4/IPv6' is send to the DDNS provider"));
|
_("Defines which IP address 'IPv4/IPv6' is send to the DDNS provider"));
|
||||||
o.default = '0';
|
o.default = '0';
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
o.value("0", _("IPv4-Address"))
|
o.value("0", _("IPv4-Address"))
|
||||||
if (env["has_ipv6"])
|
if (env["has_ipv6"]) {
|
||||||
o.value("1", _("IPv6-Address"))
|
o.value("1", _("IPv6-Address"))
|
||||||
|
|
||||||
// service_name
|
|
||||||
|
|
||||||
o = s.taboption('basic', form.ListValue, 'ipv4_service_name', _("DDNS Service provider") + " [IPv4]");
|
|
||||||
o.depends("use_ipv6", "0")
|
|
||||||
o.modalonly = true;
|
|
||||||
|
|
||||||
for (var i = 0; i < services4.length; i++)
|
|
||||||
o.value(services4[i]);
|
|
||||||
|
|
||||||
o.value('-',"-- " + _("custom") + " --");
|
|
||||||
|
|
||||||
o.cfgvalue = function(section_id) {
|
|
||||||
return uci.get('ddns', section_id, 'service_name') || '-';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
o = s.taboption('basic', form.ListValue, 'ipv4_service_name',
|
||||||
|
String.format('%s %s', _("DDNS Service provider"), "[IPv4]"));
|
||||||
|
o.depends("use_ipv6", "0")
|
||||||
|
o.modalonly = true;
|
||||||
|
o.value('-',"-- " + _("custom") + " --");
|
||||||
|
for (var i = 0; i < services4.length; i++)
|
||||||
|
o.value(services4[i]);
|
||||||
|
o.cfgvalue = function(section_id) {
|
||||||
|
return uci.get('ddns', section_id, 'service_name') || '-';
|
||||||
|
};
|
||||||
o.write = function(section_id, formvalue) {
|
o.write = function(section_id, formvalue) {
|
||||||
if (formvalue != '-') {
|
if (formvalue != '-') {
|
||||||
uci.set('ddns', section_id, 'update_url', null);
|
uci.set('ddns', section_id, 'update_url', null);
|
||||||
|
@ -555,15 +548,14 @@ return view.extend({
|
||||||
return uci.set('ddns', section_id, 'service_name', null);
|
return uci.set('ddns', section_id, 'service_name', null);
|
||||||
};
|
};
|
||||||
|
|
||||||
o = s.taboption('basic', form.ListValue, 'ipv6_service_name', _("DDNS Service provider") + " [IPv6]");
|
o = s.taboption('basic', form.ListValue, 'ipv6_service_name',
|
||||||
|
String.format('%s %s', _("DDNS Service provider"), "[IPv6]"));
|
||||||
o.depends("use_ipv6", "1")
|
o.depends("use_ipv6", "1")
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
for (var i = 0; i < services6.length; i++)
|
|
||||||
o.value(services6[i]);
|
|
||||||
|
|
||||||
o.value('-',"-- " + _("custom") + " --");
|
o.value('-',"-- " + _("custom") + " --");
|
||||||
|
for (var i = 0; i < services6.length; i++) {
|
||||||
|
o.value(services6[i]);
|
||||||
|
}
|
||||||
o.cfgvalue = function(section_id) {
|
o.cfgvalue = function(section_id) {
|
||||||
var service = uci.get('ddns', section_id, 'service_name'),
|
var service = uci.get('ddns', section_id, 'service_name'),
|
||||||
update_script = uci.get('ddns', section_id, 'update_script'),
|
update_script = uci.get('ddns', section_id, 'update_script'),
|
||||||
|
@ -573,8 +565,7 @@ return view.extend({
|
||||||
return "-";
|
return "-";
|
||||||
|
|
||||||
return service;
|
return service;
|
||||||
}
|
};
|
||||||
|
|
||||||
o.write = function(section_id, formvalue) {
|
o.write = function(section_id, formvalue) {
|
||||||
if (formvalue != '-') {
|
if (formvalue != '-') {
|
||||||
uci.set('ddns', section_id, 'update_url', null);
|
uci.set('ddns', section_id, 'update_url', null);
|
||||||
|
@ -584,17 +575,16 @@ return view.extend({
|
||||||
return uci.set('ddns', section_id, 'service_name', null);
|
return uci.set('ddns', section_id, 'service_name', null);
|
||||||
};
|
};
|
||||||
|
|
||||||
// update_url
|
o = s.taboption('basic', form.Value, 'update_url',
|
||||||
|
_("Custom update-URL"),
|
||||||
o = s.taboption('basic', form.Value, 'update_url', _("Custom update-URL"),
|
_("Update URL to be used for updating your DDNS Provider.")
|
||||||
_("Update URL to be used for updating your DDNS Provider." + "<br />" +
|
+ "<br />" +
|
||||||
"Follow instructions you will find on their WEB page."));
|
_("Follow instructions you will find on their WEB page."));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = true;
|
o.rmempty = true;
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.depends("ipv6_service_name","-");
|
o.depends("ipv6_service_name","-");
|
||||||
o.depends("ipv4_service_name","-");
|
o.depends("ipv4_service_name","-");
|
||||||
|
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
var other = this.section.children.filter(function(o) { return o.option == 'update_script' })[0].formvalue(section_id);
|
var other = this.section.children.filter(function(o) { return o.option == 'update_script' })[0].formvalue(section_id);
|
||||||
|
|
||||||
|
@ -603,18 +593,16 @@ return view.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// update_script
|
o = s.taboption('basic', form.Value, 'update_script',
|
||||||
|
_("Custom update-script"),
|
||||||
o = s.taboption('basic', form.Value, 'update_script', _("Custom update-script"),
|
|
||||||
_("Custom update script to be used for updating your DDNS Provider."));
|
_("Custom update script to be used for updating your DDNS Provider."));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = true;
|
o.rmempty = true;
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.depends("ipv6_service_name","-");
|
o.depends("ipv6_service_name","-");
|
||||||
o.depends("ipv4_service_name","-");
|
o.depends("ipv4_service_name","-");
|
||||||
|
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
var other = this.section.children.filter(function(o) { return o.option == 'update_url' })[0].formvalue(section_id);
|
var other = this.section.children.filter(function(o) { return o.option == 'update_url' })[0].formvalue(section_id);
|
||||||
|
|
||||||
|
@ -623,57 +611,52 @@ return view.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// domain
|
o = s.taboption('basic', form.Value, 'domain',
|
||||||
|
_("Domain"),
|
||||||
o = s.taboption('basic', form.Value, 'domain', _("Domain"),
|
|
||||||
_("Replaces [USERNAME] in Update-URL (URL-encoded)"));
|
_("Replaces [USERNAME] in Update-URL (URL-encoded)"));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
// username
|
o = s.taboption('basic', form.Value, 'username',
|
||||||
|
_("Username"),
|
||||||
o = s.taboption('basic', form.Value, 'username', _("Username"),
|
|
||||||
_("Replaces [USERNAME] in Update-URL (URL-encoded)"));
|
_("Replaces [USERNAME] in Update-URL (URL-encoded)"));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
// password
|
o = s.taboption('basic', form.Value, 'password',
|
||||||
|
_("Password"),
|
||||||
|
|
||||||
o = s.taboption('basic', form.Value, 'password', _("Password"),
|
|
||||||
_("Replaces [PASSWORD] in Update-URL (URL-encoded)"));
|
_("Replaces [PASSWORD] in Update-URL (URL-encoded)"));
|
||||||
o.password = true;
|
o.password = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
|
|
||||||
// param_enc
|
o = s.taboption('basic', form.Value, 'param_enc',
|
||||||
|
_("Optional Encoded Parameter"),
|
||||||
o = s.taboption('basic', form.Value, 'param_enc', _("Optional Encoded Parameter"),
|
|
||||||
_("Optional: Replaces [PARAMENC] in Update-URL (URL-encoded)"));
|
_("Optional: Replaces [PARAMENC] in Update-URL (URL-encoded)"));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
// param_opt
|
o = s.taboption('basic', form.Value, 'param_opt',
|
||||||
|
_("Optional Parameter"),
|
||||||
o = s.taboption('basic', form.Value, 'param_opt', _("Optional Parameter"),
|
|
||||||
_("Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)"));
|
_("Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)"));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
// use_https
|
|
||||||
|
|
||||||
if (env['has_ssl']) {
|
if (env['has_ssl']) {
|
||||||
o = s.taboption('basic', form.Flag, 'use_https', _("Use HTTP Secure"),
|
o = s.taboption('basic', form.Flag, 'use_https',
|
||||||
|
_("Use HTTP Secure"),
|
||||||
_("Enable secure communication with DDNS provider"));
|
_("Enable secure communication with DDNS provider"));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
o = s.taboption('basic', form.Value, 'cacert',
|
o = s.taboption('basic', form.Value, 'cacert',
|
||||||
_("Path to CA-Certificate"),
|
_("Path to CA-Certificate"),
|
||||||
_("directory or path/file") + "<br />" +
|
_("directory or path/file")
|
||||||
_("or") + '<b>' + " IGNORE " + '</b>' +
|
+ "<br />" +
|
||||||
|
_("or")
|
||||||
|
+ '<b>' + " IGNORE " + '</b>' +
|
||||||
_("to run HTTPS without verification of server certificates (insecure)"));
|
_("to run HTTPS without verification of server certificates (insecure)"));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.depends("use_https", "1");
|
o.depends("use_https", "1");
|
||||||
|
@ -681,20 +664,16 @@ return view.extend({
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TAB Advanced
|
|
||||||
|
|
||||||
// ip_source
|
o = s.taboption('advanced', form.ListValue, 'ip_source',
|
||||||
|
_("IP address source"),
|
||||||
o = s.taboption('advanced', form.ListValue, 'ip_source', _("IP address source"),
|
|
||||||
_("Defines the source to read systems IP-Address from, that will be send to the DDNS provider"));
|
_("Defines the source to read systems IP-Address from, that will be send to the DDNS provider"));
|
||||||
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.default = "network";
|
o.default = "network";
|
||||||
o.value("network", _("Network"));
|
o.value("network", _("Network"));
|
||||||
o.value("web", _("URL"));
|
o.value("web", _("URL"));
|
||||||
o.value("interface", _("Interface"));
|
o.value("interface", _("Interface"));
|
||||||
o.value("script", _("Script"));
|
o.value("script", _("Script"));
|
||||||
|
|
||||||
o.write = function(section_id, formvalue) {
|
o.write = function(section_id, formvalue) {
|
||||||
switch(formvalue) {
|
switch(formvalue) {
|
||||||
case 'network':
|
case 'network':
|
||||||
|
@ -724,58 +703,50 @@ return view.extend({
|
||||||
return uci.set('ddns', section_id, 'ip_source', formvalue )
|
return uci.set('ddns', section_id, 'ip_source', formvalue )
|
||||||
};
|
};
|
||||||
|
|
||||||
// ip_network
|
o = s.taboption('advanced', widgets.NetworkSelect, 'ip_network',
|
||||||
|
_("Network"),
|
||||||
o = s.taboption('advanced', widgets.NetworkSelect, 'ip_network', _("Network"),
|
|
||||||
_("Defines the network to read systems IP-Address from"));
|
_("Defines the network to read systems IP-Address from"));
|
||||||
o.depends('ip_source','network');
|
o.depends('ip_source','network');
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.default = 'wan';
|
o.default = 'wan';
|
||||||
o.multiple = false;
|
o.multiple = false;
|
||||||
|
|
||||||
// ip_url
|
o = s.taboption('advanced', form.Value, 'ip_url',
|
||||||
|
_("URL to detect"),
|
||||||
o = s.taboption('advanced', form.Value, 'ip_url', _("URL to detect"),
|
_("Defines the Web page to read systems IP-Address from.")
|
||||||
_("Defines the Web page to read systems IP-Address from" + '<br />' +
|
+ '<br />' +
|
||||||
_('Example for IPv4' + ': http://checkip.dyndns.com') + '<br />' +
|
String.format('%s %s', _('Example for IPv4'), ': http://checkip.dyndns.com')
|
||||||
_('Example for IPv6' + ': http://checkipv6.dyndns.com')));
|
+ '<br />' +
|
||||||
|
String.format('%s %s', _('Example for IPv6'), ': http://checkipv6.dyndns.com'));
|
||||||
o.depends("ip_source", "web")
|
o.depends("ip_source", "web")
|
||||||
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
|
||||||
// ip_interface
|
o = s.taboption('advanced', widgets.DeviceSelect, 'ip_interface',
|
||||||
|
_("Interface"),
|
||||||
o = s.taboption('advanced', widgets.DeviceSelect, 'ip_interface', _("Interface"),
|
|
||||||
_("Defines the interface to read systems IP-Address from"));
|
_("Defines the interface to read systems IP-Address from"));
|
||||||
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.depends("ip_source", "interface")
|
o.depends("ip_source", "interface")
|
||||||
o.multiple = false;
|
o.multiple = false;
|
||||||
o.default = 'wan';
|
o.default = 'wan';
|
||||||
|
|
||||||
// ip_script
|
o = s.taboption('advanced', form.Value, 'ip_script',
|
||||||
|
_("Script"),
|
||||||
o = s.taboption('advanced', form.Value, 'ip_script', _("Script"),
|
|
||||||
_("User defined script to read systems IP-Address"));
|
_("User defined script to read systems IP-Address"));
|
||||||
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.depends("ip_source", "script")
|
o.depends("ip_source", "script")
|
||||||
o.placeholder = "/path/to/script.sh"
|
o.placeholder = "/path/to/script.sh"
|
||||||
|
|
||||||
// interface
|
o = s.taboption('advanced', widgets.DeviceSelect, 'interface',
|
||||||
|
_("Event Network"),
|
||||||
o = s.taboption('advanced', widgets.DeviceSelect, 'interface', _("Event Network"),
|
|
||||||
_("Network on which the ddns-updater scripts will be started"));
|
_("Network on which the ddns-updater scripts will be started"));
|
||||||
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.multiple = false;
|
o.multiple = false;
|
||||||
o.default = 'wan';
|
o.default = 'wan';
|
||||||
o.depends("ip_source", "web");
|
o.depends("ip_source", "web");
|
||||||
o.depends("ip_source", "script");
|
o.depends("ip_source", "script");
|
||||||
|
|
||||||
// interface_show
|
o = s.taboption('advanced', form.DummyValue, '_interface',
|
||||||
|
_("Event Network"),
|
||||||
o = s.taboption('advanced', form.DummyValue, '_interface', _("Event Network"),
|
|
||||||
_("Network on which the ddns-updater scripts will be started"));
|
_("Network on which the ddns-updater scripts will be started"));
|
||||||
o.depends("ip_source", "interface");
|
o.depends("ip_source", "interface");
|
||||||
o.depends("ip_source", "network");
|
o.depends("ip_source", "network");
|
||||||
|
@ -790,11 +761,11 @@ return view.extend({
|
||||||
return uci.set('ddns', section_id, 'interface', val);
|
return uci.set('ddns', section_id, 'interface', val);
|
||||||
};
|
};
|
||||||
|
|
||||||
// bind_network
|
|
||||||
|
|
||||||
if (env['has_bindnet']) {
|
if (env['has_bindnet']) {
|
||||||
o = s.taboption('advanced', widgets.ZoneSelect, 'bind_network', _("Bind Network"),
|
o = s.taboption('advanced', widgets.ZoneSelect, 'bind_network',
|
||||||
_('OPTIONAL: Network to use for communication') + '<br />' +
|
_("Bind Network"),
|
||||||
|
_('OPTIONAL: Network to use for communication')
|
||||||
|
+ '<br />' +
|
||||||
_("Network on which the ddns-updater scripts will be started"));
|
_("Network on which the ddns-updater scripts will be started"));
|
||||||
o.depends("ip_source", "web");
|
o.depends("ip_source", "web");
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
|
@ -802,22 +773,20 @@ return view.extend({
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// force_ipversion
|
|
||||||
|
|
||||||
if (env['has_forceip']) {
|
if (env['has_forceip']) {
|
||||||
o = s.taboption('advanced', form.Flag, 'force_ipversion', _("Force IP Version"),
|
o = s.taboption('advanced', form.Flag, 'force_ipversion',
|
||||||
|
_("Force IP Version"),
|
||||||
_('OPTIONAL: Force the usage of pure IPv4/IPv6 only communication.'));
|
_('OPTIONAL: Force the usage of pure IPv4/IPv6 only communication.'));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.rmempty = true;
|
o.rmempty = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dns_server
|
|
||||||
|
|
||||||
if (env['has_dnsserver']) {
|
if (env['has_dnsserver']) {
|
||||||
o = s.taboption("advanced", form.Value, "dns_server",
|
o = s.taboption("advanced", form.Value, "dns_server",
|
||||||
_("DNS-Server"),
|
_("DNS-Server"),
|
||||||
_("OPTIONAL: Use non-default DNS-Server to detect 'Registered IP'.") + "<br />" +
|
_("OPTIONAL: Use non-default DNS-Server to detect 'Registered IP'.")
|
||||||
|
+ "<br />" +
|
||||||
_("Format: IP or FQDN"));
|
_("Format: IP or FQDN"));
|
||||||
o.placeholder = "mydns.lan"
|
o.placeholder = "mydns.lan"
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
|
@ -825,8 +794,6 @@ return view.extend({
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// force_dnstcp
|
|
||||||
|
|
||||||
if (env['has_bindhost']) {
|
if (env['has_bindhost']) {
|
||||||
o = s.taboption("advanced", form.Flag, "force_dnstcp",
|
o = s.taboption("advanced", form.Flag, "force_dnstcp",
|
||||||
_("Force TCP on DNS"),
|
_("Force TCP on DNS"),
|
||||||
|
@ -836,25 +803,24 @@ return view.extend({
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// proxy
|
|
||||||
|
|
||||||
if (env['has_proxy']) {
|
if (env['has_proxy']) {
|
||||||
o = s.taboption("advanced", form.Value, "proxy", _("PROXY-Server"),
|
o = s.taboption("advanced", form.Value, "proxy",
|
||||||
_("OPTIONAL: Proxy-Server for detection and updates.") + "<br />" +
|
_("PROXY-Server"),
|
||||||
_("Format") + ": " + '<b>' + "[user:password@]proxyhost:port" + '</b>' + "<br />" +
|
_("OPTIONAL: Proxy-Server for detection and updates.")
|
||||||
_("IPv6 address must be given in square brackets") + ": " +
|
+ "<br />" +
|
||||||
'<b>' + " [2001:db8::1]:8080" + '</b>');
|
String.format('%s: <b>%s</b>', _("Format"), "[user:password@]proxyhost:port")
|
||||||
|
+ "<br />" +
|
||||||
|
String.format('%s: <b>%s</b>', _("IPv6 address must be given in square brackets"), "[2001:db8::1]:8080"));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.rmempty = true;
|
o.rmempty = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// use_syslog
|
o = s.taboption("advanced", form.ListValue, "use_syslog",
|
||||||
|
_("Log to syslog"),
|
||||||
o = s.taboption("advanced", form.ListValue, "use_syslog", _("Log to syslog"),
|
|
||||||
_("Writes log messages to syslog. Critical Errors will always be written to syslog."));
|
_("Writes log messages to syslog. Critical Errors will always be written to syslog."));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.placeholder = "2"
|
o.default = "2"
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.value("0", _("No logging"))
|
o.value("0", _("No logging"))
|
||||||
o.value("1", _("Info"))
|
o.value("1", _("Info"))
|
||||||
|
@ -862,9 +828,8 @@ return view.extend({
|
||||||
o.value("3", _("Warning"))
|
o.value("3", _("Warning"))
|
||||||
o.value("4", _("Error"))
|
o.value("4", _("Error"))
|
||||||
|
|
||||||
// use_logfile
|
o = s.taboption("advanced", form.Flag, "use_logfile",
|
||||||
|
_("Log to file"));
|
||||||
o = s.taboption("advanced", form.Flag, "use_logfile", _("Log to file"));
|
|
||||||
o.default = '1';
|
o.default = '1';
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
|
@ -874,14 +839,12 @@ return view.extend({
|
||||||
return uci.get('ddns', section_id, 'use_logfile');
|
return uci.get('ddns', section_id, 'use_logfile');
|
||||||
};
|
};
|
||||||
|
|
||||||
// TAB Timer
|
|
||||||
|
|
||||||
// check_interval
|
o = s.taboption("timer", form.Value, "check_interval",
|
||||||
o = s.taboption("timer", form.Value, "check_interval", _("Check Interval"));
|
_("Check Interval"));
|
||||||
o.placeholder = "30";
|
o.placeholder = "30";
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.datatype = 'uinteger';
|
o.datatype = 'uinteger';
|
||||||
|
|
||||||
o.validate = function(section_id, formvalue) {
|
o.validate = function(section_id, formvalue) {
|
||||||
var unit = this.section.children.filter(function(o) { return o.option == 'check_unit' })[0].formvalue(section_id),
|
var unit = this.section.children.filter(function(o) { return o.option == 'check_unit' })[0].formvalue(section_id),
|
||||||
time_to_sec = time_res[unit || 'minutes'] * formvalue;
|
time_to_sec = time_res[unit || 'minutes'] * formvalue;
|
||||||
|
@ -890,28 +853,26 @@ return view.extend({
|
||||||
return _('Values below 5 minutes == 300 seconds are not supported');
|
return _('Values below 5 minutes == 300 seconds are not supported');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// check_interval
|
o = s.taboption("timer", form.ListValue, "check_unit",
|
||||||
o = s.taboption("timer", form.ListValue, "check_unit",'Check Unit');
|
_('Check Unit'),
|
||||||
o.description = _("Interval unit to check for changed IP");
|
_("Interval unit to check for changed IP"));
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.default = "minutes"
|
o.default = "minutes"
|
||||||
o.value("seconds", _("seconds"));
|
o.value("seconds", _("seconds"));
|
||||||
o.value("minutes", _("minutes"));
|
o.value("minutes", _("minutes"));
|
||||||
o.value("hours", _("hours"));
|
o.value("hours", _("hours"));
|
||||||
|
|
||||||
// force_interval
|
o = s.taboption("timer", form.Value, "force_interval",
|
||||||
|
_("Force Interval"),
|
||||||
o = s.taboption("timer", form.Value, "force_interval", _("Force Interval"));
|
_("Interval to force updates send to DDNS Provider")
|
||||||
o.description = _("Interval to force updates send to DDNS Provider" + "<br />" +
|
+ "<br />" +
|
||||||
"Setting this parameter to 0 will force the script to only run once");
|
_("Setting this parameter to 0 will force the script to only run once"));
|
||||||
o.placeholder = "72";
|
o.placeholder = "72";
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.datatype = 'uinteger';
|
o.datatype = 'uinteger';
|
||||||
|
|
||||||
o.validate = function(section_id, formvalue) {
|
o.validate = function(section_id, formvalue) {
|
||||||
|
|
||||||
if (!formvalue)
|
if (!formvalue)
|
||||||
|
@ -929,10 +890,9 @@ return view.extend({
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// force_unit
|
o = s.taboption("timer", form.ListValue, "force_unit",
|
||||||
|
_('Force Unit'),
|
||||||
o = s.taboption("timer", form.ListValue, "force_unit",'Force Unit');
|
_("Interval unit to force updates send to DDNS Provider"));
|
||||||
o.description = _("Interval unit to force updates send to DDNS Provider");
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.default = "minutes"
|
o.default = "minutes"
|
||||||
|
@ -940,39 +900,35 @@ return view.extend({
|
||||||
o.value("hours", _("hours"));
|
o.value("hours", _("hours"));
|
||||||
o.value("days", _("days"));
|
o.value("days", _("days"));
|
||||||
|
|
||||||
// retry_count
|
o = s.taboption("timer", form.Value, "retry_count",
|
||||||
|
_("Error Retry Counter"),
|
||||||
o = s.taboption("timer", form.Value, "retry_count", _("Error Retry Counter"));
|
_("On Error the script will stop execution after given number of retrys")
|
||||||
o.description = _("On Error the script will stop execution after given number of retrys")
|
+ "<br />" +
|
||||||
+ "<br />"
|
_("The default setting of '0' will retry infinite."));
|
||||||
+ _("The default setting of '0' will retry infinite.");
|
|
||||||
o.placeholder = "0";
|
o.placeholder = "0";
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.datatype = 'uinteger';
|
o.datatype = 'uinteger';
|
||||||
|
|
||||||
// retry_interval
|
o = s.taboption("timer", form.Value, "retry_interval",
|
||||||
|
_("Error Retry Interval"),
|
||||||
o = s.taboption("timer", form.Value, "retry_interval", _("Error Retry Interval"));
|
_("On Error the script will stop execution after given number of retrys")
|
||||||
o.description = _("On Error the script will stop execution after given number of retrys")
|
+ "<br />" +
|
||||||
+ "<br />"
|
_("The default setting of '0' will retry infinite."));
|
||||||
+ _("The default setting of '0' will retry infinite.");
|
|
||||||
o.placeholder = "60";
|
o.placeholder = "60";
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.datatype = 'uinteger';
|
o.datatype = 'uinteger';
|
||||||
|
|
||||||
// retry_unit
|
o = s.taboption("timer", form.ListValue, "retry_unit",
|
||||||
|
_('Retry Unit'),
|
||||||
o = s.taboption("timer", form.ListValue, "retry_unit",'Retry Unit');
|
_("On Error the script will retry the failed action after given time"));
|
||||||
o.description = _("On Error the script will retry the failed action after given time");
|
|
||||||
o.modalonly = true;
|
o.modalonly = true;
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.default = "seconds"
|
o.default = "seconds"
|
||||||
o.value("seconds", _("seconds"));
|
o.value("seconds", _("seconds"));
|
||||||
o.value("minutes", _("minutes"));
|
o.value("minutes", _("minutes"));
|
||||||
|
|
||||||
// TAB logview
|
|
||||||
|
|
||||||
o = s.taboption("logview", form.DummyValue, '_read_log', '');
|
o = s.taboption("logview", form.DummyValue, '_read_log', '');
|
||||||
o.depends('use_logfile','1');
|
o.depends('use_logfile','1');
|
||||||
|
|
Loading…
Reference in a new issue