* 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]
This commit is contained in:
parent
6dc6143642
commit
6b207dec6b
@ -322,9 +322,9 @@ sub do_display {
|
|||||||
domains => \@domains,
|
domains => \@domains,
|
||||||
freedomains => \@FreeDomains,
|
freedomains => \@FreeDomains,
|
||||||
methodlabels => $Labels,
|
methodlabels => $Labels,
|
||||||
dnslabels => get_dns_labels($c),
|
dnslabels => ddclient_protocol_options($c),
|
||||||
devices => get_devices_names($c),
|
devices => ddclient_device_options($c),
|
||||||
webservices => get_web_services_names($c),
|
webservices => ddclient_web_services_options($c),
|
||||||
emptydom => $emptydom,
|
emptydom => $emptydom,
|
||||||
emptycust => $emptycust
|
emptycust => $emptycust
|
||||||
);
|
);
|
||||||
@ -1012,4 +1012,49 @@ sub performDeleteCustom {
|
|||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Routines to extract protocols, services and devices from ddclient and present them for select options
|
||||||
|
sub ddclient_web_services_options {
|
||||||
|
my $output = qx(ddclient -list-web-services 2>/dev/null);
|
||||||
|
my @options;
|
||||||
|
|
||||||
|
for my $line (split /\n/, $output) {
|
||||||
|
next unless $line =~ /^(\S+)\s+(\S+)/;
|
||||||
|
my ($service, $url) = ($1, $2);
|
||||||
|
# You can use the service name as both label and value, or include the URL in the label for clarity
|
||||||
|
push @options, [ "$service ($url)", $service ];
|
||||||
|
}
|
||||||
|
|
||||||
|
return \@options;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub ddclient_protocol_options {
|
||||||
|
my $output = qx(ddclient -list-protocols 2>/dev/null);
|
||||||
|
my @options;
|
||||||
|
|
||||||
|
for my $line (split /\n/, $output) {
|
||||||
|
$line =~ s/^\s+|\s+$//g; # Trim whitespace
|
||||||
|
next unless $line; # Skip empty lines
|
||||||
|
push @options, [ $line, $line ]; # [label, value]
|
||||||
|
}
|
||||||
|
|
||||||
|
return \@options;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub ddclient_device_options {
|
||||||
|
my $output = qx(ddclient -list-devices 2>/dev/null);
|
||||||
|
my @options;
|
||||||
|
|
||||||
|
for my $line (split /\n/, $output) {
|
||||||
|
$line =~ s/^\s+|\s+$//g; # Trim whitespace
|
||||||
|
next unless $line; # Skip empty lines
|
||||||
|
my ($id, $name) = split(/\s+/, $line, 2);
|
||||||
|
next unless $id && $name;
|
||||||
|
push @options, [ $name, $id ]; # [label, value]
|
||||||
|
}
|
||||||
|
|
||||||
|
return \@options;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
@ -3,7 +3,7 @@
|
|||||||
% content_for 'module' => begin
|
% content_for 'module' => begin
|
||||||
<div id="module" class="module ddclient-panel">
|
<div id="module" class="module ddclient-panel">
|
||||||
|
|
||||||
% if ($config->{debug} == 1) {
|
% if (config->{debug} == 1) {
|
||||||
<p>
|
<p>
|
||||||
%= dumper $c->current_route
|
%= dumper $c->current_route
|
||||||
</p>
|
</p>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
%define name smeserver-ddclient
|
%define name smeserver-ddclient
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 1
|
%define release 2
|
||||||
|
|
||||||
Summary: ddclient panel for SME Server
|
Summary: ddclient panel for SME Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
@ -25,6 +25,9 @@ Requires: smeserver-formmagick
|
|||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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]
|
||||||
|
|
||||||
* Sat May 03 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
|
* Sat May 03 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
|
||||||
- Take out restart for createlinks for bootstrap-console-save [SME: 12998]
|
- Take out restart for createlinks for bootstrap-console-save [SME: 12998]
|
||||||
- and update version
|
- and update version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user