Fix error on json5 lint fail and add AdminLTE theme generated templates

This commit is contained in:
2025-09-06 08:23:59 +01:00
parent c3fba3a7d5
commit 29f8de63fd
17 changed files with 1116 additions and 146 deletions

View File

@@ -0,0 +1,53 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# Specific for AdminLTE theme
%#
<div id="Example1-PARAMS" class="partial Example1-PARAMS">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('ex1_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<div class="row g-3 align-items-center">
<h1 class='head'><%=l('ex1_Example_Contrib')%></h1></div><br>
<div class="row g-3 align-items-center">
<h2 class='subh'><%=l('ex1_Manage_Ibay_settings:')%></h2></div><br>
<div class="row g-3 align-items-center">
<p class='paragraph para1'>
%=l('ex1_These_parameters_will_be_effective')
</div><br><div class="row g-3 align-items-center">
<div class="col-md-1">
%=l('ex1_Information_Bay_name')
</div><div class="col-auto">
% param 'IbayName' => $ex1_data->{IbayName} unless param 'IbayName';
%= text_field 'IbayName', size => '50', class => 'textinput IbayName' , pattern=>'.*' , placeholder=>'IbayName', title =>'Pattern regex mismatch', id => 'IbayName_text'
</div>
</div><br><div class="row g-3 align-items-center">
<div class="col-md-1">
%=l('ex1_Share_owner_Group')
</div><div class="col-auto">
% my @ShareOwnerGrp_options = [['Write = admin, Read = group' => 'All'], ['Write = group, Read = everyone' => 'Read:All-Write:Grp']];
% param 'ShareOwnerGrp' => $ex1_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp';
%= select_field 'ShareOwnerGrp' => @ShareOwnerGrp_options, class => 'input', id => 'ShareOwnerGrp_select'
</div>
</div><br>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
<br>
</div>

View File

@@ -0,0 +1,57 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# Specific for AdminLTE theme
%#
<div id="Example1-TABLE" class="partial Example1-TABLE">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('ex1_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<div class="row g-3 align-items-center">
<h1 class='head'><%=l('ex1_NFS_Share_Contrib')%></h1></div><br>
<div class="row g-3 align-items-center">
<h2 class='subh'><%=l('ex1_Manage_NFS_Ibay_settings:')%></h2></div><br>
<div class="row g-3 align-items-center">
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Name '><%=l('ex1_Name')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('ex1_Description')%></th>
<th class='sme-border table-head-col table-head-col-Status '><%=l('ex1_Status')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('ex1_Action')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('ibays');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Name'><%=$c->render_to_string(inline=>$row->{'Name'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-flag'><%=$c->render_to_string(inline=>$row->{'flag'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
</div><br>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
<br>
</div>

View File

@@ -0,0 +1,20 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
*/
.Example1-panel {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.text1 {}
.sele2 {}
.name {}
.rout {}
.head {}
.subh {}
.next {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.next {}

View File

@@ -0,0 +1,58 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# AdminLTE specific layout
%#
% layout 'default', title => "Sme server 2 - Example 1", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/example1.css'
%= javascript '/js/example1.js'
<div id="module" class="card-body module Example1-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $ex1_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><div>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</div>
%} elsif ($c->stash('success')) {
<div class='text-success'>
%= $c->l($c->stash('success'));
</div>
%} elsif ($c->stash('error')) {
<div class='text-danger'>
%= $c->l($c->stash('error'));
</div>
%}
%#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'
<br>
% if ($ex1_data->{trt} eq "PARAMS") {
%= include 'partials/_ex1_PARAMS'
%}
<br>
% if ($ex1_data->{trt} eq "TABLE") {
%= include 'partials/_ex1_TABLE'
%}
<br>
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
//
$(document).ready(function() {
});