mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
added freedns provider
This commit is contained in:
parent
98506f0fdd
commit
a57f86315e
@ -103,7 +103,8 @@ class ConfigureForm(forms.Form):
|
|||||||
('1', 'GnuDIP'),
|
('1', 'GnuDIP'),
|
||||||
('2', 'noip.com'),
|
('2', 'noip.com'),
|
||||||
('3', 'selfhost.bz'),
|
('3', 'selfhost.bz'),
|
||||||
('4', 'other update URL'))
|
('4', 'freedns.afraid.org'),
|
||||||
|
('5', 'other update URL'))
|
||||||
|
|
||||||
enabled = forms.BooleanField(label=_('Enable Dynamic DNS'),
|
enabled = forms.BooleanField(label=_('Enable Dynamic DNS'),
|
||||||
required=False)
|
required=False)
|
||||||
@ -294,7 +295,7 @@ def get_status():
|
|||||||
if not status['dynamicdns_server'] and not status['dynamicdns_update_url']:
|
if not status['dynamicdns_server'] and not status['dynamicdns_update_url']:
|
||||||
status['service_type'] = '1'
|
status['service_type'] = '1'
|
||||||
elif not status['dynamicdns_server'] and status['dynamicdns_update_url']:
|
elif not status['dynamicdns_server'] and status['dynamicdns_update_url']:
|
||||||
status['service_type'] = '4'
|
status['service_type'] = '5'
|
||||||
else:
|
else:
|
||||||
status['service_type'] = '1'
|
status['service_type'] = '1'
|
||||||
|
|
||||||
|
|||||||
@ -41,13 +41,20 @@
|
|||||||
|
|
||||||
{% block page_js %}
|
{% block page_js %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
|
var SELFHOST = 'https://carol.selfhost.de/update?username=<User>&' +
|
||||||
|
'password=<Pass>&myip=<Ip>'
|
||||||
|
var NOIP = 'http://dynupdate.no-ip.com/nic/update?hostname=' +
|
||||||
|
'<Domain>&myip=<Ip>'
|
||||||
|
var FREEDNS = 'http://freedns.afraid.org/dynamic/update.php?' +
|
||||||
|
'_YOURAPIKEYHERE_'
|
||||||
$('#dynamicdns-no-js').hide();
|
$('#dynamicdns-no-js').hide();
|
||||||
$('.form-group').hide();
|
$('.form-group').hide();
|
||||||
$('#id_dynamicdns-enabled').closest('.form-group').show();
|
$('#id_dynamicdns-enabled').closest('.form-group').show();
|
||||||
if ($('#id_dynamicdns-enabled').prop('checked')) {
|
if ($('#id_dynamicdns-enabled').prop('checked')) {
|
||||||
show_all();
|
show_all();
|
||||||
configure_dropdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#id_dynamicdns-enabled').change(function() {
|
$('#id_dynamicdns-enabled').change(function() {
|
||||||
@ -79,11 +86,6 @@
|
|||||||
|
|
||||||
function configure_dropdown()
|
function configure_dropdown()
|
||||||
{
|
{
|
||||||
var SELFHOST = 'https://carol.selfhost.de/update?username=<User>&' +
|
|
||||||
'password=<Pass>&myip=<Ip>'
|
|
||||||
var NOIP = 'http://dynupdate.no-ip.com/nic/update?hostname=<' +
|
|
||||||
'Domain>&myip=<Ip>'
|
|
||||||
|
|
||||||
if ($("#id_dynamicdns-service_type option:selected").text() == "GnuDIP") {
|
if ($("#id_dynamicdns-service_type option:selected").text() == "GnuDIP") {
|
||||||
$('#id_dynamicdns-dynamicdns_update_url').closest('.form-group').hide();
|
$('#id_dynamicdns-dynamicdns_update_url').closest('.form-group').hide();
|
||||||
$('#id_dynamicdns-disable_SSL_cert_check').closest('.form-group').hide();
|
$('#id_dynamicdns-disable_SSL_cert_check').closest('.form-group').hide();
|
||||||
@ -103,6 +105,9 @@
|
|||||||
if ($("#id_dynamicdns-service_type option:selected").text() == "selfhost.bz") {
|
if ($("#id_dynamicdns-service_type option:selected").text() == "selfhost.bz") {
|
||||||
$('#id_dynamicdns-dynamicdns_update_url').val(SELFHOST);
|
$('#id_dynamicdns-dynamicdns_update_url').val(SELFHOST);
|
||||||
}
|
}
|
||||||
|
if ($("#id_dynamicdns-service_type option:selected").text() == "freedns.afraid.org") {
|
||||||
|
$('#id_dynamicdns-dynamicdns_update_url').val(FREEDNS);
|
||||||
|
}
|
||||||
if ($("#id_dynamicdns-service_type option:selected").text() == "other update URL") {
|
if ($("#id_dynamicdns-service_type option:selected").text() == "other update URL") {
|
||||||
$('#id_dynamicdns-dynamicdns_update_url').val('');
|
$('#id_dynamicdns-dynamicdns_update_url').val('');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user