Add list of singleton pamraeters to custom, refine letsencrypt json

This commit is contained in:
2024-11-04 17:08:38 +00:00
parent d5a771f6f3
commit f238fcfa70
27 changed files with 868 additions and 251 deletions

View File

@@ -75,12 +75,22 @@ sub main {
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $$${controldb | db | 'cdb'}; #pickup local or global db or Default to config
<tal:block tal:repeat="dbentry dbentries">
$$${prefix}_data{${dbentry}} = $db->prop('${dbentry}') || ${dbdefault | ""} || "";
<tal:block tal:repeat="dbfield dbfields">
$$${prefix}_data{${dbfield}} = $db->prop('${dbfield}') || ${dbdefault | ""} || "";
</tal:block>
#pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = get_data_for_panel_${firstPanel}();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$$${prefix}_data{$key} = $value;
}
# and table control fields
<tal:block tal:repeat="tablecontrol tablecontrols"> $c->stash(${tablecontrol}=>$c->get_${tablecontrol}());
<tal:block tal:repeat="tablecontrol tablecontrols">
$c->stash(${tablecontrol}=>$c->get_${tablecontrol}());
</tal:block>
$c->stash(
@@ -169,7 +179,7 @@ sub do_update {
</tal:block>
# and call any signal-events needed
# Setup shared data and call panel
$c->stash(
title => $title,
@@ -180,7 +190,7 @@ sub do_update {
} else {
$$${prefix}_data{'trt'} = '${NextPanel | "none"}';
}
$c->render("${lcPackageName}");
$c->do_display()
}
}
@@ -236,6 +246,25 @@ sub do_display {
# Where to go now
$$${prefix}_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
<tal:block tal:repeat="panel panels">
if ($trt eq '${panel}'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = get_data_for_panel_${panel}();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$$${prefix}_data{$key} = $value;
}
}
</tal:block>
# and table control fields
<tal:block tal:repeat="tablecontrol tablecontrols">
$c->stash(${tablecontrol}=>$c->get_${tablecontrol}());
</tal:block>
# Data for panel
$c->stash(
title => $title,
@@ -243,4 +272,4 @@ sub do_display {
);
$c->render("${lcPackageName}");
}
1;
1;