From c7dc45ccb57e0cac68ab24fa6422cd199ef027a2 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Mon, 20 Jan 2025 12:04:42 +0000 Subject: [PATCH] Typo in xml for expansion of helper plugins. Update to latest letsencryp and add nutups panel --- Targets/Letsencrypt/Letsencrypt.pm | 2 +- .../Letsencrypt/_lets_CHECKALLDOMAINS.html.ep | 2 +- .../_lets_CHECKALLENABLEDDOMAINS.html.ep | 2 +- .../Letsencrypt/_lets_CHECKONEDOMAIN.html.ep | 2 +- Targets/Letsencrypt/_lets_LIST.html.ep | 2 +- Targets/Letsencrypt/_lets_PARAMS.html.ep | 2 +- Targets/Letsencrypt/letsencrypt.html.ep | 2 +- Targets/Letsencrypt/letsencrypt_en.lex | 96 +++--- Targets/Nutups/Nutups-Custom.pm | 177 ++++++++++ Targets/Nutups/Nutups.pm | 311 ++++++++++++++++++ Targets/Nutups/_nut_CONFIG.html.ep | 95 ++++++ Targets/Nutups/_nut_STATUS.html.ep | 48 +++ Targets/Nutups/nutups.css | 26 ++ Targets/Nutups/nutups.html.ep | 57 ++++ Targets/Nutups/nutups_en.lex | 25 ++ Templates/html_controls.html.ep.xml | 8 +- json5/Nutups.json5 | 120 +++++++ sent_bugs.db | Bin 0 -> 12288 bytes sm2gen.py | 2 +- 19 files changed, 919 insertions(+), 60 deletions(-) create mode 100644 Targets/Nutups/Nutups-Custom.pm create mode 100644 Targets/Nutups/Nutups.pm create mode 100644 Targets/Nutups/_nut_CONFIG.html.ep create mode 100644 Targets/Nutups/_nut_STATUS.html.ep create mode 100644 Targets/Nutups/nutups.css create mode 100644 Targets/Nutups/nutups.html.ep create mode 100644 Targets/Nutups/nutups_en.lex create mode 100644 json5/Nutups.json5 create mode 100644 sent_bugs.db diff --git a/Targets/Letsencrypt/Letsencrypt.pm b/Targets/Letsencrypt/Letsencrypt.pm index 170aa70..821002a 100644 --- a/Targets/Letsencrypt/Letsencrypt.pm +++ b/Targets/Letsencrypt/Letsencrypt.pm @@ -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-12-09 17:20:08 +# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37 # #---------------------------------------------------------------------- # heading : Network diff --git a/Targets/Letsencrypt/_lets_CHECKALLDOMAINS.html.ep b/Targets/Letsencrypt/_lets_CHECKALLDOMAINS.html.ep index c5a5936..f339a2f 100644 --- a/Targets/Letsencrypt/_lets_CHECKALLDOMAINS.html.ep +++ b/Targets/Letsencrypt/_lets_CHECKALLDOMAINS.html.ep @@ -1,5 +1,5 @@ %# -%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:20:08 +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37 %#
+ % if ($config->{debug} == 1) { +
+			%= dumper $nut_data
+		
+ % } + % my $btn = l('nut_APPLY'); + %= form_for "nutupsu" => (method => 'POST') => begin + % param 'trt' => $nut_data->{trt} unless param 'trt'; + %= hidden_field 'trt' => $nut_data->{trt} + %# Inputs etc in here. + +

<%=l('nut_Manage_Nutups-config_settings:')%>

+ +

+ %=l('nut_Nut_status') + + % my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled']]; + % param 'status' => $nut_data->{status} unless param 'status'; + %= select_field 'status' => @status_options, class => 'input' +

+ +

+ %=l('nut_Nut_mode') + + % my @Nutmode_options = [['Standalone' => 'standalone'], ['Net Server' => 'netserver'], ['Net Client ' => 'netclient']]; + % param 'Nutmode' => $nut_data->{Nutmode} unless param 'Nutmode'; + %= select_field 'Nutmode' => @Nutmode_options, class => 'input' +

+ +

<%=l('nut_if_Net_Client')%>

+ +

+ %=l('nut_SlaveUPS_UPSNAME@IP') + + % param 'SlaveUPS_Name' => $nut_data->{SlaveUPS_Name} unless param 'SlaveUPS_Name'; + %= text_field 'SlaveUPS_Name', size => '50', class => 'textinput SlaveUPS_Name' , pattern=>'.*' , placeholder=>'SlaveUPS_Name' +

+ +

+ %=l('nut_SlaveUPS_Password') + + % param 'SlaveUPS_Password' => $nut_data->{SlaveUPS_Password} unless param 'SlaveUPS_Password'; + %=password_field 'SlaveUPS_Password', class => 'pass4 sme-password' + span>

+ + +

+ %=l('nut_UPS_Model') + + % param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model'; + %= text_field 'UPS_Model', size => '50', class => 'textinput UPS_Model' , pattern=>'.*' , placeholder=>'UPS_Model' +

+ +

+ %=l('nut_UPS_Device') + + % param 'UPS_Device' => $nut_data->{UPS_Device} unless param 'UPS_Device'; + %= text_field 'UPS_Device', size => '50', class => 'textinput UPS_Device' , pattern=>'.*' , placeholder=>'UPS_Device' +

+ +

<%=l('nut_if_genericups')%>

+ +

+ %=l('nut_UPS_Generic_Type') + + % param 'UPS_gen_Type' => $nut_data->{UPS_gen_Type} unless param 'UPS_gen_Type'; + %= text_field 'UPS_gen_Type', size => '50', class => 'textinput UPS_gen_Type' , pattern=>'.*' , placeholder=>'UPS_gen_Type' +

+ +

+ %=l('nut_UPS_Generic_Manufacturer') + + % param 'UPS_gen_Mfr' => $nut_data->{UPS_gen_Mfr} unless param 'UPS_gen_Mfr'; + %= text_field 'UPS_gen_Mfr', size => '50', class => 'textinput UPS_gen_Mfr' , pattern=>'.*' , placeholder=>'UPS_gen_Mfr' +

+ +

+ %=l('nut_UPS_Generic_Model') + + % param 'UPS_gen_Model' => $nut_data->{UPS_gen_Model} unless param 'UPS_gen_Model'; + %= text_field 'UPS_gen_Model', size => '50', class => 'textinput UPS_gen_Model' , pattern=>'.*' , placeholder=>'UPS_gen_Model' +

+ + %# Probably finally by a submit. + %end +
\ No newline at end of file diff --git a/Targets/Nutups/_nut_STATUS.html.ep b/Targets/Nutups/_nut_STATUS.html.ep new file mode 100644 index 0000000..2ce1aab --- /dev/null +++ b/Targets/Nutups/_nut_STATUS.html.ep @@ -0,0 +1,48 @@ +%# +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2025-01-20 12:01:10 +%# +
+ + % if ($config->{debug} == 1) { +
+			%= dumper $nut_data
+		
+ % } + % my $btn = l('nut_APPLY'); + %= form_for "nutupsu" => (method => 'POST') => begin + % param 'trt' => $nut_data->{trt} unless param 'trt'; + %= hidden_field 'trt' => $nut_data->{trt} + %# Inputs etc in here. + +
+ + + + %= l('nut_Configure_NutUPS') + + %#= link_to l('nut_Configure_NutUPS'), 'nutupsd?trt=CONFIG' , class=>'link link1' + + +
+ + +

<%=l('nut_Status_of_the_controlled_UPS')%>

+ +

+ %=l('nut_Descriptive_paragraph') +

+ + + %=l('nut_Status_(from_upsd)') + + % param 'UPSStatus' => $nut_data->{UPSStatus} unless param 'UPSStatus'; + %= text_area 'UPSStatus', cols=>40, rows=>10, Readonly=>'true' +
+ + %# Probably finally by a submit. + %end +
\ No newline at end of file diff --git a/Targets/Nutups/nutups.css b/Targets/Nutups/nutups.css new file mode 100644 index 0000000..986dade --- /dev/null +++ b/Targets/Nutups/nutups.css @@ -0,0 +1,26 @@ +/* +Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2025-01-20 12:01:10 +*/ +.Nutups-panel {} +.name {} +.rout {} +.grou {} +.link1 {} +.endg {} +.subh1 {} +.para1 {} +.text1 {} +.name {} +.rout {} +.subh2 {} +.sele1 {} +.sele2 {} +.subh3 {} +.text3 {} +.pass4 {} +.text5 {} +.text6 {} +.subh4 {} +.text7 {} +.text8 {} +.text9 {} diff --git a/Targets/Nutups/nutups.html.ep b/Targets/Nutups/nutups.html.ep new file mode 100644 index 0000000..e4ef42f --- /dev/null +++ b/Targets/Nutups/nutups.html.ep @@ -0,0 +1,57 @@ +%# +%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2025-01-20 12:01:10 +%# +% layout 'default', title => "Sme server 2 - NutUPS configuration", share_dir => './'; +%# css specific to this panel: +% content_for 'module' => begin +%= stylesheet '/css/nutups.css' +
+ + % if ($config->{debug} == 1) { +
+		%= dumper $c->current_route
+		%= dumper $nut_data->{trt}
+	
+ % } + +

<%=$title%>

+ + % if ( stash('modul')) { + %= $c->render_to_string(inline => stash('modul') ); + % } + + %if ($c->stash('first')) { +

+ %=$c->render_to_string(inline =>$c->l($c->stash('first'))) +

+ + %} elsif ($c->stash('success')) { +
+

<%=$c->l('nut_Status_Report') %>

+ %= $c->l($c->stash('success')); +

+
+ + %} elsif ($c->stash('error')) { +
+

<%=$c->l('nut_Error_Status_Report') %>

+ %= $c->l($c->stash('error')); +

+
+ %} + + %#Routing to partials according to trt parameter. + %#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement' + + % if ($nut_data->{trt} eq "STATUS") { + %= include 'partials/_nut_STATUS' + %} + + % if ($nut_data->{trt} eq "CONFIG") { + %= include 'partials/_nut_CONFIG' + %} + + + +
+%end \ No newline at end of file diff --git a/Targets/Nutups/nutups_en.lex b/Targets/Nutups/nutups_en.lex new file mode 100644 index 0000000..dad234a --- /dev/null +++ b/Targets/Nutups/nutups_en.lex @@ -0,0 +1,25 @@ +# +# Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2025-01-20 12:01:10 +# +'nut_Nut_mode' => 'Nut mode', +'nut_UPS_Generic_Type' => 'UPS Generic Type', +'nut_Error_Status_Report' => 'Error Status Report', +'nut_Manage_Nutups-config_settings:' => 'Manage Nutups-config settings', +'nut_if_Net_Client' => 'If Net Client', +'nut_Status_of_the_controlled_UPS' => 'Status of the controlled UPS', +'nut_Status_(from_upsd)' => 'Status from upset', +'nut_if_genericups' => 'If generic's', +'nut_NutUPS_configuration' => 'cutups configuration', +'nut_Nut_status' => 'Nut status', +'nut_UPS_Generic_Manufacturer' => 'UPS Generic Manufacturer', +'nut_Configure_NutUPS' => 'Configure cutups', +'nut_Descriptive_paragraph' => 'Descriptive paragraph', +'nut_UPS_Device' => 'UPS Device', +'nut_Status_Report' => 'Status Report', +'nut_SlaveUPS_Password' => 'slaves Password', +'nut_UPS_Model' => 'UPS Model', +'nut_APPLY' => 'Apply', +'nut_UPS_Generic_Model' => 'UPS Generic Model', +'nut_SlaveUPS_UPSNAME@IP' => 'slaves UPSNAME@IP', +'nut_CONFIG_panel_action_was_successful' => 'CONFIG panel action was successful', +'nut_STATUS_panel_action_was_successful' => 'STATUS panel action was successful', diff --git a/Templates/html_controls.html.ep.xml b/Templates/html_controls.html.ep.xml index 4d4b01b..5d644bc 100644 --- a/Templates/html_controls.html.ep.xml +++ b/Templates/html_controls.html.ep.xml @@ -1,5 +1,5 @@ - +