'require rpc';
'require fs';
'require form';
+'require network';
'require tools.widgets as widgets';
return view.extend({
}, this))
},
+ /*
+ * Figure out what the wan interface on the device is.
+ * Determine if the physical device exist, or if we should use an alias.
+ */
+ callGetWanInterface: function(m, ev) {
+ return network.getDevice('wan').then(dev => dev.getName())
+ .catch(err => network.getNetwork('wan').then(net => '@' + net.getName()))
+ .catch(err => null);
+ },
+
/*
* Check whether or not the service is supported.
* If the script doesn't find any JSON, assume a 'service on demand' install.
this.callDDnsGetStatus(),
this.callDDnsGetEnv(),
this.callGenServiceList(),
- uci.load('ddns')
+ uci.load('ddns'),
+ this.callGetWanInterface()
]);
},
var status = data[1] || [];
var env = data[2] || [];
var logdir = uci.get('ddns', 'global', 'ddns_logdir') || "/var/log/ddns";
+ var wan_interface = data[5];
var _this = this;
o.modalonly = true;
o.depends("ip_source", "interface")
o.multiple = false;
- o.default = 'wan';
+ o.default = wan_interface;
o = s.taboption('advanced', form.Value, 'ip_script',
_("Script"),