Update letsencrypt and take out spurious chars in html cxontrols

This commit is contained in:
2024-11-27 16:18:56 +00:00
parent edb245df07
commit 1c275912e3
9 changed files with 100 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
package SrvMngr::Controller::Letsencrypt;
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-17 14:48:52
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-27 16:15:50
#
#----------------------------------------------------------------------
# heading : Network
@@ -127,7 +127,8 @@ sub do_update {
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
my %lets_data = ();
my $title = $c->l('lets_Letsencrypt_certificate');
@@ -180,10 +181,16 @@ sub do_update {
}
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
if ($ret ne "ok"){
# lets_data{'trt'} = $thispanel;
# $c->stash(error => $c->l($ret));
# $c->stash(
# title => $title,
# modul => $modul,
# lets_data => \%lets_data
# );
# $c->render( template => "letsencrypt" );
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
@@ -193,7 +200,12 @@ sub do_update {
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash( success => $c->l('lets_LIST_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
@@ -205,7 +217,12 @@ sub do_update {
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash( success => $c->l('lets_PARAMS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
@@ -217,7 +234,12 @@ sub do_update {
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash( success => $c->l('lets_CHECKALLDOMAINS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
@@ -229,7 +251,12 @@ sub do_update {
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash( success => $c->l('lets_CHECKALLENABLEDDOMAINS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
@@ -241,26 +268,31 @@ sub do_update {
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("letsencrypt");
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash( success => $c->l('lets_CHECKONEDOMAIN_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
$c->stash(
title => $title,
lets_data => \%lets_data
);
if ('none' eq 'none') {
$lets_data{'trt'} = 'LIST';
} else {
$lets_data{'trt'} = 'none';
}
$c->do_display()
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render( template => "letsencrypt" );
}
}
@@ -276,11 +308,12 @@ sub do_display {
#load up returned hash into prefix_data
#render - to called panel
my $c = shift;
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
my %lets_data = ();
my $title = $c->l('lets_Letsencrypt_certificate');
my $modul = "";
# Accessing all parameters
my %params = $c->req->params->to_hash;
@@ -296,35 +329,37 @@ sub do_display {
# $lets_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'LIST'; #Indicates where to go now
# the value of trt will tell you which panel has returned
if (! $trt){
my $trt = $c->param('trt') || 'LIST'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'LIST'){
#Validate form parameters for panel LIST
#Validate Get selected row (if applicable) LIST
%selectedrow = $c->get_selected_LIST($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
#Validate Get selected row (if applicable) PARAMS
%selectedrow = $c->get_selected_PARAMS($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'CHECKALLDOMAINS'){
#Validate form parameters for panel CHECKALLDOMAINS
#Validate Get selected row (if applicable) CHECKALLDOMAINS
%selectedrow = $c->get_selected_CHECKALLDOMAINS($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'CHECKALLENABLEDDOMAINS'){
#Validate form parameters for panel CHECKALLENABLEDDOMAINS
#Validate Get selected row (if applicable) CHECKALLENABLEDDOMAINS
%selectedrow = $c->get_selected_CHECKALLENABLEDDOMAINS($lets_data{'Selected'},$is_new_record);
}
if ($trt eq 'CHECKONEDOMAIN'){
#Validate form parameters for panel CHECKONEDOMAIN
#Validate Get selected row (if applicable) CHECKONEDOMAIN
%selectedrow = $c->get_selected_CHECKONEDOMAIN($lets_data{'Selected'},$is_new_record);
}
@@ -401,8 +436,9 @@ sub do_display {
# Data for panel
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render("letsencrypt");
$c->render(template => "letsencrypt");
}
1;