diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm index 6ddc84f..7d19b1d 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm @@ -19,74 +19,6 @@ package SrvMngr::Controller::Ddclient; # # Documentation: https://wiki.contribs.org/Ddclient # -#---------------------------------------------------------------------- -# -# ddclient 3.9.1 Supportted services -# -#DynDNS.com - See http://www.dyndns.com for details on obtaining a free account. -#Hammernode - See http://www.hn.org for details on obtaining a free account. -#Zoneedit - See http://www.zoneedit.com for details. -#EasyDNS - See http://www.easydns.com for details. -#NameCheap - See http://www.namecheap.com for details -#DslReports - See http://www.dslreports.com for details -#Sitelutions - See http://www.sitelutions.com for details -#Loopia - See http://www.loopia.se for details -#Noip - See http://www.noip.com/ for details -#Freedns - See http://freedns.afraid.org/ for details -#ChangeIP - See http://www.changeip.com/ for details -#dtdns - See http://www.dtdns.com/ for details -#nsupdate - See nsupdate(1) and ddns-confgen(8) for details -#CloudFlare - See https://www.cloudflare.com/ for details -#Google - See http://www.google.com/domains for details -#Duckdns - See https://duckdns.org/ for details -#Freemyip - See https://freemyip.com for details -#woima.fi - See https://woima.fi/ for details -#Yandex - See https://domain.yandex.com/ for details -#DNS Made Easy - See https://dnsmadeeasy.com/ for details -#DonDominio - See https://www.dondominio.com for details -#NearlyFreeSpeech.net - See https://www.nearlyfreespeech.net/services/dns for details -#OVH - See https://www.ovh.com for details -#ClouDNS - See https://www.cloudns.net - -# ddclient 3.11.1 Supported Services -# 1984:https://kb.1984hosting.com/doku.php?id=freedns -# changeip: https://changeip.com -# cloudflare: https://cloudflare.com -# cloudns: https://cloudns.com -# digitalocean: https://digitalocean.com -# dinahosting: https://dinahosting.com -# dnsexit: https://dnsexit.com/ -# dnsmadeeasy: https://dnsmadeeasy.com -# domeneshop: https://domeneshop.com -# dondominio: https://dondominio.com -# dslreports: https://www.dslreports.com/ -# duckdns: https://duckdns.com -# dyndns1:https://account.dyn.com/ -# dyndns2: https://account.dyn.com/ -# easydns: https://easydns.com -# enom: https://enom.com -# freedns: http://freedns.com -# freemyip: https://freemyip.com -# gandi: https://gandi.com -# godaddy: https://godaddy.com -# googledomains: https://googledomains.com -# hetzner: https://hetzner.com -# infomaniak: https://infomaniak.com -# keysystems: https://keysystems.com -# mythicdyn: https://www.mythic-beasts.com/support/api/dnsv2/dynamic-dns -# namecheap: https://namecheap.com -# nfsn: http://nfsn.com -# njalla: https://njalla.com -# noip: https://noip.com -# nsupdate: http://nsupdate.com -# ovh: https://ovh.com -# porkbun: https://porkbun.com -# regfishde: Cannot find link for this one -# sitelutions: https://sitelutions.com -# woima: http://woima.com -# yandex: https://yandex.com -# zoneedit: https://www.zoneedit.com/dynamic-dns/ - use strict; use warnings; use Mojo::Base 'Mojolicious::Controller'; @@ -311,7 +243,7 @@ sub do_display { [ $c->l('Router/Firewall') => 'router' ], [ $c->l('Interface') => 'if' ], [ $c->l('IP') => 'ip' ], - [ $c->l('Command') => 'cmdv4' ] + [ $c->l('Command') => 'cmd' ] ] ); @@ -656,7 +588,7 @@ sub get_params { my $ssl = $ddretrieve->prop('SSL') || 'yes'; my $method = $ddretrieve->prop('method') || 'web'; my $Extinterface = $ddretrieve->prop('Extinterface') || ''; - my $cmd = $ddretrieve->prop('cmd') || ''; + my $cmd = $ddretrieve->prop('cmd') || '/usr/sbin/e-smith/getmyip'; my $forceIP = $ddretrieve->prop('ForceIP') || ''; my $fwlogin = $ddretrieve->prop('fwlogin') || ''; my $fwpassword = $ddretrieve->prop('fwpassword') || ''; diff --git a/root/usr/share/smanager/themes/default/public/js/ddclient.js b/root/usr/share/smanager/themes/default/public/js/ddclient.js new file mode 100644 index 0000000..df7d4cd --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/js/ddclient.js @@ -0,0 +1,62 @@ +function showPass() { + var x = document.getElementById("ddcPass"); + if (x.type === "password") { + x.type = "text"; + } else { + x.type = "password"; + } +} + +document.addEventListener('DOMContentLoaded', function() { + // Run on page load + SelectInput_custom(); + + // Attach onchange event to the select element + var dnsSelect = document.getElementById('dns'); + if (dnsSelect) { + dnsSelect.addEventListener('change', SelectInput_custom); + } +}); + + +function SelectInput_custom() { + var method = document.querySelector("#dns"); + const types=['custom']; + types.forEach((type)=>{ + var service = document.querySelector(`.${type}`); + if (service != null) { + if (method.value == type) { + service.style.display = 'block'; + } else { + service.style.display = 'none'; + } + } + }) +} + +document.addEventListener('DOMContentLoaded', function() { + // Run on page load (replaces onload) + SelectInput_params(); + + // Attach onchange event (replaces inline onchange) + var dnsSelect = document.getElementById('retrievemethod'); + if (dnsSelect) { + dnsSelect.addEventListener('change', SelectInput_params); + } +}); + + +function SelectInput_params() { + var method = document.querySelector("#retrievemethod"); + const types=['smeIF','smeCMD','web','router','if','ip','cmd','custom']; + types.forEach((type)=>{ + var service = document.querySelector(`.${type}`); + if (service != null) { + if (method.value == type) { + service.style.display = 'block'; + } else { + service.style.display = 'none'; + } + } + }) +} \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/ddclient.html.ep b/root/usr/share/smanager/themes/default/templates/ddclient.html.ep index f09c67b..7516f8f 100644 --- a/root/usr/share/smanager/themes/default/templates/ddclient.html.ep +++ b/root/usr/share/smanager/themes/default/templates/ddclient.html.ep @@ -1,6 +1,7 @@ % layout 'default', title => "Sme server 2 - Dynamic Clients", share_dir => './'; % content_for 'module' => begin +%= javascript '/js/ddclient.js'