* Sat May 10 2025 Brian Read <brianr@koozali.org> 11.0.0-3.sme
- Get javascript working and password visible icon [SME: 13001] - Fix missing cmd in panel - Delete out of date list of protocols/device/services etc from controller source
This commit is contained in:
		@@ -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') || '';
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										62
									
								
								root/usr/share/smanager/themes/default/public/js/ddclient.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								root/usr/share/smanager/themes/default/public/js/ddclient.js
									
									
									
									
									
										Normal file
									
								
							@@ -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';
 | 
			
		||||
		  }
 | 
			
		||||
	  }
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
% layout 'default', title => "Sme server 2 - Dynamic Clients", share_dir => './';
 | 
			
		||||
 | 
			
		||||
% content_for 'module' => begin
 | 
			
		||||
%= javascript '/js/ddclient.js'
 | 
			
		||||
<div id="module" class="module ddclient-panel">
 | 
			
		||||
 | 
			
		||||
    % if (config->{debug} == 1) {
 | 
			
		||||
 
 | 
			
		||||
@@ -39,19 +39,7 @@
 | 
			
		||||
		<span class=label>
 | 
			
		||||
			%=l 'PASSWORD_LABEL'
 | 
			
		||||
		</span><span class=data>
 | 
			
		||||
			%=password_field 'password',id=>"ddcPass"
 | 
			
		||||
			%=label_for show=>"Show"
 | 
			
		||||
			%=check_box show=>1,onclick=>"showPass()",style=>"vertical-align:middle;"
 | 
			
		||||
			%= javascript begin
 | 
			
		||||
			function showPass() {
 | 
			
		||||
			  var x = document.getElementById("ddcPass");
 | 
			
		||||
			  if (x.type === "password") {
 | 
			
		||||
				x.type = "text";
 | 
			
		||||
			  } else {
 | 
			
		||||
				x.type = "password";
 | 
			
		||||
			  }
 | 
			
		||||
			} 
 | 
			
		||||
			% end
 | 
			
		||||
			%=password_field 'password',id=>"ddcPass", class=>'sme-password'
 | 
			
		||||
		</span><br>
 | 
			
		||||
		<span class=label>
 | 
			
		||||
			%=l 'MX'
 | 
			
		||||
@@ -60,6 +48,4 @@
 | 
			
		||||
		</span><br>	
 | 
			
		||||
		%= submit_button "$btn", class => 'action'
 | 
			
		||||
	% end    
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,9 +1,4 @@
 | 
			
		||||
<div id='modifydomain'>
 | 
			
		||||
  <script>
 | 
			
		||||
    window.onload = function() {
 | 
			
		||||
      SelectInput();
 | 
			
		||||
    };
 | 
			
		||||
  </script>
 | 
			
		||||
     <h2>
 | 
			
		||||
     %= l 'MODIFY_DESCRIPTION'
 | 
			
		||||
     </h2><br>
 | 
			
		||||
@@ -34,23 +29,7 @@
 | 
			
		||||
			%=l 'SERVERS_LABEL'
 | 
			
		||||
		</span><span class=data>
 | 
			
		||||
		    % param dns=>$ddc_datas->{"Domain_details"}->{"dns"};
 | 
			
		||||
			%=select_field dns=>$dnslabels,id=>"dns",onchange=>"SelectInput()",onload=>"SelectInput()"
 | 
			
		||||
			%= javascript begin
 | 
			
		||||
			function SelectInput() {
 | 
			
		||||
			  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';
 | 
			
		||||
					  }
 | 
			
		||||
				  }
 | 
			
		||||
		      })
 | 
			
		||||
			}
 | 
			
		||||
		 %end 
 | 
			
		||||
			%=select_field dns=>$dnslabels,id=>"dns",class=>'selectinputcustom'
 | 
			
		||||
		</span><br>
 | 
			
		||||
 | 
			
		||||
        %# Dependant on the custom choice from above       
 | 
			
		||||
@@ -79,19 +58,7 @@
 | 
			
		||||
			%=l 'PASSWORD_LABEL'
 | 
			
		||||
		</span><span class=data>
 | 
			
		||||
		    % param password=>$ddc_datas->{"Domain_details"}->{"password"};
 | 
			
		||||
			%=password_field 'password',id=>"ddcPass",value=>$ddc_datas->{"Domain_details"}->{"password"}
 | 
			
		||||
			%=label_for show=>"Show"
 | 
			
		||||
			%=check_box show=>1,onclick=>"showPass()",style=>"vertical-align:middle;"
 | 
			
		||||
			%= javascript begin
 | 
			
		||||
			function showPass() {
 | 
			
		||||
			  var x = document.getElementById("ddcPass");
 | 
			
		||||
			  if (x.type === "password") {
 | 
			
		||||
				x.type = "text";
 | 
			
		||||
			  } else {
 | 
			
		||||
				x.type = "password";
 | 
			
		||||
			  }
 | 
			
		||||
			} 
 | 
			
		||||
			% end
 | 
			
		||||
			%=password_field 'password',id=>"ddcPass",value=>$ddc_datas->{"Domain_details"}->{"password"}, class=>'sme-password'
 | 
			
		||||
		</span><br>
 | 
			
		||||
		<span class=label>
 | 
			
		||||
			%=l 'MX'
 | 
			
		||||
@@ -103,6 +70,4 @@
 | 
			
		||||
		%= hidden_field Route=>$c->current_route
 | 
			
		||||
		%= submit_button "$btn", class => 'action'
 | 
			
		||||
	% end    
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,9 +1,4 @@
 | 
			
		||||
<div id='paramlist'>
 | 
			
		||||
  <script>
 | 
			
		||||
    window.onload = function() {
 | 
			
		||||
      SelectInput();
 | 
			
		||||
    };
 | 
			
		||||
  </script>
 | 
			
		||||
     <h2>
 | 
			
		||||
     %= l 'Params_for_IP_Retrieval'
 | 
			
		||||
     </h2>
 | 
			
		||||
@@ -25,23 +20,7 @@
 | 
			
		||||
			%=l 'RETRIEVE_METHOD'
 | 
			
		||||
		</span><span class=data>
 | 
			
		||||
		    % param retrievemethod=>$ddc_datas->{"params"}->{"method"} unless param 'retrievemethod';
 | 
			
		||||
			%=select_field  retrievemethod=>$methodlabels,id=>"retrievemethod",onchange=>"SelectInput()"
 | 
			
		||||
			%= javascript begin
 | 
			
		||||
			function SelectInput() {
 | 
			
		||||
			  var method = document.querySelector("#retrievemethod");
 | 
			
		||||
			  const types=['smeIF','smeCMD','web','router','if','ip','cmdv4','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';
 | 
			
		||||
					  }
 | 
			
		||||
				  }
 | 
			
		||||
		      })
 | 
			
		||||
			} 
 | 
			
		||||
			% end
 | 
			
		||||
			%=select_field  retrievemethod=>$methodlabels,id=>"retrievemethod"
 | 
			
		||||
		</span><br>
 | 
			
		||||
		%# 
 | 
			
		||||
		%# From here the one that is shown depends on the choice above
 | 
			
		||||
@@ -65,19 +44,7 @@
 | 
			
		||||
				%=l 'Router password'
 | 
			
		||||
			</span><span class=data>
 | 
			
		||||
				% param retrieverouterpassword=>$ddc_datas->{"params"}->{"FWPassword"} unless param 'retrieverouterpassword';
 | 
			
		||||
				%=password_field 'retrieverouterpassword', id=>'ddcPass'
 | 
			
		||||
				%=label_for show=>"Show"
 | 
			
		||||
				%=check_box show=>1,onclick=>"showPass()",style=>"vertical-align:middle;"
 | 
			
		||||
				%= javascript begin
 | 
			
		||||
				function showPass() {
 | 
			
		||||
				  var x = document.getElementById("ddcPass");
 | 
			
		||||
				  if (x.type === "password") {
 | 
			
		||||
					x.type = "text";
 | 
			
		||||
				  } else {
 | 
			
		||||
					x.type = "password";
 | 
			
		||||
				  }
 | 
			
		||||
				} 
 | 
			
		||||
				% end
 | 
			
		||||
				%=password_field 'retrieverouterpassword', id=>'ddcPass', class=>'sme-password'
 | 
			
		||||
			</span><br>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
@@ -102,11 +69,11 @@
 | 
			
		||||
		</div>
 | 
			
		||||
		
 | 
			
		||||
		%# Only if "cmd" is chosen
 | 
			
		||||
		<div class=cmdv4>
 | 
			
		||||
		<div class=cmd>
 | 
			
		||||
			<span class=label cmd>
 | 
			
		||||
				%=l 'RETRIEVE_CMD'
 | 
			
		||||
			</span><span class=data cmd>
 | 
			
		||||
				% param retrievecmd=>$ddc_datas->{"params"}->{"cmdv4"} unless param 'retrievecmd';
 | 
			
		||||
				% param retrievecmd=>$ddc_datas->{"params"}->{"cmd"} unless param 'retrievecmd';
 | 
			
		||||
				%=text_field  'retrievecmd'
 | 
			
		||||
			</span><br>
 | 
			
		||||
		</div>
 | 
			
		||||
@@ -133,4 +100,4 @@
 | 
			
		||||
		
 | 
			
		||||
		%= submit_button "$btn", class => 'action'
 | 
			
		||||
	% end    
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 | 
			
		||||
%define name smeserver-ddclient
 | 
			
		||||
%define version 11.0.0
 | 
			
		||||
%define release 2
 | 
			
		||||
%define release 3
 | 
			
		||||
 | 
			
		||||
Summary: ddclient panel for SME Server
 | 
			
		||||
Name: %{name}
 | 
			
		||||
@@ -25,6 +25,11 @@ Requires: smeserver-formmagick
 | 
			
		||||
AutoReqProv: no
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
* Sat May 10 2025 Brian Read <brianr@koozali.org> 11.0.0-3.sme
 | 
			
		||||
- Get javascript working and password visible icon [SME: 13001]
 | 
			
		||||
- Fix missing cmd in panel
 | 
			
		||||
- Delete out of date list of protocols/device/services etc from controller source
 | 
			
		||||
 | 
			
		||||
* Sat May 10 2025 Brian Read <brianr@koozali.org> 11.0.0-2.sme
 | 
			
		||||
- correct $config (remove $) and get protocols, services and devices by interrogating ddclient [SME: 13001]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user